Skip to contentSkip to conversation

arm64: dts: meson: odroid-n2: keep SD card regulator always on

PATCH In review Xavier Ruppen 5 participants 7 messages Jul 19, 2019 – Jul 25, 2019

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

PATCH 1/1 arm64: dts: meson: odroid-n2: keep SD card regulator always on

When powering off the Odroid N2, the tflash_vdd regulator is automatically turned off by the kernel. This is a problem when issuing the "reboot" command while using an SD card. The boot ROM does not power this regulator back on, blocking the reboot process at the boot ROM stage, preventing the SD card from being detected.

Adding the "regulator-always-on" property fixes the problem.

---

Here is what the boot ROM output looks like without this patch:

    [root@alarm ~]# reboot 
    [...]
    [   24.275860] shutdown[1]: All loop devices detached.
    [   24.278864] shutdown[1]: Detaching DM devices.
    [   24.287105] kvm: exiting hardware virtualization
    [   24.318776] reboot: Restarting system
    bl31 reboot reason: 0xd
    bl31 reboot reason: 0x0
    system cmd  1.
    G12B:BL:6e7c85:7898ac;FEAT:E0F83180:2000;POC:F;RCY:0;
    EMMC:800;NAND:81;SD?:0;SD:400;USB:8;LOOP:1;EMMC:800;
    NAND:81;SD?:0;SD:400;USB:8;LOOP:2;EMMC:800;NAND:81;
    SD?:0;SD:400;USB:8;LOOP:3; [...]

Other people can be seen having this problem on the odroid forum [1].

The cause of the problem was found by Martin Blumenstingl on #linux-amlogic. We may want to add his Suggested-by tag if he agrees.

[1] https://forum.odroid.com/viewtopic.php?f=176&t=33993

 arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +1 -0
index 81780ffcc7f0..4e916e1f71f7 100644
@@ -53,6 +53,7 @@
 
 		gpio = <&gpio_ao GPIOAO_8 GPIO_ACTIVE_HIGH>;
 		enable-active-high;
