Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sunxi: enable LCD DVDD power on Pine64 and Pine64-LTS #9

Open
wants to merge 1 commit into
base: allwinner
Choose a base branch
from

Conversation

anarsoul
Copy link

LCD if powered by 2 rails - DC1SW (AVDD) and DLDO2 (DVDD). DVDD must be
enabled before AVDD, otherwise if AVDD enabled first AXP overheats and board
shuts down.

Signed-off-by: Vasily Khoruzhick anarsoul@gmail.com

LCD if powered by 2 rails - DC1SW (AVDD) and DLDO2 (DVDD). DVDD must be
enabled before AVDD, otherwise if AVDD enabled first AXP overheats and board
shuts down.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
@apritzel
Copy link
Owner

Is this for the official Pine64 7" LCD panel? What is the Linux support story here? Does it work with mainline? And is that PMIC requirement (needs two rails, DLDO2 first) described in the DT?
I am not against it, but this PMIC setup starts to get a bit messy, so I'd like to know more about it.

@anarsoul
Copy link
Author

Yes, it's for official Pine64 7" LCD panel. It works with https://github.com/anarsoul/linux-2.6/tree/sunxi64-4.17-dsi - but I haven't had time to clean it up and send it upstream.

Panel will be likely handled by a separate driver (not simple-panel), so there's no need to describe panel power on sequence in DT - it can be done in driver.

@apritzel
Copy link
Owner

Well, since it is board dependent and external to the actual DSI controller or the panel itself, it needs to go into the DT. Maybe there is something already which models regulator order? Something like mmc-pwrseq? Or maybe split this up, into one regulator being tied to the DSI controller, the other one to the panel?
Anyway, do you need this in U-Boot? The kernel would need to be able to power this on and off itself (for suspend/resume, for instance), so the firmware would only need to take care of U-Boot.
Also I plan on porting the power setup to the mainline ATF port, where I will try to utilize the DT to work out which power rails ATF should already enable. So we need a proper (DT based) solution anyway.

@anarsoul
Copy link
Author

Yes, I need it in u-boot, since ATF enables DC1_SW. And if it's enabled without DLDO2 being enabled PMIC overheats and board shuts down (probably thermal protection). Basically board won't boot with LCD connected without this commit.

@apritzel
Copy link
Owner

So I created a branch with some PMIC setup using the DT for the mainline ATF port:
https://github.com/Andre-ARM/arm-trusted-firmware/tree/allwinner/pmic-wip
Can you try if you can build something on top of this?
I guess it would work like this:

  • Reference the DLDO2 regulator in the DT, so that it gets a phandle and the ATF code considers it.
  • Add a stanza to parse the DLDO2 regulator (copy and adjust DLDO1).
  • Don't immediately apply the DC1SW regulator setting to the PMIC, instead just set a variable. Once we have every regulator setup, set DC1SW based on that variable. That would ensure that DC1SW is always enabled after DLDO2, if we need the latter.

Does this make sense?

@anarsoul
Copy link
Author

anarsoul commented Oct 4, 2018

I'll look into it this weekend.

@apritzel
Copy link
Owner

apritzel commented Oct 4, 2018

@anarsoul: No need, actually, I added support for it already. I just didn't push the patches yet, as there are some other issues I need to address first. Will probably update my -wip branch in the next days.

@Andre-ARM
Copy link

Can you check whether this commit fixes it for you?

The branch is still WIP, it needs more testing (and I think I managed to break it last night).

Also you need your regulators to be described in U-Boot's DT (as this is what ATF reads). But this would not require any Pinebook (or whatever model) specific hacks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants