Skip to contentSkip to conversation

Add support for SD card on on AM65x-evm

PATCH Applied Faiz Abbas 2 participants 4 messages Jul 10, 2020 – Jul 17, 2020

Subsystems (2)
lore
Share & tools
lore

Faiz Abbas

author
#0 lore raw

cover Add support for SD card on on AM65x-evm

The following patches add support for SD card node in am654x-evm

Because of fundamental interface issues (see patch 2 for details), SD card was never enabled for silicon revision 1.0

These issues have been fixed with SR2.0 but boards with SR1.0 are recommended to disable this node

These patches depend on kernel patches for supporting silicon revision 2.0 posted here:
https://patchwork.kernel.org/project/linux-mmc/list/?series=305565

The dependencies have been picked up and are in linux-next

Faiz Abbas (2):
arm64: dts: ti: k3-am65-main: Add support for sdhci1
arm64: dts: ti: k3-am654-base-board: Add support for SD card

 arch/arm64/boot/dts/ti/k3-am65-main.dtsi      | 24 +++++++++++++++++++
 .../arm64/boot/dts/ti/k3-am654-base-board.dts | 24 +++++++++++++++++++
 2 files changed, 48 insertions(+)
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 1/2 arm64: dts: ti: k3-am65-main: Add support for sdhci1

Add support for the 2nd SDHCI controller on TI's AM654x SoCs. Although it supports upto SDR104 (100 MBps @ 200 MHz) speed mode, only enable support upto High Speed (25 MBps @ 50 MHz) for now.

---
 arch/arm64/boot/dts/ti/k3-am65-main.dtsi | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
arch/arm64/boot/dts/ti/k3-am65-main.dtsi +24 -0
index 3a4effee8fba..dfb429bed56d 100644
@@ -259,6 +259,30 @@
 		dma-coherent;
 	};
 
+	sdhci1: sdhci@4fa0000 {
+		compatible = "ti,am654-sdhci-5.1";
+		reg = <0x0 0x4fa0000 0x0 0x260>, <0x0 0x4fb0000 0x0 0x134>;
+		power-domains = <&k3_pds 48 TI_SCI_PD_EXCLUSIVE>;
+		clocks = <&k3_clks 48 0>, <&k3_clks 48 1>;
+		clock-names = "clk_ahb", "clk_xin";
+		interrupts = <GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>;
+		ti,otap-del-sel-legacy = <0x0>;
+		ti,otap-del-sel-mmc-hs = <0x0>;
+		ti,otap-del-sel-sd-hs = <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,otap-del-sel-ddr52 = <0x4>;
+		ti,otap-del-sel-hs200 = <0x7>;
+		ti,clkbuf-sel = <0x7>;
+		ti,otap-del-sel = <0x2>;
+		ti,trm-icp = <0x8>;
+		dma-coherent;
+		no-1-8-v;
+	};
+
 	scm_conf: scm_conf@100000 {
 		compatible = "syscon", "simple-mfd";
 		reg = <0 0x00100000 0 0x1c000>;
Signature · 1 line
2.17.1
author
#2 lore raw

PATCH 2/2 arm64: dts: ti: k3-am654-base-board: Add support for SD card

In reply to Faiz Abbas

With silicon revision 2.0, add support for SD card on the am65x-evm. Boards with silicon revision 1.0 are susceptible to interface issues because of erratas i2025 and i2026[1] and are recommended to disable this node.

[1] Am654x Silicon Revision 1.0 errata: https://www.ti.com/lit/pdf/sprz452

---
 .../arm64/boot/dts/ti/k3-am654-base-board.dts | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)
arch/arm64/boot/dts/ti/k3-am654-base-board.dts +24 -0
index 9fc7898a6a3b..84aeb4761ac0 100644
@@ -167,6 +167,19 @@
 		>;
 	};
 
+	main_mmc1_pins_default: main_mmc1_pins_default {
+		pinctrl-single,pins = <
+			AM65X_IOPAD(0x02d4, PIN_INPUT_PULLDOWN, 0) /* (C27) MMC1_CLK */
+			AM65X_IOPAD(0x02d8, PIN_INPUT_PULLUP, 0) /* (C28) MMC1_CMD */
+			AM65X_IOPAD(0x02d0, PIN_INPUT_PULLUP, 0) /* (D28) MMC1_DAT0 */
+			AM65X_IOPAD(0x02cc, PIN_INPUT_PULLUP, 0) /* (E27) MMC1_DAT1 */
+			AM65X_IOPAD(0x02c8, PIN_INPUT_PULLUP, 0) /* (D26) MMC1_DAT2 */
+			AM65X_IOPAD(0x02c4, PIN_INPUT_PULLUP, 0) /* (D27) MMC1_DAT3 */
+			AM65X_IOPAD(0x02dc, PIN_INPUT_PULLUP, 0) /* (B24) MMC1_SDCD */
+			AM65X_IOPAD(0x02e0, PIN_INPUT, 0) /* (C24) MMC1_SDWP */
+		>;
+	};
+
 	usb1_pins_default: usb1_pins_default {
 		pinctrl-single,pins = <
 			AM65X_IOPAD(0x02c0, PIN_OUTPUT, 0) /* (AC8) USB1_DRVVBUS */
@@ -299,6 +312,17 @@
 	ti,driver-strength-ohm = <50>;
 	disable-wp;
 };
+/*
+ * Because of erratas i2025 and i2026 for silicon revision 1.0, the
+ * SD card interface might fail. Boards with sr1.0 are recommended to
+ * disable sdhci1
+ */
+&sdhci1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&main_mmc1_pins_default>;
+	ti,driver-strength-ohm = <50>;
+	disable-wp;
+};
 
 &dwc3_1 {
 	status = "okay";
Signature · 1 line
2.17.1
Applied
#3 lore raw
In reply to Faiz Abbas
Quoted 5 lines · Faiz Abbas

The following patches add support for SD card node in am654x-evm

Because of fundamental interface issues (see patch 2 for details), SD card was never enabled for silicon revision 1.0

Quoted 8 lines

These issues have been fixed with SR2.0 but boards with SR1.0 are recommended to disable this node

These patches depend on kernel patches for supporting silicon revision 2.0 posted here:
https://patchwork.kernel.org/project/linux-mmc/list/?series=305565

The dependencies have been picked up and are in linux-next

Queued up for 5.9, thanks.

-Tero

Quoted 9 lines

Faiz Abbas (2):
arm64: dts: ti: k3-am65-main: Add support for sdhci1
arm64: dts: ti: k3-am654-base-board: Add support for SD card

  arch/arm64/boot/dts/ti/k3-am65-main.dtsi      | 24 +++++++++++++++++++
  .../arm64/boot/dts/ti/k3-am654-base-board.dts | 24 +++++++++++++++++++
  2 files changed, 48 insertions(+)

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki