Skip to contentSkip to conversation

Add driver Support for MMCSD on AM654x

PATCH Superseded Faiz Abbas 2 participants 5 messages Dec 7, 2018 – Dec 18, 2018

Subsystems (5)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
author
#2 lore raw

PATCH v2 2/3 dt-bindings: mmc: sdhci-of-arasan: Add deprecated message for am65

In reply to Faiz Abbas

Commit 26a4f38d1316 ("dt-bindings: mmc: sdhci-of-arasan: Add new compatible for AM654 MMC PHY") added a new compatible for supporting controllers on TI's AM65x SOCs. It turns out that the controller is not compatible with the arasan driver's phy and consumer model as it requires some phy registers for core sdhci functionality. This calls for the binding to branch out to a new driver.

Therefore, add a deprecated message for the ti,am654-sdhci-5.1 binding.

---
 Documentation/devicetree/bindings/mmc/arasan,sdhci.txt | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/mmc/arasan,sdhci.txt +4 -0
index e2effe17f05e..1edbb049cccb 100644
@@ -16,6 +16,10 @@ Required Properties:
     - "rockchip,rk3399-sdhci-5.1", "arasan,sdhci-5.1": rk3399 eMMC PHY
       For this device it is strongly suggested to include arasan,soc-ctl-syscon.
     - "ti,am654-sdhci-5.1", "arasan,sdhci-5.1": TI AM654 MMC PHY
+	Note: This binding has been deprecated and moved to [5].
+
+  [5] Documentation/devicetree/bindings/mmc/sdhci-am654.txt
+
   - 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"
Signature · 1 line
2.19.2

Faiz Abbas

author
#0 lore raw

v2 cover Add driver Support for MMCSD on AM654x

The following patches add driver support for MMCSD on TI's AM654 platforms.

Previously I had added the support to sdhci-of-arasan driver with a separate phy driver[1]. Since then it has turned out that tuning operation (for HS200, HS400 and SDR104 speed modes) will require configuration of phy registers. This completely breaks the model of the sdhci-of-arasan driver which relies on a separate driver to configure the phy register space.

Because of this, I am creating a new driver with both the sdhci and phy register spaces. This helps me use the phy registers in a future patch that adds tuning support.

DT patches will be posted in a separate series.

Changes in v2:
1. Reset OTAP delay back to default value in init.
2. Improved patch description for patch 2.
3. Minor style fixes.

[1] driver and phy patches posted before

    https://patchwork.kernel.org/project/linux-mmc/list/?series=26623

Faiz Abbas (3):
dt-bindings: mmc: sdhci-am654: Document bindings for the host
controllers on TI's AM654 SOCs
dt-bindings: mmc: sdhci-of-arasan: Add deprecated message for am65
mmc: sdhci_am654: Add Initial Support for AM654 SDHCI driver

 .../devicetree/bindings/mmc/arasan,sdhci.txt  |   4 +
 .../devicetree/bindings/mmc/sdhci-am654.txt   |  37 ++
 drivers/mmc/host/Kconfig                      |  12 +
 drivers/mmc/host/Makefile                     |   1 +
 drivers/mmc/host/sdhci-of-arasan.c            |  46 ---
 drivers/mmc/host/sdhci_am654.c                | 381 ++++++++++++++++++
 6 files changed, 435 insertions(+), 46 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mmc/sdhci-am654.txt
 create mode 100644 drivers/mmc/host/sdhci_am654.c
Signature · 1 line
2.19.2
author
#1 lore raw

PATCH v2 1/3 dt-bindings: mmc: sdhci-am654: Document bindings for the host controllers on TI's AM654 SOCs

Add binding documentation for mmc host controllers present on TI's AM654 SOCs.

---
 .../devicetree/bindings/mmc/sdhci-am654.txt   | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mmc/sdhci-am654.txt
Documentation/devicetree/bindings/mmc/sdhci-am654.txt new file +37 -0
new file mode 100644
index 000000000000..862b93051bfe
@@ -0,0 +1,37 @@
+Device Tree Bindings for the SDHCI Controllers present on TI's AM654 SOCs
+
+The bindings follow the mmc[1], clock[2] and interrupt[3] bindings.
+Only deviations are documented here.
+
+  [1] Documentation/devicetree/bindings/mmc/mmc.txt
+  [2] Documentation/devicetree/bindings/clock/clock-bindings.txt
+  [3] Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
+
+Required Properties:
+	- compatible: should be "ti,am654-sdhci-5.1"
+	- reg: Must be two entries.
+		- The first should be the sdhci register space
+		- The second should the subsystem/phy register space
+	- clocks: Handles to the clock inputs.
+	- clock-names: Tuple including "clk_xin" and "clk_ahb"
+	- interrupts: Interrupt specifiers
+	- ti,otap-del-sel: Output Tap Delay select
+	- ti,trm-icp: DLL trim select
+	- ti,driver-strength-ohm: driver strength in ohms.
+				  Valid values are 33, 40, 50, 66 and 100 ohms.
+
+Example:
+
+	sdhci0: sdhci@4f80000 {
+		compatible = "ti,am654-sdhci-5.1";
+		reg = <0x0 0x4f80000 0x0 0x260>, <0x0 0x4f90000 0x0 0x134>;
+		power-domains = <&k3_pds 47>;
+		clocks = <&k3_clks 47 0>, <&k3_clks 47 1>;
+		clock-names = "clk_ahb", "clk_xin";
+		interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>;
+		sdhci-caps-mask = <0x80000007 0x0>;
+		mmc-ddr-1_8v;
+		ti,otap-del-sel = <0x2>;
+		ti,trm-icp = <0x8>;
+		status = "disabled";
+	};
Signature · 1 line
2.19.2
author
#4 lore raw

