Skip to contentSkip to conversation

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

PATCH Superseded Suman Tripathi 3 participants 9 messages May 1, 2015 – May 4, 2015 1 message not in the archive

Subsystems (4)

v3 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

v3 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.

---

Suman Tripathi (3):
arm64: dts: Add the arasan sdhc nodes in apm-storm.dtsi.
mmc: host: arasan: Add the support for sdhci-arasan4.9a in
sdhci-of-arasan.c
Documentation: mmc: Update Arasan SDHC documentation to support 4.9a
version of Arasan SDHC controller.

 .../devicetree/bindings/mmc/arasan,sdhci.txt       |  5 ++-
 arch/arm64/boot/dts/apm-mustang.dts                |  4 ++
 arch/arm64/boot/dts/apm-storm.dtsi                 | 44 ++++++++++++++++++++++
 drivers/mmc/host/sdhci-of-arasan.c                 |  7 ++++
 4 files changed, 58 insertions(+), 2 deletions(-)

--
1.8.2.1

#1 lore raw

PATCH v3 1/3 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-mustang.dts |  4 ++++
 arch/arm64/boot/dts/apm-storm.dtsi  | 44 +++++++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+)
arch/arm64/boot/dts/apm-mustang.dts +4 -0
index 8eb6d94..d0e52a9 100644
@@ -44,3 +44,7 @@
 &xgenet {
 	status = "ok";
 };
+
+&sdhc0 {
+	status = "ok";
+};
arch/arm64/boot/dts/apm-storm.dtsi +44 -0

56 lines not on this page · raw message

--
1.8.2.1

#2 lore raw

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

Quoted 67 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-mustang.dts |  4 ++++
 arch/arm64/boot/dts/apm-storm.dtsi  | 44 +++++++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+)
arch/arm64/boot/dts/apm-mustang.dts +4 -0
index 8eb6d94..d0e52a9 100644
@@ -44,3 +44,7 @@
 &xgenet {
 	status = "ok";
 };
+
+&sdhc0 {
+	status = "ok";
+};
arch/arm64/boot/dts/apm-storm.dtsi +34 -0
index 87d3205..d6c2216 100644
@@ -144,6 +144,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>;

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

Quoted 6 lines
arch/arm64/boot/dts/apm-storm.dtsi +3 -0
@@ -503,6 +537,16 @@
 			interrupts = <0x0 0x4f 0x4>;
 		};
 
+		sdhc0: sdhc at 1c000000 {
+			device_type = "sdhc";
+			compatible = "arasan,sdhci-8.9a", "arasan,sdhci-4.9a";

I would just add 4.9a here because you want to use that quirks. We can add some quirks to 8.9a version if any new problem arises.

Thanks,
Michal

#3 lore raw

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

Hi,

Quoted 71 lines · Michal Simek
Quoted 70 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-mustang.dts |  4 ++++
 arch/arm64/boot/dts/apm-storm.dtsi  | 44 +++++++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+)
arch/arm64/boot/dts/apm-mustang.dts +4 -0
index 8eb6d94..d0e52a9 100644
@@ -44,3 +44,7 @@
 &xgenet {
      status = "ok";
 };
+
+&sdhc0 {
+     status = "ok";
+};
arch/arm64/boot/dts/apm-storm.dtsi +34 -0
index 87d3205..d6c2216 100644
@@ -144,6 +144,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>;
@@ -503,6 +537,16 @@
                      interrupts = <0x0 0x4f 0x4>;
              };
 
Quoted 6 lines

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

