Skip to contentSkip to conversation

Add SDHCI support for APM X-Gene SoC using ARASAN SDHCI controller.

PATCH Superseded Suman Tripathi 6 participants 13 messages May 5, 2015 – May 6, 2015 1 message not in the archive

Subsystems (3)

v5 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

v5 cover Add SDHCI support for APM X-Gene SoC using ARASAN SDHCI controller.

This patch adds the SDHCI support for APM X-Gene SoC using ARASAN SDHCI controller.

v1 change:
* Use the CONFIG_ARM64_DMA_HAS_IOMMU for dma-mapping.

v2 change:
* Drop the IOMMU support and switching to PIO mode for arasan. controller integrated inside APM X-Gene SoC.

v3 change:
* Change the sdhci-of-arasan.c to support arasan4.9a.
* Add quirks for arasan4.9a.

v4 change:
* Cleanup the Documentation and dts.

v5 change:
* Rebase the dts files.
* Drop patch 2 and 3 as it is applied

---

Suman Tripathi (1):
arm64: dts: Add the arasan sdhc nodes in apm-storm.dtsi.

 arch/arm64/boot/dts/apm/apm-mustang.dts |  4 +++
 arch/arm64/boot/dts/apm/apm-storm.dtsi  | 44 +++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+)

--
1.8.2.1

A message that is not in the archive (sent off-list or not yet received): 1430817426-5241-1-git-send-email-stripathi-qTEPVZfXA3Y@public.gmane.org

#2 lore raw

PATCH v5 1/1 arm64: dts: Add the arasan sdhc nodes in apm-storm.dtsi.

This patch adds the arasan sdhc nodes to reuse the of-arasan driver for APM X-Gene SoC.

---
 arch/arm64/boot/dts/apm/apm-mustang.dts |  4 +++
 arch/arm64/boot/dts/apm/apm-storm.dtsi  | 44 +++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+)
arch/arm64/boot/dts/apm/apm-mustang.dts +4 -0
index 83578e7..4cc5d07 100644
@@ -52,3 +52,7 @@
 &xgenet {
 	status = "ok";
 };
+
+&sdhc0 {
+	status = "ok";
+};
arch/arm64/boot/dts/apm/apm-storm.dtsi +44 -0

56 lines not on this page · raw message

--
1.8.2.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

PATCH v5 1/1 arm64: dts: Add the arasan sdhc nodes in apm-storm.dtsi.

Quoted 4 lines · Suman Tripathi

This patch adds the arasan sdhc nodes to reuse the of-arasan driver for APM X-Gene SoC.

I consider this one acked by Arnd, due to:
http://www.spinics.net/lists/arm-kernel/msg415634.html

Thus applied to my mmc tree.

Thanks!

Kind regards
Uffe

Quoted 86 lines
---
 arch/arm64/boot/dts/apm/apm-mustang.dts |  4 +++
 arch/arm64/boot/dts/apm/apm-storm.dtsi  | 44 +++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+)
arch/arm64/boot/dts/apm/apm-mustang.dts +4 -0
index 83578e7..4cc5d07 100644
@@ -52,3 +52,7 @@
 &xgenet {
        status = "ok";
 };
+
+&sdhc0 {
+       status = "ok";
+};
arch/arm64/boot/dts/apm/apm-storm.dtsi +44 -1
index c8d3e0e..240c793 100644
@@ -145,6 +145,40 @@
                                clock-output-names = "socplldiv2";
                        };
 
