linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] arm64: dts: ti: verdin-am62: use SD1 CD as GPIO
@ 2024-03-12 14:49 Francesco Dolcini
  2024-03-14 12:18 ` Nishanth Menon
  2024-03-19 12:07 ` Nishanth Menon
  0 siblings, 2 replies; 5+ messages in thread
From: Francesco Dolcini @ 2024-03-12 14:49 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra, Tero Kristo, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: Francesco Dolcini, linux-arm-kernel, devicetree, linux-kernel,
	João Paulo Silva Gonçalves

From: Francesco Dolcini <francesco.dolcini@toradex.com>

TI SDHCI IP has a hardware debounce timer of 1 second as described in
commit 7ca0f166f5b2 ("mmc: sdhci_am654: Add workaround for card detect
debounce timer"), because of this the boot time increases of up to 1
second.

Workaround the issue the same way that is done on
arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts, using the SD1 CD as
GPIO.

Suggested-by: Nishanth Menon <nm@ti.com>
Reported-by: João Paulo Silva Gonçalves <joao.goncalves@toradex.com>
Closes: https://lore.kernel.org/all/0e81af80de3d55e72f79af83fa5db87f5c9938f8.camel@toradex.com/
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
 arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi b/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi
index e8d8857ad51f..a9bf2c17f95a 100644
--- a/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi
@@ -457,6 +457,13 @@ AM62X_IOPAD(0x01c4, PIN_INPUT, 7) /* (B14) SPI0_D1.GPIO1_19 */ /* SODIMM 161 */
 		>;
 	};
 
+	/* Verdin SD_1_CD# as GPIO */
+	pinctrl_sd1_cd_gpio: main-gpio1-48-default-pins {
+		pinctrl-single,pins = <
+			AM62X_IOPAD(0x240, PIN_INPUT_PULLUP, 7) /* (D17) MMC1_SDCD.GPIO1_48 */ /* SODIMM 84 */
+		>;
+	};
+
 	/* Verdin DSI_1_INT# (pulled-up as active-low) */
 	pinctrl_dsi1_int: main-gpio1-49-default-pins {
 		pinctrl-single,pins = <
@@ -571,7 +578,6 @@ AM62X_IOPAD(0x230, PIN_INPUT,        0) /* (A22) MMC1_DAT0 */ /* SODIMM 80 */
 			AM62X_IOPAD(0x22c, PIN_INPUT,        0) /* (B21) MMC1_DAT1 */ /* SODIMM 82 */
 			AM62X_IOPAD(0x228, PIN_INPUT,        0) /* (C21) MMC1_DAT2 */ /* SODIMM 70 */
 			AM62X_IOPAD(0x224, PIN_INPUT,        0) /* (D22) MMC1_DAT3 */ /* SODIMM 72 */
-			AM62X_IOPAD(0x240, PIN_INPUT_PULLUP, 0) /* (D17) MMC1_SDCD */ /* SODIMM 84 */
 		>;
 	};
 
@@ -1441,8 +1447,10 @@ &sdhci0 {
 /* Verdin SD_1 */
 &sdhci1 {
 	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_sdhci1>;
+	pinctrl-0 = <&pinctrl_sdhci1>, <&pinctrl_sd1_cd_gpio>;
+	cd-gpios = <&main_gpio1 48 GPIO_ACTIVE_LOW>;
 	disable-wp;
+	ti,fails-without-test-cd;
 	vmmc-supply = <&reg_sdhc1_vmmc>;
 	vqmmc-supply = <&reg_sdhc1_vqmmc>;
 	status = "disabled";
-- 
2.39.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] arm64: dts: ti: verdin-am62: use SD1 CD as GPIO
  2024-03-12 14:49 [PATCH v1] arm64: dts: ti: verdin-am62: use SD1 CD as GPIO Francesco Dolcini
@ 2024-03-14 12:18 ` Nishanth Menon
  2024-03-14 13:02   ` Francesco Dolcini
  2024-03-19 12:07 ` Nishanth Menon
  1 sibling, 1 reply; 5+ messages in thread
From: Nishanth Menon @ 2024-03-14 12:18 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: Vignesh Raghavendra, Tero Kristo, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Francesco Dolcini,
	linux-arm-kernel, devicetree, linux-kernel,
	João Paulo Silva Gonçalves

On 15:49-20240312, Francesco Dolcini wrote:
> From: Francesco Dolcini <francesco.dolcini@toradex.com>
> 
> TI SDHCI IP has a hardware debounce timer of 1 second as described in

Umm... Minor clarification - the SDHCI IP is not TI's - as commit
41fd4caeb00bbd6dc55f056f3e8e956697b0760d says, this was an Arasan IP
which was integrated into TI SoCs but needs it's own driver due to some
quirkiness in the version TI picked up.

Are you OK to rephrase this as TI SDHCI 'instance' rather than 'IP'? If
yes, I can do the change locally when I commit.

> commit 7ca0f166f5b2 ("mmc: sdhci_am654: Add workaround for card detect
> debounce timer"), because of this the boot time increases of up to 1
> second.
> 
> Workaround the issue the same way that is done on
> arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts, using the SD1 CD as
> GPIO.


Side benefit of this will that if you boot out of emmc and when runtime
PM disables the mmc instance, you still can detect card detect via GPIO
block, which I think is a better source of wakeup than keeping mmc
instance powered and clocked waiting for an sdcard insertion event. No
action needed, just making a side note.

> 
> Suggested-by: Nishanth Menon <nm@ti.com>
> Reported-by: João Paulo Silva Gonçalves <joao.goncalves@toradex.com>
> Closes: https://lore.kernel.org/all/0e81af80de3d55e72f79af83fa5db87f5c9938f8.camel@toradex.com/
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> ---
>  arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi b/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi
> index e8d8857ad51f..a9bf2c17f95a 100644
> --- a/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi
> +++ b/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi
> @@ -457,6 +457,13 @@ AM62X_IOPAD(0x01c4, PIN_INPUT, 7) /* (B14) SPI0_D1.GPIO1_19 */ /* SODIMM 161 */
>  		>;
>  	};
>  
> +	/* Verdin SD_1_CD# as GPIO */
> +	pinctrl_sd1_cd_gpio: main-gpio1-48-default-pins {
> +		pinctrl-single,pins = <
> +			AM62X_IOPAD(0x240, PIN_INPUT_PULLUP, 7) /* (D17) MMC1_SDCD.GPIO1_48 */ /* SODIMM 84 */
> +		>;
> +	};
> +
>  	/* Verdin DSI_1_INT# (pulled-up as active-low) */
>  	pinctrl_dsi1_int: main-gpio1-49-default-pins {
>  		pinctrl-single,pins = <
> @@ -571,7 +578,6 @@ AM62X_IOPAD(0x230, PIN_INPUT,        0) /* (A22) MMC1_DAT0 */ /* SODIMM 80 */
>  			AM62X_IOPAD(0x22c, PIN_INPUT,        0) /* (B21) MMC1_DAT1 */ /* SODIMM 82 */
>  			AM62X_IOPAD(0x228, PIN_INPUT,        0) /* (C21) MMC1_DAT2 */ /* SODIMM 70 */
>  			AM62X_IOPAD(0x224, PIN_INPUT,        0) /* (D22) MMC1_DAT3 */ /* SODIMM 72 */
> -			AM62X_IOPAD(0x240, PIN_INPUT_PULLUP, 0) /* (D17) MMC1_SDCD */ /* SODIMM 84 */
>  		>;
>  	};
>  
> @@ -1441,8 +1447,10 @@ &sdhci0 {
>  /* Verdin SD_1 */
>  &sdhci1 {
>  	pinctrl-names = "default";
> -	pinctrl-0 = <&pinctrl_sdhci1>;
> +	pinctrl-0 = <&pinctrl_sdhci1>, <&pinctrl_sd1_cd_gpio>;
> +	cd-gpios = <&main_gpio1 48 GPIO_ACTIVE_LOW>;
>  	disable-wp;
> +	ti,fails-without-test-cd;
>  	vmmc-supply = <&reg_sdhc1_vmmc>;
>  	vqmmc-supply = <&reg_sdhc1_vqmmc>;
>  	status = "disabled";
> -- 
> 2.39.2
> 

-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] arm64: dts: ti: verdin-am62: use SD1 CD as GPIO
  2024-03-14 12:18 ` Nishanth Menon
@ 2024-03-14 13:02   ` Francesco Dolcini
  0 siblings, 0 replies; 5+ messages in thread
From: Francesco Dolcini @ 2024-03-14 13:02 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: Francesco Dolcini, Vignesh Raghavendra, Tero Kristo, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Francesco Dolcini,
	linux-arm-kernel, devicetree, linux-kernel,
	João Paulo Silva Gonçalves

Hello Nishanth,

On Thu, Mar 14, 2024 at 07:18:33AM -0500, Nishanth Menon wrote:
> On 15:49-20240312, Francesco Dolcini wrote:
> > From: Francesco Dolcini <francesco.dolcini@toradex.com>
> > 
> > TI SDHCI IP has a hardware debounce timer of 1 second as described in
> 
> Umm... Minor clarification - the SDHCI IP is not TI's - as commit
> 41fd4caeb00bbd6dc55f056f3e8e956697b0760d says, this was an Arasan IP
> which was integrated into TI SoCs but needs it's own driver due to some
> quirkiness in the version TI picked up.
> 
> Are you OK to rephrase this as TI SDHCI 'instance' rather than 'IP'? If
> yes, I can do the change locally when I commit.

Fine for me, thanks,
Francesco


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] arm64: dts: ti: verdin-am62: use SD1 CD as GPIO
  2024-03-12 14:49 [PATCH v1] arm64: dts: ti: verdin-am62: use SD1 CD as GPIO Francesco Dolcini
  2024-03-14 12:18 ` Nishanth Menon
@ 2024-03-19 12:07 ` Nishanth Menon
  2024-03-19 12:40   ` Francesco Dolcini
  1 sibling, 1 reply; 5+ messages in thread
From: Nishanth Menon @ 2024-03-19 12:07 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: Vignesh Raghavendra, Tero Kristo, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Francesco Dolcini,
	linux-arm-kernel, devicetree, linux-kernel,
	João Paulo Silva Gonçalves

On 15:49-20240312, Francesco Dolcini wrote:
> From: Francesco Dolcini <francesco.dolcini@toradex.com>
> 
> TI SDHCI IP has a hardware debounce timer of 1 second as described in
> commit 7ca0f166f5b2 ("mmc: sdhci_am654: Add workaround for card detect
> debounce timer"), because of this the boot time increases of up to 1
> second.
> 
> Workaround the issue the same way that is done on
> arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts, using the SD1 CD as
> GPIO.
> 
> Suggested-by: Nishanth Menon <nm@ti.com>
> Reported-by: João Paulo Silva Gonçalves <joao.goncalves@toradex.com>
> Closes: https://lore.kernel.org/all/0e81af80de3d55e72f79af83fa5db87f5c9938f8.camel@toradex.com/
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> ---
>  arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi b/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi
> index e8d8857ad51f..a9bf2c17f95a 100644
> --- a/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi
> +++ b/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi
> @@ -457,6 +457,13 @@ AM62X_IOPAD(0x01c4, PIN_INPUT, 7) /* (B14) SPI0_D1.GPIO1_19 */ /* SODIMM 161 */
>  		>;
>  	};
>  
> +	/* Verdin SD_1_CD# as GPIO */
> +	pinctrl_sd1_cd_gpio: main-gpio1-48-default-pins {
> +		pinctrl-single,pins = <
> +			AM62X_IOPAD(0x240, PIN_INPUT_PULLUP, 7) /* (D17) MMC1_SDCD.GPIO1_48 */ /* SODIMM 84 */
> +		>;
> +	};
> +
>  	/* Verdin DSI_1_INT# (pulled-up as active-low) */
>  	pinctrl_dsi1_int: main-gpio1-49-default-pins {
>  		pinctrl-single,pins = <
> @@ -571,7 +578,6 @@ AM62X_IOPAD(0x230, PIN_INPUT,        0) /* (A22) MMC1_DAT0 */ /* SODIMM 80 */
>  			AM62X_IOPAD(0x22c, PIN_INPUT,        0) /* (B21) MMC1_DAT1 */ /* SODIMM 82 */
>  			AM62X_IOPAD(0x228, PIN_INPUT,        0) /* (C21) MMC1_DAT2 */ /* SODIMM 70 */
>  			AM62X_IOPAD(0x224, PIN_INPUT,        0) /* (D22) MMC1_DAT3 */ /* SODIMM 72 */
> -			AM62X_IOPAD(0x240, PIN_INPUT_PULLUP, 0) /* (D17) MMC1_SDCD */ /* SODIMM 84 */
>  		>;
>  	};
>  
> @@ -1441,8 +1447,10 @@ &sdhci0 {
>  /* Verdin SD_1 */
>  &sdhci1 {
>  	pinctrl-names = "default";
> -	pinctrl-0 = <&pinctrl_sdhci1>;
> +	pinctrl-0 = <&pinctrl_sdhci1>, <&pinctrl_sd1_cd_gpio>;
> +	cd-gpios = <&main_gpio1 48 GPIO_ACTIVE_LOW>;
>  	disable-wp;
> +	ti,fails-without-test-cd;
>  	vmmc-supply = <&reg_sdhc1_vmmc>;
>  	vqmmc-supply = <&reg_sdhc1_vqmmc>;
>  	status = "disabled";

Minor style comment based on recently added https://docs.kernel.org/devicetree/bindings/dts-coding-style.html#order-of-properties-in-device-node

ti,fails-without-test-cd comes after vqmmc-supply and above status.

-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] arm64: dts: ti: verdin-am62: use SD1 CD as GPIO
  2024-03-19 12:07 ` Nishanth Menon
@ 2024-03-19 12:40   ` Francesco Dolcini
  0 siblings, 0 replies; 5+ messages in thread
From: Francesco Dolcini @ 2024-03-19 12:40 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: Francesco Dolcini, Vignesh Raghavendra, Tero Kristo, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Francesco Dolcini,
	linux-arm-kernel, devicetree, linux-kernel,
	João Paulo Silva Gonçalves

Hello Nishanth,

On Tue, Mar 19, 2024 at 07:07:17AM -0500, Nishanth Menon wrote:
> On 15:49-20240312, Francesco Dolcini wrote:
> > From: Francesco Dolcini <francesco.dolcini@toradex.com>
> > 
> > TI SDHCI IP has a hardware debounce timer of 1 second as described in
> > commit 7ca0f166f5b2 ("mmc: sdhci_am654: Add workaround for card detect
> > debounce timer"), because of this the boot time increases of up to 1
> > second.
> > 
> > Workaround the issue the same way that is done on
> > arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts, using the SD1 CD as
> > GPIO.
> > 
> > Suggested-by: Nishanth Menon <nm@ti.com>
> > Reported-by: João Paulo Silva Gonçalves <joao.goncalves@toradex.com>
> > Closes: https://lore.kernel.org/all/0e81af80de3d55e72f79af83fa5db87f5c9938f8.camel@toradex.com/
> > Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> > ---
> >  arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi | 12 ++++++++++--
> >  1 file changed, 10 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi b/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi
> > index e8d8857ad51f..a9bf2c17f95a 100644
> > --- a/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi
> > +++ b/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi
> > @@ -1441,8 +1447,10 @@ &sdhci0 {
> >  /* Verdin SD_1 */
> >  &sdhci1 {
> >  	pinctrl-names = "default";
> > -	pinctrl-0 = <&pinctrl_sdhci1>;
> > +	pinctrl-0 = <&pinctrl_sdhci1>, <&pinctrl_sd1_cd_gpio>;
> > +	cd-gpios = <&main_gpio1 48 GPIO_ACTIVE_LOW>;
> >  	disable-wp;
> > +	ti,fails-without-test-cd;
> >  	vmmc-supply = <&reg_sdhc1_vmmc>;
> >  	vqmmc-supply = <&reg_sdhc1_vqmmc>;
> >  	status = "disabled";
> 
> Minor style comment based on recently added https://docs.kernel.org/devicetree/bindings/dts-coding-style.html#order-of-properties-in-device-node
> 
> ti,fails-without-test-cd comes after vqmmc-supply and above status.

Whoops, you are right, of course, thanks. I'll send a v2 once the merge
window closes and rc1 is out.

Francesco


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-19 12:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-12 14:49 [PATCH v1] arm64: dts: ti: verdin-am62: use SD1 CD as GPIO Francesco Dolcini
2024-03-14 12:18 ` Nishanth Menon
2024-03-14 13:02   ` Francesco Dolcini
2024-03-19 12:07 ` Nishanth Menon
2024-03-19 12:40   ` Francesco Dolcini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).