Quoted 3 lines
arch/arm64/boot/dts/apm-storm.dtsi +3 -0
+             sdhc0: sdhc at 1c000000 {
+                     device_type = "sdhc";
+                     compatible = "arasan,sdhci-8.9a", "arasan,sdhci-4.9a";

I would just add 4.9a here because you want to use that quirks. We can add some quirks to 8.9a version if any new problem arises.

Make sense too. Our's is 4.9a. Thanks for the catch.

Quoted 3 lines

Thanks,
Michal

Signature · 3 lines
Thanks,
with regards,
Suman Tripathi

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

#5 lore raw

PATCH v3 2/3 mmc: host: arasan: Add the support for sdhci-arasan4.9a in sdhci-of-arasan.c.

This patch adds the quirks and compatible string in sdhci-of-arasan.c to support sdhci-arasan4.9a version of controller.

---
 drivers/mmc/host/sdhci-of-arasan.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/mmc/host/sdhci-of-arasan.c +7 -0
index 981d66e..92a4222 100644
@@ -20,6 +20,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/of_device.h>
 #include "sdhci-pltfm.h"
 
 #define SDHCI_ARASAN_CLK_CTRL_OFFSET	0x2c
@@ -169,6 +170,11 @@ static int sdhci_arasan_probe(struct platform_device *pdev)
 		goto clk_disable_all;
 	}
 
+	if (of_device_is_compatible(pdev->dev.of_node, "arasan,sdhci-4.9a")) {
+		host->quirks |= SDHCI_QUIRK_NO_HISPD_BIT;
+		host->quirks2 |= SDHCI_QUIRK2_HOST_NO_CMD23;
+	}
+
 	sdhci_get_of_property(pdev);
 	pltfm_host = sdhci_priv(host);
 	pltfm_host->priv = sdhci_arasan;
