Skip to contentSkip to conversation

ARM: dts: cubieboard4: Fix DCDC5 regulator constraints

PATCH Applied Andre Przywara 2 participants 4 messages Oct 7, 2024 – Oct 25, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: dts: cubieboard4: Fix DCDC5 regulator constraints

The DCDC5 voltage rail in the X-Powers AXP809 PMIC has a resolution of 50mV, so the currently enforced limits of 1.475 and 1.525 volts cannot be set, when the existing regulator value is beyond this range.

This will lead to the whole regulator driver to give up and fail probing, which in turn will hang the system, as essential devices depend on the PMIC.
In this case a bug in U-Boot set the voltage to 1.75V (meant for DCDC4), and the AXP driver's attempt to correct this lead to this error:
==================

[    4.447653] axp20x-rsb sunxi-rsb-3a3: AXP20X driver loaded
[    4.450066] vcc-dram: Bringing 1750000uV into 1575000-1575000uV
[    4.460272] vcc-dram: failed to apply 1575000-1575000uV constraint: -EINVAL
[    4.474788] axp20x-regulator axp20x-regulator.0: Failed to register dcdc5
[    4.482276] axp20x-regulator axp20x-regulator.0: probe with driver axp20x-regulator failed with error -22

==================

Set the limits to values that can be programmed, so any correction will be successful.

---
 arch/arm/boot/dts/allwinner/sun9i-a80-cubieboard4.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/allwinner/sun9i-a80-cubieboard4.dts +2 -2