+                       ahbclk: ahbclk at 1f2ac000 {
+                               compatible = "apm,xgene-device-clock";
+                               #clock-cells = <1>;
+                               clocks = <&socplldiv2 0>;
+                               reg = <0x0 0x1f2ac000 0x0 0x1000
+                                       0x0 0x17000000 0x0 0x2000>;
+                               reg-names = "csr-reg", "div-reg";
+                               csr-offset = <0x0>;
+                               csr-mask = <0x1>;
+                               enable-offset = <0x8>;
+                               enable-mask = <0x1>;
+                               divider-offset = <0x164>;
+                               divider-width = <0x5>;
+                               divider-shift = <0x0>;
+                               clock-output-names = "ahbclk";
+                       };
+
+                       sdioclk: sdioclk at 1f2ac000 {
+                               compatible = "apm,xgene-device-clock";
+                               #clock-cells = <1>;
+                               clocks = <&socplldiv2 0>;
+                               reg = <0x0 0x1f2ac000 0x0 0x1000
+                                       0x0 0x17000000 0x0 0x2000>;
+                               reg-names = "csr-reg", "div-reg";
+                               csr-offset = <0x0>;
+                               csr-mask = <0x2>;
+                               enable-offset = <0x8>;
+                               enable-mask = <0x2>;
+                               divider-offset = <0x178>;
+                               divider-width = <0x8>;
+                               divider-shift = <0x0>;
+                               clock-output-names = "sdioclk";
+                       };
+
                        qmlclk: qmlclk {
                                compatible = "apm,xgene-device-clock";
                                #clock-cells = <1>;
@@ -533,6 +567,16 @@
                        interrupts = <0x0 0x4f 0x4>;
                };
 
+               sdhc0: sdhc at 1c000000 {
+                       device_type = "sdhc";
+                       compatible = "arasan,sdhci-4.9a";
+                       reg = <0x0 0x1c000000 0x0 0x100>;
+                       interrupts = <0x0 0x49 0x4>;
+                       dma-coherent;
+                       clock-names = "clk_xin", "clk_ahb";
+                       clocks = <&sdioclk 0>, <&ahbclk 0>;
+               };
+
                phy1: phy at 1f21a000 {
                        compatible = "apm,xgene-phy";
                        reg = <0x0 0x1f21a000 0x0 0x100>;
--

1.8.2.1

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw

PATCH v5 1/1 arm64: dts: Add the arasan sdhc nodes in apm-storm.dtsi.

Quoted 10 lines · Ulf Hansson
Quoted 4 lines · Suman Tripathi

This patch adds the arasan sdhc nodes to reuse the of-arasan driver for APM X-Gene SoC.

I consider this one acked by Arnd, due to:
http://www.spinics.net/lists/arm-kernel/msg415634.html

Thus applied to my mmc tree.

According to follow up comments, I have dropped this patch from my tree for now.

Kind regards
Uffe

#5 lore raw

PATCH v5 1/1 arm64: dts: Add the arasan sdhc nodes in apm-storm.dtsi.

In reply to Suman Tripathi
Quoted 8 lines · Suman Tripathi

This patch adds the arasan sdhc nodes to reuse the of-arasan driver for APM X-Gene SoC.

---
 arch/arm64/boot/dts/apm/apm-mustang.dts |  4 +++
 arch/arm64/boot/dts/apm/apm-storm.dtsi  | 44 +++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+)

[...]

arch/arm64/boot/dts/apm/apm-storm.dtsi line 571

Quoted 6 lines
arch/arm64/boot/dts/apm/apm-storm.dtsi +2 -0
@@ -533,6 +567,16 @@
                        interrupts = <0x0 0x4f 0x4>;
                };
 
+               sdhc0: sdhc at 1c000000 {
+                       device_type = "sdhc";

device_type generally should not be used (there are a few exceptions).

arch/arm64/boot/dts/apm/apm-storm.dtsi line 572

Quoted 1 line
arch/arm64/boot/dts/apm/apm-storm.dtsi +1 -0
+                       compatible = "arasan,sdhci-4.9a";

If you ever have an integration or xgene specific problem, you need a chip specific compatible.

Rob

#6 lore raw

PATCH v5 1/1 arm64: dts: Add the arasan sdhc nodes in apm-storm.dtsi.

Quoted 12 lines · Rob Herring
Quoted 8 lines · Suman Tripathi

This patch adds the arasan sdhc nodes to reuse the of-arasan driver for APM X-Gene SoC.

---
 arch/arm64/boot/dts/apm/apm-mustang.dts |  4 +++
 arch/arm64/boot/dts/apm/apm-storm.dtsi  | 44 +++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+)

[...]

Quoted 8 lines

arch/arm64/boot/dts/apm/apm-storm.dtsi line 571

Quoted 6 lines
arch/arm64/boot/dts/apm/apm-storm.dtsi +2 -0
@@ -533,6 +567,16 @@
                        interrupts = <0x0 0x4f 0x4>;
                };
 
