Skip to contentSkip to conversation

Migrate i.MX53 based cx9020 to CONFIG_DM_MMC=y

PATCH New linux-kernel-dev at beckhoff.com 2 participants 7 messages Jan 3, 2019 – Jan 30, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Migrate i.MX53 based cx9020 to CONFIG_DM_MMC=y

From: Patrick Bruenn <[email protected]>

This series is based on v2019.01-rc2. It enables compatible "fsl,imx53-esdhc" for fsl_esdhc driver and copies esdhc1 and esdhc2 device tree nodes from Linux 4.20 into imx53.dtsi. The last patch enables these nodes for imx53-cx9020.dts and adds CONFIG_DM_MMC=y for mx53cx9020_defconfig.

I have no other imx53 platform available for testing, but I could add esdhc3/4 and convert more imx53 boards, if wanted.

Patrick Bruenn (3):
mmc: fsl_esdhc: add compatible for fsl,imx53-esdhc
arm: imx: Add esdhc1/2 nodes to imx53.dtsi
dm: arm: imx: migrate cx9020 to CONFIG_DM_MMC

 arch/arm/dts/imx53-cx9020.dts | 52 +++++++++++++++++++++++++++++++------------
 arch/arm/dts/imx53.dtsi       | 34 ++++++++++++++++++++++++++++
 configs/mx53cx9020_defconfig  |  1 +
 drivers/mmc/fsl_esdhc.c       |  1 +
 4 files changed, 74 insertions(+), 14 deletions(-)
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/3 mmc: fsl_esdhc: add compatible for fsl, imx53-esdhc

From: Patrick Bruenn <[email protected]>

Add compatible "fsl,imx53-esdhc" to keep mmc working on i.MX53 platforms with CONFIG_DM_MMC=y

---

 drivers/mmc/fsl_esdhc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mmc/fsl_esdhc.c +1 -0
