[V2,09/15] arm64: dts: imx8mn-evk: set off-on-delay-us in regulator

Message ID 20221024031351.4135651-10-peng.fan@oss.nxp.com
State New
Headers
Series arm64: dts: imx8m-evk: misc dts update |

Commit Message

Peng Fan (OSS) Oct. 24, 2022, 3:13 a.m. UTC
  From: Peng Fan <peng.fan@nxp.com>

Some SD Card controller and power circuitry has increased capacitance,
so the usual toggling of regulator to power the card off and on
is insufficient.

According to SD spec, for sd card power reset operation, the sd card
supply voltage needs to be lower than 0.5v and keep over 1ms, otherwise,
next time power back the sd card supply voltage to 3.3v, sd card can't
support SD3.0 mode again.

This patch add the off-on-delay-us, make sure the sd power reset behavior
is align with the specification. Without this patch, when do quick system
suspend/resume test, some sd card can't work at SD3.0 mode after system
resume back.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Marco Felsch Oct. 28, 2022, 3:02 p.m. UTC | #1
On 22-10-24, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> Some SD Card controller and power circuitry has increased capacitance,
> so the usual toggling of regulator to power the card off and on
> is insufficient.
> 
> According to SD spec, for sd card power reset operation, the sd card
> supply voltage needs to be lower than 0.5v and keep over 1ms, otherwise,
> next time power back the sd card supply voltage to 3.3v, sd card can't
> support SD3.0 mode again.
> 
> This patch add the off-on-delay-us, make sure the sd power reset behavior
> is align with the specification. Without this patch, when do quick system
> suspend/resume test, some sd card can't work at SD3.0 mode after system
> resume back.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi b/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi
> index 261c36540079..2b4395854283 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi
> @@ -36,6 +36,7 @@ reg_usdhc2_vmmc: regulator-usdhc2 {
>  		regulator-min-microvolt = <3300000>;
>  		regulator-max-microvolt = <3300000>;
>  		gpio = <&gpio2 19 GPIO_ACTIVE_HIGH>;
> +		off-on-delay-us = <12000>;

All others are using 20000us, did you changed the HW?

Regards,
  Marco

>  		enable-active-high;
>  	};
>  
> -- 
> 2.37.1
> 
> 
>
  
Peng Fan (OSS) Nov. 3, 2022, 10:25 a.m. UTC | #2
On 10/28/2022 11:02 PM, Marco Felsch wrote:
> On 22-10-24, Peng Fan (OSS) wrote:
>> From: Peng Fan <peng.fan@nxp.com>
>>
>> Some SD Card controller and power circuitry has increased capacitance,
>> so the usual toggling of regulator to power the card off and on
>> is insufficient.
>>
>> According to SD spec, for sd card power reset operation, the sd card
>> supply voltage needs to be lower than 0.5v and keep over 1ms, otherwise,
>> next time power back the sd card supply voltage to 3.3v, sd card can't
>> support SD3.0 mode again.
>>
>> This patch add the off-on-delay-us, make sure the sd power reset behavior
>> is align with the specification. Without this patch, when do quick system
>> suspend/resume test, some sd card can't work at SD3.0 mode after system
>> resume back.
>>
>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
>> ---
>>   arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi b/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi
>> index 261c36540079..2b4395854283 100644
>> --- a/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi
>> +++ b/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi
>> @@ -36,6 +36,7 @@ reg_usdhc2_vmmc: regulator-usdhc2 {
>>   		regulator-min-microvolt = <3300000>;
>>   		regulator-max-microvolt = <3300000>;
>>   		gpio = <&gpio2 19 GPIO_ACTIVE_HIGH>;
>> +		off-on-delay-us = <12000>;
> 
> All others are using 20000us, did you changed the HW?

This is i.MX8MN. This value should be safe I think,
since it goes through several NXP releases.

Thanks,
Peng.

> 
> Regards,
>    Marco
> 
>>   		enable-active-high;
>>   	};
>>   
>> -- 
>> 2.37.1
>>
>>
>>
  

Patch

diff --git a/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi b/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi
index 261c36540079..2b4395854283 100644
--- a/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi
@@ -36,6 +36,7 @@  reg_usdhc2_vmmc: regulator-usdhc2 {
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
 		gpio = <&gpio2 19 GPIO_ACTIVE_HIGH>;
+		off-on-delay-us = <12000>;
 		enable-active-high;
 	};