mmc: dts: am654: Add 650ms power off delay for proper MMC power cycle
Subsystems (2)
PATCH 1/1 mmc: dts: am654: Add 650ms power off delay for proper MMC power cycle
The AM65x EVM MMC1 VDD rail discharges slowly through RC circuit. SD spec (section 6.4.1.3) requires VDD < 0.5V for minimum 1ms during power cycle. Measured discharge time on this board is ~632.97ms to reach < 0.5V threshold.
During boot, MMC power cycles between boot stages. Without power off delay, VDD doesn't fully discharge. Card retains 1.8V signaling state from previous stages. When U-Boot initializes, card no longer asserts S18A in ACMD41 response (already switched to 1.8V). Host misinterprets card state and forces 1.8V anyway, falling into a bad state and causing a boot failure.
Add power-off-delay-us = 650000 (650ms) to ensure proper VDD discharge during power cycles, allowing card to fully reset state between boot stages.
--- arch/arm64/boot/dts/ti/k3-am654-base-board.dts | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/ti/k3-am654-base-board.dts +1 -0
@@ -460,6 +460,7 @@ &sdhci0 { &sdhci1 { status = "okay"; vmmc-supply = <&vdd_mmc1_sd>; + power-off-delay-us = <650000>; pinctrl-names = "default"; pinctrl-0 = <&main_mmc1_pins_default>; ti,driver-strength-ohm = <50>;
Signature · 1 line
2.34.1
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The `power-off-delay-us` property is added directly to the MMC host controller node, where it is…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The power-off-delay-us property is added directly to the MMC host controller node, where it is completely ignored, rendering the boot failure fix entirely ineffective. --
commit 02105a5fc6c6d24da9df99e671b001a1f3cd6d1c
Author: Judith Mendez <[email protected]>
mmc: dts: am654: Add 650ms power off delay for proper MMC power cycle
This commit attempts to fix a boot failure caused by incomplete VDD discharge during MMC power cycles. It adds a power-off-delay-us property to the sdhci1 node to provide time for the RC circuit to discharge.
arch/arm64/boot/dts/ti/k3-am654-base-board.dts &sdhci0 { · line 463
Quoted 8 lines
arch/arm64/boot/dts/ti/k3-am654-base-board.dts +1
-0@@ -460,6 +460,7 @@ &sdhci0 { &sdhci1 { status = "okay"; vmmc-supply = <&vdd_mmc1_sd>; + power-off-delay-us = <650000>;
[Severity: Medium]
Will this property actually be parsed by the MMC core here?
When placed directly in the MMC host controller node, the power-off-delay-us property is completely ignored. It is only parsed when placed inside an mmc-pwrseq-simple node, rendering this proposed fix ineffective.
Furthermore, even if it were parsed via a pwrseq node, the mmc_pwrseq_power_off() delay executes before the VDD regulator is disabled by mmc_set_ios(). This means the delay would occur while VDD is still actively driven, failing to provide the required time for the RC circuit to discharge.
Should this instead be implemented by adding an off-on-delay-us property directly to the vdd_mmc1_sd regulator node?
Quoted 3 lines
arch/arm64/boot/dts/ti/k3-am654-base-board.dts +0
-0pinctrl-names = "default"; pinctrl-0 = <&main_mmc1_pins_default>; ti,driver-strength-ohm = <50>;
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Nishanth Menon
maintainerQuoted 12 lines · Judith Mendez
The AM65x EVM MMC1 VDD rail discharges slowly through RC circuit. SD spec (section 6.4.1.3) requires VDD < 0.5V for minimum 1ms during power cycle. Measured discharge time on this board is ~632.97ms to reach < 0.5V threshold.
During boot, MMC power cycles between boot stages. Without power off delay, VDD doesn't fully discharge. Card retains 1.8V signaling state from previous stages. When U-Boot initializes, card no longer asserts S18A in ACMD41 response (already switched to 1.8V). Host misinterprets card state and forces 1.8V anyway, falling into a bad state and causing a boot failure.
Quoted 5 lines
Add power-off-delay-us = 650000 (650ms) to ensure proper VDD discharge during power cycles, allowing card to fully reset state between boot stages.
Signed-off-by Judith Mendez <[email protected]>
Fixes ?
Quoted 19 lines
--- arch/arm64/boot/dts/ti/k3-am654-base-board.dts | 1 + 1 file changed, 1 insertion(+)arch/arm64/boot/dts/ti/k3-am654-base-board.dts +1
-0@@ -460,6 +460,7 @@ &sdhci0 { &sdhci1 { status = "okay"; vmmc-supply = <&vdd_mmc1_sd>; + power-off-delay-us = <650000>; pinctrl-names = "default"; pinctrl-0 = <&main_mmc1_pins_default>; ti,driver-strength-ohm = <50>;Signature · 1 line
2.34.1
Signature · 4 lines
Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D https://ti.com/opensource
Hi Nishanth,
Quoted 13 lines · Nishanth Menon
Quoted 12 lines · Judith Mendez
The AM65x EVM MMC1 VDD rail discharges slowly through RC circuit. SD spec (section 6.4.1.3) requires VDD < 0.5V for minimum 1ms during power cycle. Measured discharge time on this board is ~632.97ms to reach < 0.5V threshold.
During boot, MMC power cycles between boot stages. Without power off delay, VDD doesn't fully discharge. Card retains 1.8V signaling state from previous stages. When U-Boot initializes, card no longer asserts S18A in ACMD41 response (already switched to 1.8V). Host misinterprets card state and forces 1.8V anyway, falling into a bad state and causing a boot failure.
Quoted 7 lines
Quoted 5 lines
Add power-off-delay-us = 650000 (650ms) to ensure proper VDD discharge during power cycles, allowing card to fully reset state between boot stages.
Signed-off-by Judith Mendez <[email protected]>Fixes ?
Fix is really for u-boot, don't think I can point to a u-boot commit here can I?
~ Judith
Quoted 21 lines
Quoted 20 lines
--- arch/arm64/boot/dts/ti/k3-am654-base-board.dts | 1 + 1 file changed, 1 insertion(+)arch/arm64/boot/dts/ti/k3-am654-base-board.dts +1
-0@@ -460,6 +460,7 @@ &sdhci0 { &sdhci1 { status = "okay"; vmmc-supply = <&vdd_mmc1_sd>; + power-off-delay-us = <650000>; pinctrl-names = "default"; pinctrl-0 = <&main_mmc1_pins_default>; ti,driver-strength-ohm = <50>;Signature · 1 line
2.34.1
Nishanth Menon
maintainerQuoted 20 lines · Judith Mendez
Hi Nishanth,
Quoted 17 lines · Nishanth Menon
Quoted 16 lines · Judith Mendez
The AM65x EVM MMC1 VDD rail discharges slowly through RC circuit. SD spec (section 6.4.1.3) requires VDD < 0.5V for minimum 1ms during power cycle. Measured discharge time on this board is ~632.97ms to reach < 0.5V threshold.
During boot, MMC power cycles between boot stages. Without power off delay, VDD doesn't fully discharge. Card retains 1.8V signaling state from previous stages. When U-Boot initializes, card no longer asserts S18A in ACMD41 response (already switched to 1.8V). Host misinterprets card state and forces 1.8V anyway, falling into a bad state and causing a boot failure.
Add power-off-delay-us = 650000 (650ms) to ensure proper VDD discharge during power cycles, allowing card to fully reset state between boot stages.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Judith Mendez <[email protected]>Fixes ?
Fix is really for u-boot, don't think I can point to a u-boot commit here can I?
You'd face the same problem if you are starting from a different boot media and then enable MMC in linux kernel, right? what was described in the patch sounds like a discharge latency of the evm. This was missed in the original commit?
Signature · 4 lines
Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D https://ti.com/opensource
Hi Nishanth,
Quoted 25 lines · Nishanth Menon
Quoted 24 lines · Judith Mendez
Hi Nishanth,
Quoted 20 lines · Nishanth Menon
Quoted 12 lines · Judith Mendez
The AM65x EVM MMC1 VDD rail discharges slowly through RC circuit. SD spec (section 6.4.1.3) requires VDD < 0.5V for minimum 1ms during power cycle. Measured discharge time on this board is ~632.97ms to reach < 0.5V threshold.
During boot, MMC power cycles between boot stages. Without power off delay, VDD doesn't fully discharge. Card retains 1.8V signaling state from previous stages. When U-Boot initializes, card no longer asserts S18A in ACMD41 response (already switched to 1.8V). Host misinterprets card state and forces 1.8V anyway, falling into a bad state and causing a boot failure.
Quoted 5 lines
Add power-off-delay-us = 650000 (650ms) to ensure proper VDD discharge during power cycles, allowing card to fully reset state between boot stages.
Signed-off-by Judith Mendez <[email protected]>Fixes ?
Quoted 8 lines
Quoted 2 lines
Fix is really for u-boot, don't think I can point to a u-boot commit here can I?
You'd face the same problem if you are starting from a different boot media and then enable MMC in linux kernel, right? what was described in the patch sounds like a discharge latency of the evm. This was missed in the original commit?
Not exactly. The failure is only seen at u-boot specifically with SD card boot. Very specifically due to the MMC driver in u-boot and commit [0] which is not reverted since it is technically correct. The commit just happened to expose our EVM's issue first. According to the discussion, mirror Linux patch may be coming soon, which we are now prepared for with this patch and [1].
[0] https://lore.kernel.org/u-boot/[email protected]/
[1] https://lore.kernel.org/linux-mmc/[email protected]/
~ Judith
Nishanth Menon
maintainerQuoted 44 lines · Judith Mendez
Hi Nishanth,
Quoted 25 lines · Nishanth Menon
Quoted 24 lines · Judith Mendez
Hi Nishanth,
Quoted 20 lines · Nishanth Menon
Quoted 12 lines · Judith Mendez
The AM65x EVM MMC1 VDD rail discharges slowly through RC circuit. SD spec (section 6.4.1.3) requires VDD < 0.5V for minimum 1ms during power cycle. Measured discharge time on this board is ~632.97ms to reach < 0.5V threshold.
During boot, MMC power cycles between boot stages. Without power off delay, VDD doesn't fully discharge. Card retains 1.8V signaling state from previous stages. When U-Boot initializes, card no longer asserts S18A in ACMD41 response (already switched to 1.8V). Host misinterprets card state and forces 1.8V anyway, falling into a bad state and causing a boot failure.
Quoted 5 lines
Add power-off-delay-us = 650000 (650ms) to ensure proper VDD discharge during power cycles, allowing card to fully reset state between boot stages.
Signed-off-by Judith Mendez <[email protected]>Fixes ?
Quoted 8 lines
Quoted 2 lines
Fix is really for u-boot, don't think I can point to a u-boot commit here can I?
You'd face the same problem if you are starting from a different boot media and then enable MMC in linux kernel, right? what was described in the patch sounds like a discharge latency of the evm. This was missed in the original commit?
Not exactly. The failure is only seen at u-boot specifically with SD card boot. Very specifically due to the MMC driver in u-boot and commit [0] which is not reverted since it is technically correct. The commit just happened to expose our EVM's issue first. According to the discussion, mirror Linux patch may be coming soon, which we are now prepared for with this patch and [1].
Quoted 3 lines
[0]
https://lore.kernel.org/u-boot/[email protected]/
[1] https://lore.kernel.org/linux-mmc/[email protected]/
This context is useful in diffstat. I see the driver fix in kernel which can use this property not present in previous kernels, hence no fixes.
That said, please fix $subject for v2 and repost. I suggest:
arm64: dts: ti: k3-am654-base-board: Add power off delay for proper MMC power cycle
Signature · 4 lines
Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D https://ti.com/opensource
Hi Nishanth,
Quoted 49 lines · Nishanth Menon
Quoted 44 lines · Judith Mendez
Hi Nishanth,
Quoted 25 lines · Nishanth Menon
Quoted 24 lines · Judith Mendez
Hi Nishanth,
Quoted 20 lines · Nishanth Menon
Quoted 12 lines · Judith Mendez
The AM65x EVM MMC1 VDD rail discharges slowly through RC circuit. SD spec (section 6.4.1.3) requires VDD < 0.5V for minimum 1ms during power cycle. Measured discharge time on this board is ~632.97ms to reach < 0.5V threshold.
During boot, MMC power cycles between boot stages. Without power off delay, VDD doesn't fully discharge. Card retains 1.8V signaling state from previous stages. When U-Boot initializes, card no longer asserts S18A in ACMD41 response (already switched to 1.8V). Host misinterprets card state and forces 1.8V anyway, falling into a bad state and causing a boot failure.
Quoted 5 lines
Add power-off-delay-us = 650000 (650ms) to ensure proper VDD discharge during power cycles, allowing card to fully reset state between boot stages.
Signed-off-by Judith Mendez <[email protected]>Fixes ?
Quoted 8 lines
Quoted 2 lines
Fix is really for u-boot, don't think I can point to a u-boot commit here can I?
You'd face the same problem if you are starting from a different boot media and then enable MMC in linux kernel, right? what was described in the patch sounds like a discharge latency of the evm. This was missed in the original commit?
Not exactly. The failure is only seen at u-boot specifically with SD card boot. Very specifically due to the MMC driver in u-boot and commit [0] which is not reverted since it is technically correct. The commit just happened to expose our EVM's issue first. According to the discussion, mirror Linux patch may be coming soon, which we are now prepared for with this patch and [1].
Quoted 6 lines
This context is useful in diffstat. I see the driver fix in kernel which can use this property not present in previous kernels, hence no fixes.
That said, please fix $subject for v2 and repost. I suggest:
arm64: dts: ti: k3-am654-base-board: Add power off delay for proper MMC power cycle
Ok, will fixup coverletter and subject for v2.
Thanks.
~ Judith