Skip to contentSkip to conversation

Rockchip RK3288 regulator device table problem

U-Boot Rick Bronson 3 participants 3 messages Dec 12, 2016 – Dec 17, 2016

lore
Share & tools
lore
#0 lore raw

Hi Simon,

Quoted 7 lines · Rick Bronson
Quoted 5 lines

Hi All,

How do I enable a particular regulator upon boot? I have two
identically set LDO entries:

Quoted 9 lines
Quoted 9 lines
                        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>;

Quoted 12 lines
Quoted 4 lines
                                };
                        };

                        vcc33_mic: LDO_REG2 {
Quoted 8 lines
                                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>;

Quoted 11 lines
Quoted 11 lines
                                };
                        };

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          - -
Quoted 5 lines
Quoted 2 lines

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.

Quoted 7 lines
Quoted 6 lines

Any ideas?

Thanks for any help.

Quoted 6 lines

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.

Cheers,

Rick

#1 lore raw
Quoted 68 lines · Rick Bronson

Hi Simon,

Quoted 7 lines · Rick Bronson
Quoted 5 lines

Hi All,

How do I enable a particular regulator upon boot? I have two
identically set LDO entries:

Quoted 9 lines
Quoted 9 lines
                        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>;

Quoted 12 lines
Quoted 4 lines
                                };
                        };

                        vcc33_mic: LDO_REG2 {
Quoted 8 lines
                                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>;

Quoted 11 lines
Quoted 11 lines
                                };
                        };

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          - -
Quoted 5 lines
Quoted 2 lines

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.

Quoted 7 lines
Quoted 6 lines

Any ideas?

Thanks for any help.

Quoted 6 lines

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):

Quoted 8 lines

__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.

I think it's not solution..I don't know how Simon think about..
But if you need to put regulators_enable_boot_on()..then you put "power_init_board()" in board/rockchip/evb_rk3036(?).

In other words, make the power_init_board() for rockhip...not touch the "__weak int power_init_board()".?

Best Regards,
Jaehoon Chung

Quoted 14 lines

Cheers,

Rick

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#2 lore raw
In reply to Rick Bronson

Hi Rick,

Quoted 68 lines · Rick Bronson

Hi Simon,

Quoted 7 lines · Rick Bronson
Quoted 5 lines

Hi All,

How do I enable a particular regulator upon boot? I have two
identically set LDO entries:

Quoted 9 lines
Quoted 9 lines
                        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>;

Quoted 12 lines
Quoted 4 lines
                                };
                        };

                        vcc33_mic: LDO_REG2 {
Quoted 8 lines
                                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>;

Quoted 11 lines
Quoted 11 lines
                                };
                        };

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          - -
Quoted 5 lines
Quoted 2 lines

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.

Quoted 7 lines
Quoted 6 lines

Any ideas?

Thanks for any help.

Quoted 6 lines

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):

Quoted 8 lines

__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().

Quoted 6 lines

Cheers,

Rick

Regards,
Simon

Quoted 1 line