
Hi Rick,
On 12 December 2016 at 09:57, Rick Bronson rick@efn.org wrote:
Hi Simon,
On 9 December 2016 at 18:12, Rick Bronson rick@efn.org wrote:
Hi All,
How do I enable a particular regulator upon boot? I have two identically set LDO entries:
vccio_en: LDO_REG1 { regulator-always-on; regulator-boot-on; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-name = "vccio_en"; regulator-state-mem { regulator-on-in-suspend; regulator-suspend-microvolt =
<3300000>;
}; }; vcc33_mic: LDO_REG2 { regulator-always-on; regulator-boot-on; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-name = "vcc33_mic"; regulator-state-mem { regulator-on-in-suspend; regulator-suspend-microvolt =
<3300000>;
}; };
Yet one is enabled, the other disabled, any idea why?:
=> regulator status Name Enabled uV mA Mode ... vccio_en enabled 3300000 - - vcc33_mic disabled 3300000 - -
And oddly, the uV values actually don't come from the DT but from the rk808_ldo table in drivers/power/regulator/rk808.c
Do you think this is happening by PMIC settings (in the device) rather than through U-Boot?
Think I found the reason for this, it's this way because of the way BOOT0, BOOT1 are strapped on the RK808.
Any ideas?
Thanks for any help.
There is a function called regulators_enable_boot_on() which enables all boot-on regulators that have a fixed voltage, but I don't think that is called with rockchip.
Now that I look at it, I cannot see why I put the voltage values in the driver. They should come form DT.
Do you think the right way to solve this is (from common/board_r.c):
__weak int power_init_board(void) { regulators_enable_boot_on(false); return 0; }
Tried this but it seems to introduce a race condition because often, it hangs.
This should only enable regulators - never disable them. I suggest trying to call regulator_autoset() for each regulator in turn in your function so that you know what causes the problem. I can't really imagine why enabling a regulator could cause a problem though.
You might consider putting the code in board_init().
Cheers,
Rick
Regards, Simon