index 3cdfa7f5a68..ff912645f05 100644
@@ -1579,6 +1579,7 @@ static struct esdhc_soc_data usdhc_imx7d_data = {
 };
 
 static const struct udevice_id fsl_esdhc_ids[] = {
+	{ .compatible = "fsl,imx53-esdhc", },
 	{ .compatible = "fsl,imx6ul-usdhc", },
 	{ .compatible = "fsl,imx6sx-usdhc", },
 	{ .compatible = "fsl,imx6sl-usdhc", },
Signature · 1 line
2.11.0
#2 lore raw

PATCH 1/3 mmc: fsl_esdhc: add compatible for fsl, imx53-esdhc

Quoted 4 lines

From: Patrick Bruenn <[email protected]>
Add compatible "fsl,imx53-esdhc" to keep mmc working on i.MX53 platforms with CONFIG_DM_MMC=y

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#3 lore raw

PATCH 2/3 arm: imx: Add esdhc1/2 nodes to imx53.dtsi

In reply to linux-kernel-dev at beckhoff.com

From: Patrick Bruenn <[email protected]>

These nodes are required by CX9020 when build with CONFIG_DM_MMC=y They are copied from Linux 4.20

---

 arch/arm/dts/imx53.dtsi | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
arch/arm/dts/imx53.dtsi +34 -0
index 64591f9d476..e13009c8708 100644
@@ -31,6 +31,8 @@
 		i2c0 = &i2c1;
 		i2c1 = &i2c2;
 		i2c2 = &i2c3;
+		mmc0 = &esdhc1;
+		mmc1 = &esdhc2;
 	};
 
 	tzic: tz-interrupt-controller at fffc000 {
@@ -54,6 +56,38 @@
 			reg = <0x50000000 0x10000000>;
 			ranges;
 
+			spba at 50000000 {
+				compatible = "fsl,spba-bus", "simple-bus";
+				#address-cells = <1>;
+				#size-cells = <1>;
+				reg = <0x50000000 0x40000>;
+				ranges;
+
+				esdhc1: esdhc at 50004000 {
+					compatible = "fsl,imx53-esdhc";
+					reg = <0x50004000 0x4000>;
+					interrupts = <1>;
+					clocks = <&clks IMX5_CLK_ESDHC1_IPG_GATE>,
+						 <&clks IMX5_CLK_DUMMY>,
+						 <&clks IMX5_CLK_ESDHC1_PER_GATE>;
+					clock-names = "ipg", "ahb", "per";
+					bus-width = <4>;
+					status = "disabled";
+				};
+
+				esdhc2: esdhc at 50008000 {
+					compatible = "fsl,imx53-esdhc";
+					reg = <0x50008000 0x4000>;
+					interrupts = <2>;
+					clocks = <&clks IMX5_CLK_ESDHC2_IPG_GATE>,
+						 <&clks IMX5_CLK_DUMMY>,
+						 <&clks IMX5_CLK_ESDHC2_PER_GATE>;
+					clock-names = "ipg", "ahb", "per";
+					bus-width = <4>;
+					status = "disabled";
+				};
+			};
+
 			iomuxc: iomuxc at 53fa8000 {
 				compatible = "fsl,imx53-iomuxc";
 				reg = <0x53fa8000 0x4000>;
Signature · 1 line
2.11.0
#4 lore raw

PATCH 2/3 arm: imx: Add esdhc1/2 nodes to imx53.dtsi

Quoted 4 lines

From: Patrick Bruenn <[email protected]>
These nodes are required by CX9020 when build with CONFIG_DM_MMC=y They are copied from Linux 4.20

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#5 lore raw

PATCH 3/3 dm: arm: imx: migrate cx9020 to CONFIG_DM_MMC

In reply to linux-kernel-dev at beckhoff.com

From: Patrick Bruenn <[email protected]>

Enable esdhc1/2 device nodes for cx9020 and build with CONFIG_DM_MMC=y

---

 arch/arm/dts/imx53-cx9020.dts | 52 +++++++++++++++++++++++++++++++------------
 configs/mx53cx9020_defconfig  |  1 +
 2 files changed, 39 insertions(+), 14 deletions(-)
arch/arm/dts/imx53-cx9020.dts +38 -14
index c2e7d86c1b8..36ceae36aa9 100644
@@ -99,20 +99,6 @@
 				MX53_PAD_KEY_COL1__AUDMUX_AUD5_TXFS	0x80000000
 				MX53_PAD_KEY_ROW1__AUDMUX_AUD5_RXD	0x80000000
 
-				MX53_PAD_SD1_DATA0__ESDHC1_DAT0		0x1d5
-				MX53_PAD_SD1_DATA1__ESDHC1_DAT1		0x1d5
-				MX53_PAD_SD1_DATA2__ESDHC1_DAT2		0x1d5
-				MX53_PAD_SD1_DATA3__ESDHC1_DAT3		0x1d5
-				MX53_PAD_SD1_CMD__ESDHC1_CMD		0x1d5
-				MX53_PAD_SD1_CLK__ESDHC1_CLK		0x1d5
-
-				MX53_PAD_SD2_DATA0__ESDHC2_DAT0		0x1d5
-				MX53_PAD_SD2_DATA1__ESDHC2_DAT1		0x1d5
-				MX53_PAD_SD2_DATA2__ESDHC2_DAT2		0x1d5
-				MX53_PAD_SD2_DATA3__ESDHC2_DAT3		0x1d5
-				MX53_PAD_SD2_CMD__ESDHC2_CMD		0x1d5
-				MX53_PAD_SD2_CLK__ESDHC2_CLK		0x1d5
-
 				MX53_PAD_FEC_MDC__FEC_MDC		0x4
 				MX53_PAD_FEC_MDIO__FEC_MDIO		0x1fc
 				MX53_PAD_FEC_REF_CLK__FEC_TX_CLK	0x180
@@ -162,6 +148,28 @@
 			>;
 		};
 
+		pinctrl_esdhc1: esdhc1grp {
+			fsl,pins = <
+				MX53_PAD_SD1_DATA0__ESDHC1_DAT0		0x1d5
+				MX53_PAD_SD1_DATA1__ESDHC1_DAT1		0x1d5
+				MX53_PAD_SD1_DATA2__ESDHC1_DAT2		0x1d5
+				MX53_PAD_SD1_DATA3__ESDHC1_DAT3		0x1d5
+				MX53_PAD_SD1_CMD__ESDHC1_CMD		0x1d5
+				MX53_PAD_SD1_CLK__ESDHC1_CLK		0x1d5
+			>;
+		};
+
+		pinctrl_esdhc2: esdhc2grp {
+			fsl,pins = <
+				MX53_PAD_SD2_DATA0__ESDHC2_DAT0		0x1d5
+				MX53_PAD_SD2_DATA1__ESDHC2_DAT1		0x1d5
+				MX53_PAD_SD2_DATA2__ESDHC2_DAT2		0x1d5
+				MX53_PAD_SD2_DATA3__ESDHC2_DAT3		0x1d5
+				MX53_PAD_SD2_CMD__ESDHC2_CMD		0x1d5
+				MX53_PAD_SD2_CLK__ESDHC2_CLK		0x1d5
+			>;
+		};
+
 		pinctrl_uart2: uart2grp {
 			fsl,pins = <
 				MX53_PAD_EIM_D26__UART2_RXD_MUX	0x1e4
@@ -181,6 +189,22 @@
 	status = "okay";
 };
 
+&esdhc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_esdhc1>;
+	cd-gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
+	bus-width = <4>;
+	status = "okay";
+};
+
+&esdhc2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_esdhc2>;
+	cd-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
+	bus-width = <4>;
+	status = "okay";
+};
+
 &fec {
 	pinctrl-names = "default";
 	phy-mode = "rmii";
configs/mx53cx9020_defconfig +1 -0
index 3cff52031a0..ddd65e8ee15 100644
@@ -19,6 +19,7 @@ CONFIG_CMD_EXT2=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_DM_MMC=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="imx53-cx9020"
 CONFIG_ENV_IS_IN_MMC=y
Signature · 1 line
2.11.0
#6 lore raw

PATCH 3/3 dm: arm: imx: migrate cx9020 to CONFIG_DM_MMC

Quoted 3 lines

From: Patrick Bruenn <[email protected]>
Enable esdhc1/2 device nodes for cx9020 and build with CONFIG_DM_MMC=y

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================