+		regulator-always-on;
 	};
 
 	tf_io: gpio-regulator-tf_io {
Signature · 1 line
2.21.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 46 lines · Xavier Ruppen

When powering off the Odroid N2, the tflash_vdd regulator is automatically turned off by the kernel. This is a problem when issuing the "reboot" command while using an SD card. The boot ROM does not power this regulator back on, blocking the reboot process at the boot ROM stage, preventing the SD card from being detected.

Adding the "regulator-always-on" property fixes the problem.

---

Here is what the boot ROM output looks like without this patch:

    [root@alarm ~]# reboot 
    [...]
    [   24.275860] shutdown[1]: All loop devices detached.
    [   24.278864] shutdown[1]: Detaching DM devices.
    [   24.287105] kvm: exiting hardware virtualization
    [   24.318776] reboot: Restarting system
    bl31 reboot reason: 0xd
    bl31 reboot reason: 0x0
    system cmd  1.
    G12B:BL:6e7c85:7898ac;FEAT:E0F83180:2000;POC:F;RCY:0;
    EMMC:800;NAND:81;SD?:0;SD:400;USB:8;LOOP:1;EMMC:800;
    NAND:81;SD?:0;SD:400;USB:8;LOOP:2;EMMC:800;NAND:81;
    SD?:0;SD:400;USB:8;LOOP:3; [...]

Other people can be seen having this problem on the odroid forum [1].

The cause of the problem was found by Martin Blumenstingl on #linux-amlogic. We may want to add his Suggested-by tag if he agrees.

[1] https://forum.odroid.com/viewtopic.php?f=176&t=33993

 arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +0 -0
index 81780ffcc7f0..4e916e1f71f7 100644

arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts line 59

Quoted 7 lines
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +1 -0
@@ -53,6 +53,7 @@
 
 		gpio = <&gpio_ao GPIOAO_8 GPIO_ACTIVE_HIGH>;
 		enable-active-high;
+		regulator-always-on;
 	};
 
 	tf_io: gpio-regulator-tf_io {

Surely solves the situation, thanks !

please add a comment on top of "regulator-always-on" to explain why we always enable it, note we should always enable it in case of watchdog reboot or other uncontrolled reset, this regulator must never be disabled.

Thanks,
Neil

#2 lore raw

Hi All,

Quoted 58 lines · Neil Armstrong
Quoted 46 lines · Xavier Ruppen

When powering off the Odroid N2, the tflash_vdd regulator is automatically turned off by the kernel. This is a problem when issuing the "reboot" command while using an SD card. The boot ROM does not power this regulator back on, blocking the reboot process at the boot ROM stage, preventing the SD card from being detected.

Adding the "regulator-always-on" property fixes the problem.

---

Here is what the boot ROM output looks like without this patch:

    [root@alarm ~]# reboot
    [...]
    [   24.275860] shutdown[1]: All loop devices detached.
    [   24.278864] shutdown[1]: Detaching DM devices.
    [   24.287105] kvm: exiting hardware virtualization
    [   24.318776] reboot: Restarting system
    bl31 reboot reason: 0xd
    bl31 reboot reason: 0x0
    system cmd  1.
    G12B:BL:6e7c85:7898ac;FEAT:E0F83180:2000;POC:F;RCY:0;
    EMMC:800;NAND:81;SD?:0;SD:400;USB:8;LOOP:1;EMMC:800;
    NAND:81;SD?:0;SD:400;USB:8;LOOP:2;EMMC:800;NAND:81;
    SD?:0;SD:400;USB:8;LOOP:3; [...]

Other people can be seen having this problem on the odroid forum [1].

The cause of the problem was found by Martin Blumenstingl on #linux-amlogic. We may want to add his Suggested-by tag if he agrees.

[1] https://forum.odroid.com/viewtopic.php?f=176&t=33993

 arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +0 -0
index 81780ffcc7f0..4e916e1f71f7 100644

arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts line 59

Quoted 7 lines
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +1 -0
@@ -53,6 +53,7 @@
 
              gpio = <&gpio_ao GPIOAO_8 GPIO_ACTIVE_HIGH>;
              enable-active-high;
+             regulator-always-on;
      };
 
      tf_io: gpio-regulator-tf_io {

Surely solves the situation, thanks !

Quoted 9 lines

please add a comment on top of "regulator-always-on" to explain why we always enable it, note we should always enable it in case of watchdog reboot or other uncontrolled reset, this regulator must never be disabled.

Thanks,
Neil

I am afraid this did not fix the issue I was also facing with Archlinux on Odroid N2 using mainline u-boot.
Here is the log of at my end using latest mainline u-boot with Neil's patches.

[0] https://pastebin.com/HNmeY5uF

Well this issue also persist with eMMC not getting detected after reboot If I try to change the dts to fix the sdcard.

I am checking this should we enable regulator-boot-on option but still no luck.

Best Regards
-Anand

#3 lore raw

Hi Anand,

Quoted 65 lines · Anand Moon

Hi All,

Quoted 62 lines · Neil Armstrong
Quoted 46 lines · Xavier Ruppen

When powering off the Odroid N2, the tflash_vdd regulator is automatically turned off by the kernel. This is a problem when issuing the "reboot" command while using an SD card. The boot ROM does not power this regulator back on, blocking the reboot process at the boot ROM stage, preventing the SD card from being detected.

Adding the "regulator-always-on" property fixes the problem.

---

Here is what the boot ROM output looks like without this patch:

    [root@alarm ~]# reboot
    [...]
    [   24.275860] shutdown[1]: All loop devices detached.
    [   24.278864] shutdown[1]: Detaching DM devices.
    [   24.287105] kvm: exiting hardware virtualization
    [   24.318776] reboot: Restarting system
    bl31 reboot reason: 0xd
    bl31 reboot reason: 0x0
    system cmd  1.
    G12B:BL:6e7c85:7898ac;FEAT:E0F83180:2000;POC:F;RCY:0;
    EMMC:800;NAND:81;SD?:0;SD:400;USB:8;LOOP:1;EMMC:800;
    NAND:81;SD?:0;SD:400;USB:8;LOOP:2;EMMC:800;NAND:81;
    SD?:0;SD:400;USB:8;LOOP:3; [...]

Other people can be seen having this problem on the odroid forum [1].

The cause of the problem was found by Martin Blumenstingl on #linux-amlogic. We may want to add his Suggested-by tag if he agrees.

[1] https://forum.odroid.com/viewtopic.php?f=176&t=33993

 arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +0 -0
index 81780ffcc7f0..4e916e1f71f7 100644

arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts line 59

Quoted 7 lines
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +1 -0
@@ -53,6 +53,7 @@
 
              gpio = <&gpio_ao GPIOAO_8 GPIO_ACTIVE_HIGH>;
              enable-active-high;
+             regulator-always-on;
      };
 
      tf_io: gpio-regulator-tf_io {

Surely solves the situation, thanks !

please add a comment on top of "regulator-always-on" to explain why we always enable it, note we should always enable it in case of watchdog reboot or other uncontrolled reset, this regulator must never be disabled.

Quoted 8 lines
Quoted 5 lines

Thanks,
Neil

I am afraid this did not fix the issue I was also facing with Archlinux on Odroid N2 using mainline u-boot.

Seems to be a separate issue, could we start a separate thread with all your setup (branch, git SHAa, configs, board setup, ...) for this ?

Thanks,
Neil

Quoted 12 lines

Here is the log of at my end using latest mainline u-boot with Neil's patches.

[0] https://pastebin.com/HNmeY5uF

Well this issue also persist with eMMC not getting detected after reboot If I try to change the dts to fix the sdcard.

I am checking this should we enable regulator-boot-on option but still no luck.

Best Regards
-Anand

#4 lore raw

Hi Neil,

Quoted 75 lines · Neil Armstrong

Hi Anand,

Quoted 71 lines · Anand Moon

Hi All,

Quoted 67 lines · Neil Armstrong
Quoted 46 lines · Xavier Ruppen

When powering off the Odroid N2, the tflash_vdd regulator is automatically turned off by the kernel. This is a problem when issuing the "reboot" command while using an SD card. The boot ROM does not power this regulator back on, blocking the reboot process at the boot ROM stage, preventing the SD card from being detected.

Adding the "regulator-always-on" property fixes the problem.

---

Here is what the boot ROM output looks like without this patch:

    [root@alarm ~]# reboot
    [...]
    [   24.275860] shutdown[1]: All loop devices detached.
    [   24.278864] shutdown[1]: Detaching DM devices.
    [   24.287105] kvm: exiting hardware virtualization
    [   24.318776] reboot: Restarting system
    bl31 reboot reason: 0xd
    bl31 reboot reason: 0x0
    system cmd  1.
    G12B:BL:6e7c85:7898ac;FEAT:E0F83180:2000;POC:F;RCY:0;
    EMMC:800;NAND:81;SD?:0;SD:400;USB:8;LOOP:1;EMMC:800;
    NAND:81;SD?:0;SD:400;USB:8;LOOP:2;EMMC:800;NAND:81;
    SD?:0;SD:400;USB:8;LOOP:3; [...]

Other people can be seen having this problem on the odroid forum [1].

The cause of the problem was found by Martin Blumenstingl on #linux-amlogic. We may want to add his Suggested-by tag if he agrees.

[1] https://forum.odroid.com/viewtopic.php?f=176&t=33993

 arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +0 -0
index 81780ffcc7f0..4e916e1f71f7 100644

arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts line 59

Quoted 7 lines
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +1 -0
@@ -53,6 +53,7 @@
 
              gpio = <&gpio_ao GPIOAO_8 GPIO_ACTIVE_HIGH>;
              enable-active-high;
+             regulator-always-on;
      };
 
      tf_io: gpio-regulator-tf_io {

Surely solves the situation, thanks !

please add a comment on top of "regulator-always-on" to explain why we always enable it, note we should always enable it in case of watchdog reboot or other uncontrolled reset, this regulator must never be disabled.

Thanks,
Neil

Quoted 9 lines
Quoted 2 lines

I am afraid this did not fix the issue I was also facing with Archlinux on Odroid N2 using mainline u-boot.

Seems to be a separate issue, could we start a separate thread with all your setup (branch, git SHAa, configs, board setup, ...) for this ?

Thanks,
Neil

Ok sorry for the noise.

Best Regards
-Anand

reviewer Reviewed-by on v1 1/1
#5 lore raw
In reply to Xavier Ruppen
Quoted 11 lines · Xavier Ruppen

When powering off the Odroid N2, the tflash_vdd regulator is automatically turned off by the kernel. This is a problem when issuing the "reboot" command while using an SD card. The boot ROM does not power this regulator back on, blocking the reboot process at the boot ROM stage, preventing the SD card from being detected.

Adding the "regulator-always-on" property fixes the problem.

Quoted 18 lines

---

Here is what the boot ROM output looks like without this patch:

    [root@alarm ~]# reboot
    [...]
    [   24.275860] shutdown[1]: All loop devices detached.
    [   24.278864] shutdown[1]: Detaching DM devices.
    [   24.287105] kvm: exiting hardware virtualization
    [   24.318776] reboot: Restarting system
    bl31 reboot reason: 0xd
    bl31 reboot reason: 0x0
    system cmd  1.
    G12B:BL:6e7c85:7898ac;FEAT:E0F83180:2000;POC:F;RCY:0;
    EMMC:800;NAND:81;SD?:0;SD:400;USB:8;LOOP:1;EMMC:800;
    NAND:81;SD?:0;SD:400;USB:8;LOOP:2;EMMC:800;NAND:81;
    SD?:0;SD:400;USB:8;LOOP:3; [...]
Quoted 2 lines

Other people can be seen having this problem on the odroid forum [1].

thank you for submitting this patch (and not keeping it to yourself)!

Quoted 3 lines

The cause of the problem was found by Martin Blumenstingl on #linux-amlogic. We may want to add his Suggested-by tag if he agrees.

yes, if you re-send this patch to address Neil's comment then feel free to add my Reviewed-by as well as a Suggested-by

Martin

maintainer
#6 lore raw
In reply to Xavier Ruppen
Quoted 10 lines · Xavier Ruppen

When powering off the Odroid N2, the tflash_vdd regulator is automatically turned off by the kernel. This is a problem when issuing the "reboot" command while using an SD card. The boot ROM does not power this regulator back on, blocking the reboot process at the boot ROM stage, preventing the SD card from being detected.

Adding the "regulator-always-on" property fixes the problem.

Thanks for the fix and the detailed background description.

Queued as a fix for v5.3.

Note that I also added this to the commit log, for the benefit of anyone wanting to backport.

Fixes c35f6dc5c377 ("arm64: dts: meson: Add minimal support for Odroid-N2")
Quoted 17 lines

Here is what the boot ROM output looks like without this patch:

    [root@alarm ~]# reboot 
    [...]
    [   24.275860] shutdown[1]: All loop devices detached.
    [   24.278864] shutdown[1]: Detaching DM devices.
    [   24.287105] kvm: exiting hardware virtualization
    [   24.318776] reboot: Restarting system
    bl31 reboot reason: 0xd
    bl31 reboot reason: 0x0
    system cmd  1.
    G12B:BL:6e7c85:7898ac;FEAT:E0F83180:2000;POC:F;RCY:0;
    EMMC:800;NAND:81;SD?:0;SD:400;USB:8;LOOP:1;EMMC:800;
    NAND:81;SD?:0;SD:400;USB:8;LOOP:2;EMMC:800;NAND:81;
    SD?:0;SD:400;USB:8;LOOP:3; [...]
Quoted 6 lines

Other people can be seen having this problem on the odroid forum [1].

The cause of the problem was found by Martin Blumenstingl on #linux-amlogic. We may want to add his Suggested-by tag if he agrees.

Added.

Thanks!

Kevin

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic