diff mbox series

[1/3] arm64: dts: ti: k3-am62-main: Update OTAP and ITAP delay select

Message ID 20221216143624.23708-2-sjoerd@collabora.com (mailing list archive)
State New, archived
Headers show
Series Improve K3-am625-sk support (USB, MMC) | expand

Commit Message

Sjoerd Simons Dec. 16, 2022, 2:36 p.m. UTC
From: Nitin Yadav <n-yadav@ti.com>

UHS Class U1 sd-card are not getting detected due to incorrect
OTAP/ITAP delay select values in linux. Update OTAP and ITAP
delay select values for various speed modes. For sdhci0, update
OTAP delay values for ddr52 & HS200 and add ITAP delay for legacy
& mmc-hs. For sdhci1 & sdhci2, update OTAP & ITAP delay select
recommended as in RIOT for various speed modes.

Signed-off-by: Nitin Yadav <n-yadav@ti.com>
[cherry-pick from vendor BSP]
Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
---

 arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 46 ++++++++++++------------
 1 file changed, 24 insertions(+), 22 deletions(-)

Comments

Vignesh Raghavendra Dec. 20, 2022, 11:19 a.m. UTC | #1
On 16/12/22 8:06 pm, Sjoerd Simons wrote:
> From: Nitin Yadav <n-yadav@ti.com>
> 
> UHS Class U1 sd-card are not getting detected due to incorrect
> OTAP/ITAP delay select values in linux. Update OTAP and ITAP
> delay select values for various speed modes. For sdhci0, update
> OTAP delay values for ddr52 & HS200 and add ITAP delay for legacy
> & mmc-hs. For sdhci1 & sdhci2, update OTAP & ITAP delay select
> recommended as in RIOT for various speed modes.
> 
> Signed-off-by: Nitin Yadav <n-yadav@ti.com>
> [cherry-pick from vendor BSP]
> Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
> ---
> 
>  arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 46 ++++++++++++------------
>  1 file changed, 24 insertions(+), 22 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
> index 03660476364f..28c250a8d1ec 100644
> --- a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
> +++ b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
> @@ -391,8 +391,10 @@ sdhci0: mmc@fa10000 {
>  		ti,clkbuf-sel = <0x7>;
>  		ti,otap-del-sel-legacy = <0x0>;
>  		ti,otap-del-sel-mmc-hs = <0x0>;
> -		ti,otap-del-sel-ddr52 = <0x9>;
> -		ti,otap-del-sel-hs200 = <0x6>;
> +		ti,otap-del-sel-ddr52 = <0x5>;
> +		ti,otap-del-sel-hs200 = <0x5>;
> +		ti,itap-del-sel-legacy = <0xa>;

This is pretty useless without corresponding driver changes 
to pick up ti,itap-del-sel-legacy as well

https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/commit/drivers/mmc/host/sdhci_am654.c?h=ti-linux-5.10.y&id=93d22fc56007ee13e589debf0d32c8b1d5fdc6d8
https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/commit/drivers/mmc/host/sdhci_am654.c?h=ti-linux-5.10.y&id=9c878c3dc642f7f1f3ab6ca7f812cd43fe7ed7d8

Could you list that cards affected and fixed by this change?

Regards
Vignesh

[...]
Sjoerd Simons Dec. 20, 2022, 1:07 p.m. UTC | #2
Hey Vignesh

On Tue, 2022-12-20 at 16:49 +0530, Vignesh Raghavendra wrote:
> 
> 
> On 16/12/22 8:06 pm, Sjoerd Simons wrote:
> > From: Nitin Yadav <n-yadav@ti.com>
> > 
> > UHS Class U1 sd-card are not getting detected due to incorrect
> > OTAP/ITAP delay select values in linux. Update OTAP and ITAP
> > delay select values for various speed modes. For sdhci0, update
> > OTAP delay values for ddr52 & HS200 and add ITAP delay for legacy
> > & mmc-hs. For sdhci1 & sdhci2, update OTAP & ITAP delay select
> > recommended as in RIOT for various speed modes.
> > 
> > Signed-off-by: Nitin Yadav <n-yadav@ti.com>
> > [cherry-pick from vendor BSP]
> > Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
> > ---
> > 
> >  arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 46 ++++++++++++--------
> > ----
> >  1 file changed, 24 insertions(+), 22 deletions(-)
> > 
> > diff --git a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
> > b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
> > index 03660476364f..28c250a8d1ec 100644
> > --- a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
> > +++ b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
> > @@ -391,8 +391,10 @@ sdhci0: mmc@fa10000 {
> >                 ti,clkbuf-sel = <0x7>;
> >                 ti,otap-del-sel-legacy = <0x0>;
> >                 ti,otap-del-sel-mmc-hs = <0x0>;
> > -               ti,otap-del-sel-ddr52 = <0x9>;
> > -               ti,otap-del-sel-hs200 = <0x6>;
> > +               ti,otap-del-sel-ddr52 = <0x5>;
> > +               ti,otap-del-sel-hs200 = <0x5>;
> > +               ti,itap-del-sel-legacy = <0xa>;
> 
> This is pretty useless without corresponding driver changes 
> to pick up ti,itap-del-sel-legacy as well

Right; itap-del-sel-legacy is properly documented in the device-tree
binding and was already previously set ofcourse so i didn't pick up it
needed more driver changes. That said the dtb change itself should
still be valid even if not actually applied.

> https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/commit/drivers/mmc/host/sdhci_am654.c?h=ti-linux-5.10.y&id=93d22fc56007ee13e589debf0d32c8b1d5fdc6d8
> https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/commit/drivers/mmc/host/sdhci_am654.c?h=ti-linux-5.10.y&id=9c878c3dc642f7f1f3ab6ca7f812cd43fe7ed7d8
> 
> Could you list that cards affected and fixed by this change?

It's a Collabora branded UHS class 1 (SDR104) card; Matching the commit
message indication given by Nitin. So that in particular i guess, will
have been fixed by the change to the ti,otap-del-sel-sdr104 value for
sdhci1.

For the two patches you highlighted above; Is TI planning to upstream
those as well?
Vignesh Raghavendra Dec. 21, 2022, 2:50 p.m. UTC | #3
On 12/20/2022 6:37 PM, Sjoerd Simons wrote:
> Hey Vignesh
> 
> On Tue, 2022-12-20 at 16:49 +0530, Vignesh Raghavendra wrote:
>>
>>
>> On 16/12/22 8:06 pm, Sjoerd Simons wrote:
>>> From: Nitin Yadav <n-yadav@ti.com>
>>>
>>> UHS Class U1 sd-card are not getting detected due to incorrect
>>> OTAP/ITAP delay select values in linux. Update OTAP and ITAP
>>> delay select values for various speed modes. For sdhci0, update
>>> OTAP delay values for ddr52 & HS200 and add ITAP delay for legacy
>>> & mmc-hs. For sdhci1 & sdhci2, update OTAP & ITAP delay select
>>> recommended as in RIOT for various speed modes.
>>>
>>> Signed-off-by: Nitin Yadav <n-yadav@ti.com>
>>> [cherry-pick from vendor BSP]
>>> Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
>>> ---
>>>
>>>  arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 46 ++++++++++++--------
>>> ----
>>>  1 file changed, 24 insertions(+), 22 deletions(-)
>>>
>>> diff --git a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
>>> b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
>>> index 03660476364f..28c250a8d1ec 100644
>>> --- a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
>>> +++ b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
>>> @@ -391,8 +391,10 @@ sdhci0: mmc@fa10000 {
>>>                 ti,clkbuf-sel = <0x7>;
>>>                 ti,otap-del-sel-legacy = <0x0>;
>>>                 ti,otap-del-sel-mmc-hs = <0x0>;
>>> -               ti,otap-del-sel-ddr52 = <0x9>;
>>> -               ti,otap-del-sel-hs200 = <0x6>;
>>> +               ti,otap-del-sel-ddr52 = <0x5>;
>>> +               ti,otap-del-sel-hs200 = <0x5>;
>>> +               ti,itap-del-sel-legacy = <0xa>;
>>
>> This is pretty useless without corresponding driver changes 
>> to pick up ti,itap-del-sel-legacy as well
> 
> Right; itap-del-sel-legacy is properly documented in the device-tree
> binding and was already previously set ofcourse so i didn't pick up it
> needed more driver changes. That said the dtb change itself should
> still be valid even if not actually applied.
> 
>> https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/commit/drivers/mmc/host/sdhci_am654.c?h=ti-linux-5.10.y&id=93d22fc56007ee13e589debf0d32c8b1d5fdc6d8
>> https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/commit/drivers/mmc/host/sdhci_am654.c?h=ti-linux-5.10.y&id=9c878c3dc642f7f1f3ab6ca7f812cd43fe7ed7d8
>>
>> Could you list that cards affected and fixed by this change?
> 
> It's a Collabora branded UHS class 1 (SDR104) card; Matching the commit
> message indication given by Nitin. So that in particular i guess, will
> have been fixed by the change to the ti,otap-del-sel-sdr104 value for
> sdhci1.
> 
> For the two patches you highlighted above; Is TI planning to upstream
> those as well? 
>

Yes, the plan is to post those patches to mmc list post 6.2-rc1

Regards
Vignesh
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
index 03660476364f..28c250a8d1ec 100644
--- a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
@@ -391,8 +391,10 @@  sdhci0: mmc@fa10000 {
 		ti,clkbuf-sel = <0x7>;
 		ti,otap-del-sel-legacy = <0x0>;
 		ti,otap-del-sel-mmc-hs = <0x0>;
-		ti,otap-del-sel-ddr52 = <0x9>;
-		ti,otap-del-sel-hs200 = <0x6>;
+		ti,otap-del-sel-ddr52 = <0x5>;
+		ti,otap-del-sel-hs200 = <0x5>;
+		ti,itap-del-sel-legacy = <0xa>;
+		ti,itap-del-sel-mmc-hs = <0x1>;
 	};
 
 	sdhci1: mmc@fa00000 {
@@ -403,17 +405,17 @@  sdhci1: mmc@fa00000 {
 		clocks = <&k3_clks 58 5>, <&k3_clks 58 6>;
 		clock-names = "clk_ahb", "clk_xin";
 		ti,trm-icp = <0x2>;
-		ti,otap-del-sel-legacy = <0x0>;
+		ti,otap-del-sel-legacy = <0x8>;
 		ti,otap-del-sel-sd-hs = <0x0>;
-		ti,otap-del-sel-sdr12 = <0xf>;
-		ti,otap-del-sel-sdr25 = <0xf>;
-		ti,otap-del-sel-sdr50 = <0xc>;
-		ti,otap-del-sel-sdr104 = <0x6>;
-		ti,otap-del-sel-ddr50 = <0x9>;
-		ti,itap-del-sel-legacy = <0x0>;
-		ti,itap-del-sel-sd-hs = <0x0>;
-		ti,itap-del-sel-sdr12 = <0x0>;
-		ti,itap-del-sel-sdr25 = <0x0>;
+		ti,otap-del-sel-sdr12 = <0x0>;
+		ti,otap-del-sel-sdr25 = <0x0>;
+		ti,otap-del-sel-sdr50 = <0x8>;
+		ti,otap-del-sel-sdr104 = <0x7>;
+		ti,otap-del-sel-ddr50 = <0x4>;
+		ti,itap-del-sel-legacy = <0xa>;
+		ti,itap-del-sel-sd-hs = <0x1>;
+		ti,itap-del-sel-sdr12 = <0xa>;
+		ti,itap-del-sel-sdr25 = <0x1>;
 		ti,clkbuf-sel = <0x7>;
 		bus-width = <4>;
 	};
@@ -426,17 +428,17 @@  sdhci2: mmc@fa20000 {
 		clocks = <&k3_clks 184 5>, <&k3_clks 184 6>;
 		clock-names = "clk_ahb", "clk_xin";
 		ti,trm-icp = <0x2>;
-		ti,otap-del-sel-legacy = <0x0>;
+		ti,otap-del-sel-legacy = <0x8>;
 		ti,otap-del-sel-sd-hs = <0x0>;
-		ti,otap-del-sel-sdr12 = <0xf>;
-		ti,otap-del-sel-sdr25 = <0xf>;
-		ti,otap-del-sel-sdr50 = <0xc>;
-		ti,otap-del-sel-sdr104 = <0x6>;
-		ti,otap-del-sel-ddr50 = <0x9>;
-		ti,itap-del-sel-legacy = <0x0>;
-		ti,itap-del-sel-sd-hs = <0x0>;
-		ti,itap-del-sel-sdr12 = <0x0>;
-		ti,itap-del-sel-sdr25 = <0x0>;
+		ti,otap-del-sel-sdr12 = <0x0>;
+		ti,otap-del-sel-sdr25 = <0x0>;
+		ti,otap-del-sel-sdr50 = <0x8>;
+		ti,otap-del-sel-sdr104 = <0x7>;
+		ti,otap-del-sel-ddr50 = <0x8>;
+		ti,itap-del-sel-legacy = <0xa>;
+		ti,itap-del-sel-sd-hs = <0xa>;
+		ti,itap-del-sel-sdr12 = <0xa>;
+		ti,itap-del-sel-sdr25 = <0x1>;
 		ti,clkbuf-sel = <0x7>;
 	};