Skip to content

Commit 436418e

Browse files
Eric Neulightsuperna9999
authored andcommitted
arm64: dts: amlogic: meson-sm1-odroid: Eliminate Odroid HC4 power glitches during boot.
Fix issue with Odroid HC4 (and all meson-sm1-odroid) DTS that causes regulator power to momentarily glitch OFF-ON during boot. Add regulator-boot-on to all regulator-fixed and regulator-gpio entries that (1) define a gpio AND (2) define regulator-always-on. U-boot powers on devices necessary for boot then hands off the DTB to the kernel. During probe, linux drivers/regulator/fixed.c and gpio-regulator.c both first set the regulator control gpio (that U-boot already turned ON) to default OFF before then setting it to the defined (ON) state. This glitches the power to the affected devices, unless regulator-boot-on is specified with it. In fact, U-boot has the same behavior. So, during reboot, a power glitch can actually happen twice: once when U-boot reads the DTB and probes the gpio and again when the kernel reads the DTB and probes the gpio. Problem this fixes: On the Odroid HC4, power to the SATA ports glitches during boot and causes some HDDs to do emergency head retract, which should be avoided. On the HC4, power glitches to the SD card, USB, SATA, and HDMI interfaces during boot. These are all boot devices. A power glitch can potentially cause a problem for any sensitive devices during boot. NOTE: This is not limited to just the HC4, likely an issue with ALL DTS with regulator-fixed or regulator-gpio entries that (1) define a gpio AND (2) define regulator-always-on. All such entries should also include regulator-boot-on in order to avoid potential power glitches. At worst, adding regulator-boot-on in such cases is harmless because of regulator-always-on, and, at best, it eliminates detrimental power glitches during boot. So, this is best-practice. Fixes: 164147f ("arm64: dts: meson-sm1-odroid-hc4: add regulators controlled by GPIOH_8") Fixes: 45d736a ("arm64: dts: meson-sm1-odroid: add 5v regulator gpio") Fixes: 1f80a5c ("arm64: dts: meson-sm1-odroid: add missing enable gpio and supply for tf_io regulator") Fixes: 88d537b ("arm64: dts: meson: convert meson-sm1-odroid-c4 to dtsi") Signed-off-by: Eric Neulight <Eric.Neulight@linuxdev.slmail.me> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Acked-by: Viacheslav Bocharov <v@baodeep.com> Tested-by: Ricardo Pardini <ricardo@pardini.net> # on Odroid-HC4 5V HDD Link: https://patch.msgid.link/20260116-odroid-hc4-dts-v1-1-459b601cd5cf@linuxdev.slmail.me [narmstrong: fixed subject prefix] Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
1 parent 1099b3b commit 436418e

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252

5353
gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
5454
enable-active-high;
55+
regulator-boot-on;
5556
regulator-always-on;
5657
};
5758

@@ -65,6 +66,7 @@
6566

6667
gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
6768
enable-active-high;
69+
regulator-boot-on;
6870
regulator-always-on;
6971
};
7072

arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737

3838
gpio = <&gpio_ao GPIOAO_3 GPIO_OPEN_DRAIN>;
3939
enable-active-high;
40+
regulator-boot-on;
4041
regulator-always-on;
4142
};
4243

@@ -50,6 +51,7 @@
5051

5152
enable-gpios = <&gpio_ao GPIOE_2 GPIO_OPEN_DRAIN>;
5253
enable-active-high;
54+
regulator-boot-on;
5355
regulator-always-on;
5456

5557
gpios = <&gpio_ao GPIOAO_6 GPIO_OPEN_SOURCE>;
@@ -81,6 +83,7 @@
8183
regulator-name = "5V";
8284
regulator-min-microvolt = <5000000>;
8385
regulator-max-microvolt = <5000000>;
86+
regulator-boot-on;
8487
regulator-always-on;
8588
vin-supply = <&main_12v>;
8689
gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;

0 commit comments

Comments
 (0)