lk2nd icon indicating copy to clipboard operation
lk2nd copied to clipboard

Add fastboot oem commands to access SPMI/PMIC

Open fxsheep opened this issue 3 years ago • 4 comments

Usage:

fastboot oem spmi read <address>
fastboot oem spmi write <address> <value>

fxsheep avatar Sep 25 '22 12:09 fxsheep

Do note that this two commands (among many other lk2nd debugging-orientated features) give the possibility to severely and permanently damage the hardware (e.g. one wrong voltage and half of motherboard is fried). IMHO lk2nd lacks a warning/precaution of such a risk.

fxsheep avatar Sep 26 '22 13:09 fxsheep

Hi, We are considering to obsolete the current lk2nd branch in favor of the different one (currently in experimental-tmp) in the near future, so I'd appreciate if you could target that with your PR. This should be pretty easy, please see e.g. https://github.com/msm8916-mainline/lk2nd/blob/experimental-tmp/lk2nd/fastboot/misc.c

The file will need to be conditionally compiled for those targets that have the pmic.

TravMurav avatar Sep 27 '22 06:09 TravMurav

Thanks for clarification and advice. I'm closing this temporarily.

fxsheep avatar Sep 27 '22 08:09 fxsheep

I'd still like to keep this open as a reminder. Basically the idea is to have a lk2nd/fastboot/debug module in the new branch which would implement functionality such as the readl/writel or something like this.

I suppose we could disable it by default if it's considered too dangerous (although generally I'd hope users are reasonable enough to avoid using commands they do not understand).

stephan-gh avatar Sep 28 '22 17:09 stephan-gh

I added fastboot oem debug readpmic and fastboot oem debug writepmic in the experimental-tmp3 branch of the new lk2nd rebase. Thanks for the idea!

stephan-gh avatar Sep 09 '23 13:09 stephan-gh