+               sdhc0: sdhc at 1c000000 {
+                       device_type = "sdhc";

device_type generally should not be used (there are a few exceptions).

Okay !!

Quoted 5 lines

arch/arm64/boot/dts/apm/apm-storm.dtsi line 572

Quoted 2 lines
arch/arm64/boot/dts/apm/apm-storm.dtsi +1 -0
+                       compatible = "arasan,sdhci-4.9a";

If you ever have an integration or xgene specific problem, you need a chip specific compatible.

No it;s a IP level problem. If it's a SoC level then probably we cann't reuse the existing arasan version. If anything happens in future we might need our own version.

Quoted 2 lines

Rob

Signature · 3 lines
Thanks,
with regards,
Suman Tripathi
#7 lore raw

PATCH v5 1/1 arm64: dts: Add the arasan sdhc nodes in apm-storm.dtsi.

Quoted 11 lines · On Wednesday 06 May 2015 10:41:07 Suman Tripathi wrote:
Quoted 8 lines

arch/arm64/boot/dts/apm/apm-storm.dtsi line 571

Quoted 6 lines
arch/arm64/boot/dts/apm/apm-storm.dtsi +2 -0
@@ -533,6 +567,16 @@
                        interrupts = <0x0 0x4f 0x4>;
                };
 
+               sdhc0: sdhc at 1c000000 {
+                       device_type = "sdhc";

device_type generally should not be used (there are a few exceptions).

Okay !!

While we're at it, please change sdhc at 1c000000 to mmc at 1c000000. Even though Linux does not care, we try to use the standard device names for consistency.

Arnd

#8 lore raw

PATCH v5 1/1 arm64: dts: Add the arasan sdhc nodes in apm-storm.dtsi.

Quoted 10 lines · Arnd Bergmann
Quoted 9 lines · On Wednesday 06 May 2015 10:41:07 Suman Tripathi wrote:
Quoted 8 lines

arch/arm64/boot/dts/apm/apm-storm.dtsi line 571

Quoted 6 lines
arch/arm64/boot/dts/apm/apm-storm.dtsi +2 -0
@@ -533,6 +567,16 @@
                        interrupts = <0x0 0x4f 0x4>;
                };
 
+               sdhc0: sdhc at 1c000000 {
+                       device_type = "sdhc";

device_type generally should not be used (there are a few exceptions).

Quoted 6 lines
Quoted 2 lines

Okay !!

While we're at it, please change sdhc at 1c000000 to mmc at 1c000000. Even though Linux does not care, we try to use the standard device names for consistency.

Do we have a list of these names somewhere?
Normally I do use ePARP - generic names recommendation but mmc or sdhci are not listed there.
Both combination mmc@ or sdhci@ are used in the kernel.

On zynq and zynqmp we do use shdci at .

Thanks,
Michal

#9 lore raw

PATCH v5 1/1 arm64: dts: Add the arasan sdhc nodes in apm-storm.dtsi.

Quoted 18 lines · On Wednesday 06 May 2015 09:45:15 Michal Simek wrote:
Quoted 10 lines · Arnd Bergmann
Quoted 9 lines · On Wednesday 06 May 2015 10:41:07 Suman Tripathi wrote:
Quoted 8 lines

arch/arm64/boot/dts/apm/apm-storm.dtsi line 571

Quoted 6 lines
arch/arm64/boot/dts/apm/apm-storm.dtsi +2 -0
@@ -533,6 +567,16 @@
                        interrupts = <0x0 0x4f 0x4>;
                };
 
+               sdhc0: sdhc at 1c000000 {
+                       device_type = "sdhc";

device_type generally should not be used (there are a few exceptions).

Quoted 6 lines
Quoted 2 lines

Okay !!

While we're at it, please change sdhc at 1c000000 to mmc at 1c000000. Even though Linux does not care, we try to use the standard device names for consistency.

Quoted 7 lines

Do we have a list of these names somewhere?
Normally I do use ePARP - generic names recommendation but mmc or sdhci are not listed there.
Both combination mmc@ or sdhci@ are used in the kernel.

On zynq and zynqmp we do use shdci at .

Ah, I thought ePAPR listed mmc already. Using "sdhci" is a little too specific here, since a lot of mmc hosts are not sdhci compliant, and "sdhc" is completely wrong, because that identifies a specific card type, but a host that supports SDHC cards will generally also work with SD (less than 4GB) or SDXC (more than 48GB) cards.

Arnd

#10 lore raw

Re: [PATCH v5 1/1] arm64: dts: Add the arasan sdhc nodes in apm-storm.dtsi.

Quoted 25 lines · Arnd Bergmann
Quoted 10 lines · On Wednesday 06 May 2015 09:45:15 Michal Simek wrote:
Quoted 9 lines · Arnd Bergmann
Quoted 8 lines · On Wednesday 06 May 2015 10:41:07 Suman Tripathi wrote:
Quoted 8 lines

arch/arm64/boot/dts/apm/apm-storm.dtsi line 571

Quoted 6 lines
arch/arm64/boot/dts/apm/apm-storm.dtsi +2 -0
@@ -533,6 +567,16 @@
                        interrupts = <0x0 0x4f 0x4>;
                };
 