@@ -206,6 +212,7 @@ static int sdhci_arasan_remove(struct platform_device *pdev)
 
 static const struct of_device_id sdhci_arasan_of_match[] = {
 	{ .compatible = "arasan,sdhci-8.9a" },
+	{ .compatible = "arasan,sdhci-4.9a" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, sdhci_arasan_of_match);

--
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

#6 lore raw

PATCH v3 3/3 Documentation: mmc: Update Arasan SDHC documentation to support 4.9a version of Arasan SDHC controller.

In reply to Suman Tripathi

This patch updates Arasan SDHC documentation to support 4.9a version of Arasan SDHC controller.

---
 Documentation/devicetree/bindings/mmc/arasan,sdhci.txt | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/mmc/arasan,sdhci.txt +3 -2
index 98ee2ab..f01d41a 100644
@@ -8,7 +8,8 @@ Device Tree Bindings for the Arasan SDHCI Controller
   [3] Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
 
 Required Properties:
-  - compatible: Compatibility string. Must be 'arasan,sdhci-8.9a'
+  - compatible: Compatibility string. Must be 'arasan,sdhci-8.9a' or
+                'arasan,sdhci-4.9a'           
   - reg: From mmc bindings: Register location and length.
   - clocks: From clock bindings: Handles to clock inputs.
   - clock-names: From clock bindings: Tuple including "clk_xin" and "clk_ahb"
@@ -18,7 +19,7 @@ Required Properties:
 
 Example:
 	sdhci@e0100000 {
-		compatible = "arasan,sdhci-8.9a";
+		compatible = "arasan,sdhci-8.9a", "arasan,sdhci-4.9a";
 		reg = <0xe0100000 0x1000>;
 		clock-names = "clk_xin", "clk_ahb";
 		clocks = <&clkc 21>, <&clkc 32>;
Signature · 1 line
1.8.2.1
#7 lore raw

PATCH v3 3/3 Documentation: mmc: Update Arasan SDHC documentation to support 4.9a version of Arasan SDHC controller.

Quoted 23 lines · Suman Tripathi

This patch updates Arasan SDHC documentation to support 4.9a version of Arasan SDHC controller.

---
 Documentation/devicetree/bindings/mmc/arasan,sdhci.txt | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/mmc/arasan,sdhci.txt +2 -1
index 98ee2ab..f01d41a 100644
@@ -8,7 +8,8 @@ Device Tree Bindings for the Arasan SDHCI Controller
   [3] Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
 
 Required Properties:
-  - compatible: Compatibility string. Must be 'arasan,sdhci-8.9a'
+  - compatible: Compatibility string. Must be 'arasan,sdhci-8.9a' or
+                'arasan,sdhci-4.9a'           
   - reg: From mmc bindings: Register location and length.
   - clocks: From clock bindings: Handles to clock inputs.
   - clock-names: From clock bindings: Tuple including "clk_xin" and "clk_ahb"

Documentation/devicetree/bindings/mmc/arasan,sdhci.txt Required Properties: · line 22

Quoted 5 lines
Documentation/devicetree/bindings/mmc/arasan,sdhci.txt +1 -1
@@ -18,7 +19,7 @@ Required Properties:
 
 Example:
 	sdhci at e0100000 {
-		compatible = "arasan,sdhci-8.9a";
+		compatible = "arasan,sdhci-8.9a", "arasan,sdhci-4.9a";

Is there any reason to change this example?
You probably want to have just one compatible string not both.

Thanks,
Michal

#8 lore raw

PATCH v3 3/3 Documentation: mmc: Update Arasan SDHC documentation to support 4.9a version of Arasan SDHC controller.

Hi,

Quoted 25 lines · Michal Simek
Quoted 24 lines · Suman Tripathi

This patch updates Arasan SDHC documentation to support 4.9a version of Arasan SDHC controller.

---
 Documentation/devicetree/bindings/mmc/arasan,sdhci.txt | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/mmc/arasan,sdhci.txt +2 -1
index 98ee2ab..f01d41a 100644
@@ -8,7 +8,8 @@ Device Tree Bindings for the Arasan SDHCI Controller
   [3] Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
 
 Required Properties:
-  - compatible: Compatibility string. Must be 'arasan,sdhci-8.9a'
+  - compatible: Compatibility string. Must be 'arasan,sdhci-8.9a' or
+                'arasan,sdhci-4.9a'
   - reg: From mmc bindings: Register location and length.
   - clocks: From clock bindings: Handles to clock inputs.
   - clock-names: From clock bindings: Tuple including "clk_xin" and "clk_ahb"
@@ -18,7 +19,7 @@ Required Properties:
 
Quoted 6 lines

Documentation/devicetree/bindings/mmc/arasan,sdhci.txt Required Properties: · line 22

Quoted 4 lines
Documentation/devicetree/bindings/mmc/arasan,sdhci.txt +1 -1
 Example:
      sdhci at e0100000 {
-             compatible = "arasan,sdhci-8.9a";
+             compatible = "arasan,sdhci-8.9a", "arasan,sdhci-4.9a";

Is there any reason to change this example?

Thought that if dts is updated so why not update the binding too.

Quoted 1 line

You probably want to have just one compatible string not both.

Okay will remove in next version.

Quoted 7 lines

Thanks,
Michal

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

PATCH v3 3/3 Documentation: mmc: Update Arasan SDHC documentation to support 4.9a version of Arasan SDHC controller.

Quoted 28 lines · Suman Tripathi

Hi,

Quoted 25 lines · Michal Simek
Quoted 24 lines · Suman Tripathi

This patch updates Arasan SDHC documentation to support 4.9a version of Arasan SDHC controller.

---
 Documentation/devicetree/bindings/mmc/arasan,sdhci.txt | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/mmc/arasan,sdhci.txt +2 -1
index 98ee2ab..f01d41a 100644
@@ -8,7 +8,8 @@ Device Tree Bindings for the Arasan SDHCI Controller
   [3] Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
 
 Required Properties:
-  - compatible: Compatibility string. Must be 'arasan,sdhci-8.9a'
+  - compatible: Compatibility string. Must be 'arasan,sdhci-8.9a' or
+                'arasan,sdhci-4.9a'
   - reg: From mmc bindings: Register location and length.
   - clocks: From clock bindings: Handles to clock inputs.
   - clock-names: From clock bindings: Tuple including "clk_xin" and "clk_ahb"
@@ -18,7 +19,7 @@ Required Properties:
 
Quoted 8 lines
Quoted 6 lines

Documentation/devicetree/bindings/mmc/arasan,sdhci.txt Required Properties: · line 22

Quoted 4 lines
Documentation/devicetree/bindings/mmc/arasan,sdhci.txt +1 -1
 Example:
      sdhci at e0100000 {
-             compatible = "arasan,sdhci-8.9a";
+             compatible = "arasan,sdhci-8.9a", "arasan,sdhci-4.9a";

Is there any reason to change this example?

Thought that if dts is updated so why not update the binding too.

It is just about updating example. It is fine to update binding.

Thanks,
Michal