PATCH v2 3/3 mmc: sdhci_am654: Add Initial Support for AM654 SDHCI driver

In reply to Faiz Abbas

The host controllers on TI's AM654 SOCs are not compatible with the phy and consumer model of the sdhci-of-arasan driver. It turns out that for optimal operation at higher speeds, a special tuning procedure needs to be implemented which involves configuration of platform specific phy registers.

Therefore, branch out to a new sdhci_am654 driver and add the phy register space with all phy configurations to it. Populate AM654 specific callbacks to sdhci_ops and add SDHCI_QUIRKS wherever applicable.

Only add support for upto High Speed for SD card and upto DDR52 speed mode for eMMC. Higher speeds will be added in subsequent patches.

---
 drivers/mmc/host/Kconfig           |  12 +
 drivers/mmc/host/Makefile          |   1 +
 drivers/mmc/host/sdhci-of-arasan.c |  46 ----
 drivers/mmc/host/sdhci_am654.c     | 381 +++++++++++++++++++++++++++++
 4 files changed, 394 insertions(+), 46 deletions(-)
 create mode 100644 drivers/mmc/host/sdhci_am654.c
drivers/mmc/host/Kconfig +12 -0
index 1b58739d9744..cfb2eb1a2c32 100644
@@ -977,3 +977,15 @@ config MMC_SDHCI_OMAP
 	  If you have a controller with this interface, say Y or M here.
 
 	  If unsure, say N.
+
+config MMC_SDHCI_AM654
+	tristate "Support for the SDHCI Controller in TI's AM654 SOCs"
+	depends on MMC_SDHCI_PLTFM && OF
+	help
+	  This selects the Secure Digital Host Controller Interface (SDHCI)
+	  support present in TI's AM654 SOCs. The controller supports
+	  SD/MMC/SDIO devices.
+
+	  If you have a controller with this interface, say Y or M here.
+
+	  If unsure, say N.
drivers/mmc/host/Makefile +1 -0
index 720d37777098..5c7770edc431 100644
@@ -22,6 +22,7 @@ obj-$(CONFIG_MMC_SDHCI_S3C)	+= sdhci-s3c.o
 obj-$(CONFIG_MMC_SDHCI_SIRF)   	+= sdhci-sirf.o
 obj-$(CONFIG_MMC_SDHCI_F_SDH30)	+= sdhci_f_sdh30.o
 obj-$(CONFIG_MMC_SDHCI_SPEAR)	+= sdhci-spear.o
+obj-$(CONFIG_MMC_SDHCI_AM654)	+= sdhci_am654.o
 obj-$(CONFIG_MMC_WBSD)		+= wbsd.o
 obj-$(CONFIG_MMC_AU1X)		+= au1xmmc.o
 obj-$(CONFIG_MMC_MTK)		+= mtk-sd.o
drivers/mmc/host/sdhci-of-arasan.c +0 -46

64 lines not on this page · raw message

drivers/mmc/host/sdhci_am654.c new file +381 -0

381 lines not on this page · raw message

Signature · 7 lines
2.19.2


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer Reviewed-by on v2 2/3
#3 lore raw

Re: [PATCH v2 2/3] dt-bindings: mmc: sdhci-of-arasan: Add deprecated message for am65

In reply to Faiz Abbas
Quoted 7 lines · Faiz Abbas

Commit 26a4f38d1316 ("dt-bindings: mmc: sdhci-of-arasan: Add new compatible for AM654 MMC PHY") added a new compatible for supporting controllers on TI's AM65x SOCs. It turns out that the controller is not compatible with the arasan driver's phy and consumer model as it requires some phy registers for core sdhci functionality. This calls for the binding to branch out to a new driver.

Quoted 7 lines

Therefore, add a deprecated message for the ti,am654-sdhci-5.1 binding.

---
 Documentation/devicetree/bindings/mmc/arasan,sdhci.txt | 4 ++++
 1 file changed, 4 insertions(+)