index c8ca8cb7f5c94..52ad95a2063aa 100644
@@ -280,8 +280,8 @@ reg_dcdc4: dcdc4 {
 
 			reg_dcdc5: dcdc5 {
 				regulator-always-on;
-				regulator-min-microvolt = <1425000>;
-				regulator-max-microvolt = <1575000>;
+				regulator-min-microvolt = <1450000>;
+				regulator-max-microvolt = <1550000>;
 				regulator-name = "vcc-dram";
 			};
 
Signature · 1 line
2.46.2
#1 lore raw
Quoted 16 lines · Andre Przywara

The DCDC5 voltage rail in the X-Powers AXP809 PMIC has a resolution of 50mV, so the currently enforced limits of 1.475 and 1.525 volts cannot be set, when the existing regulator value is beyond this range.

This will lead to the whole regulator driver to give up and fail probing, which in turn will hang the system, as essential devices depend on the PMIC.
In this case a bug in U-Boot set the voltage to 1.75V (meant for DCDC4), and the AXP driver's attempt to correct this lead to this error:
==================

[    4.447653] axp20x-rsb sunxi-rsb-3a3: AXP20X driver loaded
[    4.450066] vcc-dram: Bringing 1750000uV into 1575000-1575000uV
[    4.460272] vcc-dram: failed to apply 1575000-1575000uV constraint: -EINVAL
[    4.474788] axp20x-regulator axp20x-regulator.0: Failed to register dcdc5
[    4.482276] axp20x-regulator axp20x-regulator.0: probe with driver axp20x-regulator failed with error -22
Quoted 6 lines

==================

Set the limits to values that can be programmed, so any correction will be successful.

Maybe

Fixes 1e1dea72651b ("ARM: dts: sun9i: cubieboard4: Add AXP809 PMIC

device node and regulators")

What do you think? I can add it when applying.

ChenYu

Quoted 22 lines
---
 arch/arm/boot/dts/allwinner/sun9i-a80-cubieboard4.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/allwinner/sun9i-a80-cubieboard4.dts +2 -3
index c8ca8cb7f5c94..52ad95a2063aa 100644
@@ -280,8 +280,8 @@ reg_dcdc4: dcdc4 {
 
                        reg_dcdc5: dcdc5 {
                                regulator-always-on;
-                               regulator-min-microvolt = <1425000>;
-                               regulator-max-microvolt = <1575000>;
+                               regulator-min-microvolt = <1450000>;
+                               regulator-max-microvolt = <1550000>;
                                regulator-name = "vcc-dram";
                        };
 
--

2.46.2

#2 lore raw
Quoted 22 lines · On Fri, 25 Oct 2024 22:42:14 +0800 Chen-Yu Tsai <[email protected]> wrote:
Quoted 21 lines · Andre Przywara

The DCDC5 voltage rail in the X-Powers AXP809 PMIC has a resolution of 50mV, so the currently enforced limits of 1.475 and 1.525 volts cannot be set, when the existing regulator value is beyond this range.

This will lead to the whole regulator driver to give up and fail probing, which in turn will hang the system, as essential devices depend on the PMIC.
In this case a bug in U-Boot set the voltage to 1.75V (meant for DCDC4), and the AXP driver's attempt to correct this lead to this error:
==================

[    4.447653] axp20x-rsb sunxi-rsb-3a3: AXP20X driver loaded
[    4.450066] vcc-dram: Bringing 1750000uV into 1575000-1575000uV
[    4.460272] vcc-dram: failed to apply 1575000-1575000uV constraint: -EINVAL
[    4.474788] axp20x-regulator axp20x-regulator.0: Failed to register dcdc5
[    4.482276] axp20x-regulator axp20x-regulator.0: probe with driver axp20x-regulator failed with error -22

==================

Set the limits to values that can be programmed, so any correction will be successful.

Quoted 8 lines
Quoted 1 line

Maybe

Fixes 1e1dea72651b ("ARM: dts: sun9i: cubieboard4: Add AXP809 PMIC

device node and regulators")

What do you think? I can add it when applying.

Well, I thought about it, but then it's a DT patch, so the Fixes: tag doesn't make much sense here, IMHO. Put it there if you see fit, but for my part I am just waiting for the commit hash, to pull into U-Boot, and then it would be done, even for older kernels.

Cheers,
Andre.

Quoted 24 lines

ChenYu

Quoted 22 lines
---
 arch/arm/boot/dts/allwinner/sun9i-a80-cubieboard4.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/allwinner/sun9i-a80-cubieboard4.dts +2 -3
index c8ca8cb7f5c94..52ad95a2063aa 100644
@@ -280,8 +280,8 @@ reg_dcdc4: dcdc4 {
 
                        reg_dcdc5: dcdc5 {
                                regulator-always-on;
-                               regulator-min-microvolt = <1425000>;
-                               regulator-max-microvolt = <1575000>;
+                               regulator-min-microvolt = <1450000>;
+                               regulator-max-microvolt = <1550000>;
                                regulator-name = "vcc-dram";
                        };
 
--

2.46.2

Applied
#3 lore raw
In reply to Andre Przywara
Quoted 10 lines · Andre Przywara

The DCDC5 voltage rail in the X-Powers AXP809 PMIC has a resolution of 50mV, so the currently enforced limits of 1.475 and 1.525 volts cannot be set, when the existing regulator value is beyond this range.

This will lead to the whole regulator driver to give up and fail probing, which in turn will hang the system, as essential devices depend on the PMIC.
In this case a bug in U-Boot set the voltage to 1.75V (meant for DCDC4), and the AXP driver's attempt to correct this lead to this error:
==================

Quoted 8 lines
[    4.447653] axp20x-rsb sunxi-rsb-3a3: AXP20X driver loaded
[    4.450066] vcc-dram: Bringing 1750000uV into 1575000-1575000uV
[    4.460272] vcc-dram: failed to apply 1575000-1575000uV constraint: -EINVAL
[    4.474788] axp20x-regulator axp20x-regulator.0: Failed to register dcdc5
[    4.482276] axp20x-regulator axp20x-regulator.0: probe with driver axp20x-regulator failed with error -22

==================

[...]

Applied to fixes-for-6.12 in [email protected]:linux-sunxi/linux-sunxi.git, thanks!

[1/1] ARM: dts: cubieboard4: Fix DCDC5 regulator constraints

      commit: dd36ad71ad65968f97630808bc8d605c929b128e

Best regards,

Signature · 1 line
Chen-Yu Tsai <[email protected]>