+               sdhc0: sdhc@1c000000 {
+                       device_type = "sdhc";

device_type generally should not be used (there are a few

exceptions).

Quoted 13 lines
Quoted 7 lines
Quoted 3 lines

Okay !!

While we're at it, please change sdhc@1c000000 to mmc@1c000000. Even though Linux does not care, we try to use the standard device names for consistency.

Do we have a list of these names somewhere?
Normally I do use ePARP - generic names recommendation but mmc or sdhci are not listed there.
Both combination mmc@ or sdhci@ are used in the kernel.

Quoted 9 lines
Quoted 2 lines

On zynq and zynqmp we do use shdci@.

Ah, I thought ePAPR listed mmc already. Using "sdhci" is a little too specific here, since a lot of mmc hosts are not sdhci compliant, and "sdhc" is completely wrong, because that identifies a specific card type, but a host that supports SDHC cards will generally also work with SD (less than 4GB) or SDXC (more than 48GB) cards.

Agree on this . Will change it.

Quoted 3 lines

Arnd

Signature · 3 lines
Thanks,
with regards,
Suman Tripathi

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev

#11 lore raw

Re: [PATCH v5 1/1] arm64: dts: Add the arasan sdhc nodes in apm-storm.dtsi.

Hi Arnd,

Quoted 32 lines · Suman Tripathi
Quoted 28 lines · Arnd Bergmann
Quoted 10 lines · On Wednesday 06 May 2015 09:45:15 Michal Simek wrote:
Quoted 9 lines · Arnd Bergmann
Quoted 8 lines · On Wednesday 06 May 2015 10:41:07 Suman Tripathi wrote:
Quoted 8 lines

Review line 571

Quoted 6 lines
(quoted diff) +2 -0
@@ -533,6 +567,16 @@
                        interrupts = <0x0 0x4f 0x4>;
                };
 
+               sdhc0: sdhc@1c000000 {
+                       device_type = "sdhc";

device_type generally should not be used (there are a few

exceptions).

Quoted 15 lines
Quoted 7 lines
Quoted 3 lines

Okay !!

While we're at it, please change sdhc@1c000000 to mmc@1c000000. Even though Linux does not care, we try to use the standard device names for consistency.

Do we have a list of these names somewhere?
Normally I do use ePARP - generic names recommendation but mmc or sdhci are not listed there.
Both combination mmc@ or sdhci@ are used in the kernel.

On zynq and zynqmp we do use shdci@.

Quoted 9 lines
Quoted 6 lines

Ah, I thought ePAPR listed mmc already. Using "sdhci" is a little too specific here, since a lot of mmc hosts are not sdhci compliant, and "sdhc" is completely wrong, because that identifies a specific card type, but a host that supports SDHC cards will generally also work with SD (less than 4GB) or SDXC (more than 48GB) cards.

Agree on this . Will change it.

One more point as we are resuing the arasan driver, is it compulsory to use the name used in binding info
for arasan ?? It is sdhci for arasan.

Quoted 11 lines
Quoted 3 lines

Arnd

--
Thanks,
with regards,
Suman Tripathi

Signature · 3 lines
Thanks,
with regards,
Suman Tripathi

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev

#12 lore raw

PATCH v5 1/1 arm64: dts: Add the arasan sdhc nodes in apm-storm.dtsi.

In reply to Arnd Bergmann
Quoted 24 lines · Arnd Bergmann
Quoted 23 lines · On Wednesday 06 May 2015 09:45:15 Michal Simek wrote:
Quoted 10 lines · Arnd Bergmann
Quoted 9 lines · On Wednesday 06 May 2015 10:41:07 Suman Tripathi wrote:
Quoted 8 lines

arch/arm64/boot/dts/apm/apm-storm.dtsi line 571

Quoted 6 lines
arch/arm64/boot/dts/apm/apm-storm.dtsi +2 -0
@@ -533,6 +567,16 @@
                        interrupts = <0x0 0x4f 0x4>;
                };
 
