Skip to content

Pinephone Pro: Add 2A current limit to PMIC to fix low battery bootloop#168

Closed
ghost wants to merge 1 commit intodevelopmentfrom
unknown repository
Closed

Pinephone Pro: Add 2A current limit to PMIC to fix low battery bootloop#168
ghost wants to merge 1 commit intodevelopmentfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented Aug 2, 2022

Hello!!

This is a tiny patch based on the work megi has done in their levinboot firmware. By setting the register 0xA1, 'USB_CTRL_REG', to 0x77 it sets the current limit to 2A and therefore allowing the device take a good amount of charge before the OS has started. Moreover, the recent commits on their kernel fork has allowed for the set current limit at boot stay until the OS can change to a more sutible value.

This should iradicate the bootloop issue completely. In their levinboot it works fine so it should work fine here too.

I haven't had chance to test it but theoretically it should work, i'll update this PR when i get round to testing it tomorrow unless someone beats me to it :)

All the best,

Joe.

@samueldr
Copy link
Contributor

samueldr commented Aug 2, 2022

Hi!

Thanks for the contribution.

Currently, the way this PR is made, the patch isn't being added to the build. The patch would need to be added to the patches list here. Added last is likely fine.

Additionally, though it will require some git knowledge, it would be nice if you could rebase and squash the "edit" commit into a single commit, and use the form board-name: message as the commit title. If it's something you're not comfortable doing, no worries, I can handle it later on.

(I'll properly look at the change later.)

@ghost
Copy link
Author

ghost commented Aug 3, 2022

Hi there!

Thank you for your feedback, this is my first time every doing anything with Tow-boot so forgive me. I can do all that tomorrow sometime unless you beat me to it.

Thanks again,

Joe.

Update 2A rk8xx limit patch for the PinePhonePro

Pinephone Pro: Add 2A current limit for PMIC

Pinephone Pro: Remove enum address value set

Pinephone Pro: Add patch to default.nix
@ghost ghost changed the title Set RK8xx current limit to 2A to fix low battery bootloop on the Pinephone Pro Pinephone Pro: Add 2A current limit to PMIC to fix low battery bootloop Aug 3, 2022
@ghost
Copy link
Author

ghost commented Aug 3, 2022

Hope that is a little bit better, sorry for the delay

@samueldr samueldr added the 4. type: fix Not an enhancement, not a bugfix label Aug 3, 2022
@samueldr
Copy link
Contributor

samueldr commented Aug 3, 2022

Hope that is a little bit better, sorry for the delay

Haha, don't be. You're not "on the hook" for anything here. The change set looks okay.

Can you described how (and if) you tested and validated the change?

No worries if in the end you haven't tested, I want to know so that if results diverge on my end I can make a guess for the reasons why.

@ghost
Copy link
Author

ghost commented Aug 3, 2022

I am just about to try and figure out how to build Tow-Boot with this patch, i'm also trying to drain my pinephone pro as we speak. I'll report back asap :)

@ghost
Copy link
Author

ghost commented Aug 4, 2022

Some notes from testing: Last night when the battery was completely flat (the phone didn't show any signs of life at all), it took two tries to boot Linux. The phone started the first time and crashed and then the next time it started and booted fine.

This morning however, the battery again is completely flat and plugging it into a power source allows the phone to just boots straight up. Would like some more testing on this done, i'll do some today with older kernels and test again with Tow-Boot without this patch.

@ghost
Copy link
Author

ghost commented Aug 4, 2022

Update: I moved the latest released Tow-Boot version without this patch onto the SPI and the phone bootloops continuesly when trying to boot an OS. Moving back to Tow-Boot with this patch and using megis kernel it boots first time, with stock it doesn't. This is the patch for the kernel that is like part 2 of fixing the boot loop issue: https://xff.cz/git/linux/commit/?h=ppp-drivers-5.19&id=bd62b82172bab9298fa9f3a337a6a817435ebfae

@ghost
Copy link
Author

ghost commented Aug 13, 2022

Hi there!

Just wanted to give a small update on testing. With this patch on the SPI, using a fresh flash of the latest manjaro plasma mobile dev to the SD card and a completely flat battery the phone boots first time without issue.

@khimaros
Copy link

khimaros commented Nov 2, 2022

is there an equivalent solution possible for pinephoneA64?

@samueldr
Copy link
Contributor

samueldr commented Nov 8, 2022

Hi 👋, sorry it took this long until I could finally review and look into this.

We probably should go with the following instead:

One difference with that one is it uses 1.5A, but the implementation seems more proper. I also hope that this other implementation will/can be upstreamed.

This current PR is serviceable to help alleviate issues, but is not upstreamable. (Though I think you knew.)

@samueldr samueldr added the 9. status: superseded Another issue or pull request replaces this issue or pull request label Nov 8, 2022
@samueldr samueldr closed this Nov 8, 2022
@samueldr
Copy link
Contributor

samueldr commented Nov 8, 2022

Even though it was superseded, thank you for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1. family: rockchip 4. type: fix Not an enhancement, not a bugfix 9. status: superseded Another issue or pull request replaces this issue or pull request

Development

Successfully merging this pull request may close these issues.

2 participants