+               sdhc0: sdhc at 1c000000 {
+                       device_type = "sdhc";

device_type generally should not be used (there are a few exceptions).

Quoted 6 lines
Quoted 2 lines

Okay !!

While we're at it, please change sdhc at 1c000000 to mmc at 1c000000. Even though Linux does not care, we try to use the standard device names for consistency.

Do we have a list of these names somewhere?
Normally I do use ePARP - generic names recommendation but mmc or sdhci are not listed there.
Both combination mmc@ or sdhci@ are used in the kernel.

Quoted 8 lines
Quoted 2 lines

On zynq and zynqmp we do use shdci at .

Ah, I thought ePAPR listed mmc already. Using "sdhci" is a little too specific here, since a lot of mmc hosts are not sdhci compliant, and "sdhc" is completely wrong, because that identifies a specific card type, but a host that supports SDHC cards will generally also work with SD (less than 4GB) or SDXC (more than 48GB) cards.

Yes "sdhc" is completely wrong.

Based on our datasheet(also version used on Zynq and ZynqMP) this IP is compliant with SD HC 3.00, SDIO 3.0, SD MC 3.01 SD MCS 1.01, MMC 4.51. Not sure about the version which they use.
Also not sure which spec the IP should have to be able to say that we can use sdhci name. Do you have exact SPEC name?

Thanks,
Michal

#13 lore raw

Re: [PATCH v5 1/1] arm64: dts: Add the arasan sdhc nodes in apm-storm.dtsi.

Quoted 29 lines · Michal Simek
Quoted 11 lines · Arnd Bergmann
Quoted 10 lines · On Wednesday 06 May 2015 09:45:15 Michal Simek wrote:
Quoted 9 lines · Arnd Bergmann
Quoted 8 lines · On Wednesday 06 May 2015 10:41:07 Suman Tripathi wrote:
Quoted 8 lines

Review line 571

Quoted 6 lines
(quoted diff) +2 -0
@@ -533,6 +567,16 @@
                        interrupts = <0x0 0x4f 0x4>;
                };
 
+               sdhc0: sdhc@1c000000 {
+                       device_type = "sdhc";

device_type generally should not be used (there are a few

exceptions).

Quoted 16 lines
Quoted 15 lines
Quoted 7 lines
Quoted 3 lines

Okay !!

While we're at it, please change sdhc@1c000000 to mmc@1c000000. Even though Linux does not care, we try to use the standard device names for consistency.

Do we have a list of these names somewhere?
Normally I do use ePARP - generic names recommendation but mmc or sdhci are not listed there.
Both combination mmc@ or sdhci@ are used in the kernel.

On zynq and zynqmp we do use shdci@.

Quoted 8 lines
Quoted 5 lines

Ah, I thought ePAPR listed mmc already. Using "sdhci" is a little too specific here, since a lot of mmc hosts are not sdhci compliant, and "sdhc" is completely wrong, because that identifies a specific card type, but a host that supports SDHC cards will generally also work with SD (less than 4GB) or SDXC (more than 48GB) cards.

Yes "sdhc" is completely wrong.

But spec name in search engine's gives SDHC 3.0 as general.

Quoted 7 lines

Based on our datasheet(also version used on Zynq and ZynqMP) this IP is compliant with SD HC 3.00, SDIO 3.0, SD MC 3.01 SD MCS 1.01, MMC 4.51. Not sure about the version which they use.
Also not sure which spec the IP should have to be able to say that we can use sdhci name. Do you have exact SPEC name?

I also think sdhci because the binding is sdhci written by Arasan. Anyway I will change to sdhci.

Quoted 5 lines

Thanks,
Michal

Signature · 3 lines
Thanks,
with regards,
Suman Tripathi

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev