Skip to contentSkip to conversation

UniPhier SD/eMMC controller driver

PATCH Superseded Masahiro Yamada 1 participant 4 messages Feb 3, 2016

Subsystems (3)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

cover UniPhier SD/eMMC controller driver

Masahiro Yamada (3):
mmc: uniphier: add driver for UniPhier SD/MMC host controller
ARM: uniphier: enable UniPhier SD/MMC host driver
ARM: dts: uniphier: add SD/MMC host controller nodes

 arch/arm/Kconfig                             |   1 +
 arch/arm/dts/uniphier-ph1-ld4-ref.dts        |   4 +
 arch/arm/dts/uniphier-ph1-ld4.dtsi           |  25 +
 arch/arm/dts/uniphier-ph1-ld6b-ref.dts       |   4 +
 arch/arm/dts/uniphier-ph1-pro4-ref.dts       |   8 +
 arch/arm/dts/uniphier-ph1-pro4.dtsi          |  37 ++
 arch/arm/dts/uniphier-ph1-pro5-4kbox.dts     |   8 +
 arch/arm/dts/uniphier-ph1-pro5.dtsi          |  24 +
 arch/arm/dts/uniphier-ph1-sld3-ref.dts       |   4 +
 arch/arm/dts/uniphier-ph1-sld3.dtsi          |  19 +
 arch/arm/dts/uniphier-ph1-sld8-ref.dts       |   4 +
 arch/arm/dts/uniphier-ph1-sld8.dtsi          |  25 +
 arch/arm/dts/uniphier-pinctrl.dtsi           |  15 +
 arch/arm/dts/uniphier-proxstream2-gentil.dts |   4 +
 arch/arm/dts/uniphier-proxstream2-vodka.dts  |   4 +
 arch/arm/dts/uniphier-proxstream2.dtsi       |  24 +
 configs/uniphier_ld4_sld8_defconfig          |   1 +
 configs/uniphier_pro4_defconfig              |   1 +
 configs/uniphier_pro5_defconfig              |   1 +
 configs/uniphier_pxs2_ld6b_defconfig         |   1 +
 configs/uniphier_sld3_defconfig              |   1 +
 drivers/mmc/Kconfig                          |   6 +
 drivers/mmc/Makefile                         |   1 +
 drivers/mmc/uniphier-sd.c                    | 713 +++++++++++++++++++++++++++
 include/configs/uniphier.h                   |   4 +
 25 files changed, 939 insertions(+)
 create mode 100644 drivers/mmc/uniphier-sd.c
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/3 mmc: uniphier: add driver for UniPhier SD/MMC host controller

Add a driver for the on-chip SD/eMMC host controller used by UniPhier SoC family.

---

 drivers/mmc/Kconfig       |   6 +
 drivers/mmc/Makefile      |   1 +
 drivers/mmc/uniphier-sd.c | 713 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 720 insertions(+)
 create mode 100644 drivers/mmc/uniphier-sd.c
drivers/mmc/Kconfig +6 -0
index 9f4b766..faffefd 100644
@@ -37,4 +37,10 @@ config PIC32_SDHCI
 	help
 	  Support for Microchip PIC32 SDHCI controller.
 
+config MMC_UNIPHIER
+	bool "UniPhier SD/MMC Host Controller support"
+	depends on ARCH_UNIPHIER
+	help
+	  This selects support for the SD/MMC Host Controller on UniPhier SoCs.
+
 endmenu
drivers/mmc/Makefile +1 -0
index c9c3e3e..b85e4bf 100644
@@ -41,6 +41,7 @@ obj-$(CONFIG_SH_SDHI) += sh_sdhi.o
 obj-$(CONFIG_SOCFPGA_DWMMC) += socfpga_dw_mmc.o
 obj-$(CONFIG_SPEAR_SDHCI) += spear_sdhci.o
 obj-$(CONFIG_TEGRA_MMC) += tegra_mmc.o
+obj-$(CONFIG_MMC_UNIPHIER) += uniphier-sd.o
 obj-$(CONFIG_ZYNQ_SDHCI) += zynq_sdhci.o
 
 ifdef CONFIG_SPL_BUILD
drivers/mmc/uniphier-sd.c new file +713 -0

713 lines not on this page · raw message

Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/3 ARM: uniphier: enable UniPhier SD/MMC host driver

In reply to Masahiro Yamada

Enable the driver in all UniPhier defconfig files and add some needed defines to the common files.

---

 arch/arm/Kconfig                     | 1 +
 configs/uniphier_ld4_sld8_defconfig  | 1 +
 configs/uniphier_pro4_defconfig      | 1 +
 configs/uniphier_pro5_defconfig      | 1 +
 configs/uniphier_pxs2_ld6b_defconfig | 1 +
 configs/uniphier_sld3_defconfig      | 1 +
 include/configs/uniphier.h           | 4 ++++
 7 files changed, 10 insertions(+)
arch/arm/Kconfig +1 -0
index d8b63e9..6a8c9ae 100644
@@ -699,6 +699,7 @@ config ARCH_UNIPHIER
 	select SPL_DM
 	select DM_SERIAL
 	select DM_I2C
+	select DM_MMC
 	help
 	  Support for UniPhier SoC family developed by Socionext Inc.
 	  (formerly, System LSI Business Division of Panasonic Corporation)
configs/uniphier_ld4_sld8_defconfig +1 -0
index 535f96f..9bae445 100644
@@ -19,6 +19,7 @@ CONFIG_CMD_TIME=y
 # CONFIG_CMD_MISC is not set
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_SPL_SIMPLE_BUS=y
+CONFIG_MMC_UNIPHIER=y
 CONFIG_NAND_DENALI=y
 CONFIG_SYS_NAND_DENALI_64BIT=y
 CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES=8
configs/uniphier_pro4_defconfig +1 -0
index 2361db6..b6e6ebf 100644
@@ -18,6 +18,7 @@ CONFIG_CMD_TIME=y
 # CONFIG_CMD_MISC is not set
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_SPL_SIMPLE_BUS=y
+CONFIG_MMC_UNIPHIER=y
 CONFIG_NAND_DENALI=y
 CONFIG_SYS_NAND_DENALI_64BIT=y
 CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES=8
configs/uniphier_pro5_defconfig +1 -0
index be0d7b5..5981c87 100644
@@ -18,6 +18,7 @@ CONFIG_CMD_TIME=y
 # CONFIG_CMD_MISC is not set
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_SPL_SIMPLE_BUS=y
+CONFIG_MMC_UNIPHIER=y
 CONFIG_NAND_DENALI=y
 CONFIG_SYS_NAND_DENALI_64BIT=y
 CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES=8
configs/uniphier_pxs2_ld6b_defconfig +1 -0
index f8cb794..dae5a6e 100644
@@ -19,6 +19,7 @@ CONFIG_CMD_TIME=y
 # CONFIG_CMD_MISC is not set
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_SPL_SIMPLE_BUS=y
+CONFIG_MMC_UNIPHIER=y
 CONFIG_NAND_DENALI=y
 CONFIG_SYS_NAND_DENALI_64BIT=y
 CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES=8
configs/uniphier_sld3_defconfig +1 -0
index e369c45..0a4550e 100644
@@ -16,6 +16,7 @@ CONFIG_CMD_PING=y
 CONFIG_CMD_TIME=y
 # CONFIG_CMD_MISC is not set
 CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_MMC_UNIPHIER=y
 CONFIG_NAND_DENALI=y
 CONFIG_SYS_NAND_DENALI_64BIT=y
 CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES=8
include/configs/uniphier.h +4 -0
index 93e1919..e0a8e00 100644
@@ -146,6 +146,10 @@
 #define CONFIG_FAT_WRITE
 #define CONFIG_DOS_PARTITION
 
+/* SD/MMC */
+#define CONFIG_CMD_MMC
+#define CONFIG_GENERIC_MMC
+
 /* memtest works on */
 #define CONFIG_SYS_MEMTEST_START	CONFIG_SYS_SDRAM_BASE
 #define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_SDRAM_BASE + 0x01000000)
Signature · 1 line
1.9.1
#3 lore raw

PATCH 3/3 ARM: dts: uniphier: add SD/MMC host controller nodes

In reply to Masahiro Yamada

This host controller is available for all UniPhier SoCs.

---

 arch/arm/dts/uniphier-ph1-ld4-ref.dts        |  4 +++
 arch/arm/dts/uniphier-ph1-ld4.dtsi           | 25 +++++++++++++++++++
 arch/arm/dts/uniphier-ph1-ld6b-ref.dts       |  4 +++
 arch/arm/dts/uniphier-ph1-pro4-ref.dts       |  8 ++++++
 arch/arm/dts/uniphier-ph1-pro4.dtsi          | 37 ++++++++++++++++++++++++++++
 arch/arm/dts/uniphier-ph1-pro5-4kbox.dts     |  8 ++++++
 arch/arm/dts/uniphier-ph1-pro5.dtsi          | 24 ++++++++++++++++++
 arch/arm/dts/uniphier-ph1-sld3-ref.dts       |  4 +++
 arch/arm/dts/uniphier-ph1-sld3.dtsi          | 19 ++++++++++++++
 arch/arm/dts/uniphier-ph1-sld8-ref.dts       |  4 +++
 arch/arm/dts/uniphier-ph1-sld8.dtsi          | 25 +++++++++++++++++++
 arch/arm/dts/uniphier-pinctrl.dtsi           | 15 +++++++++++
 arch/arm/dts/uniphier-proxstream2-gentil.dts |  4 +++
 arch/arm/dts/uniphier-proxstream2-vodka.dts  |  4 +++
 arch/arm/dts/uniphier-proxstream2.dtsi       | 24 ++++++++++++++++++
 15 files changed, 209 insertions(+)
arch/arm/dts/uniphier-ph1-ld4-ref.dts +4 -0
index 469bd05..3d14239 100644
@@ -51,6 +51,10 @@
 	status = "okay";
 };
 
+&sd {
+	status = "okay";
+};
+
 &usb0 {
 	status = "okay";
 };
arch/arm/dts/uniphier-ph1-ld4.dtsi +25 -0
index 7c8759f..b93a34f 100644
@@ -108,6 +108,31 @@
 		clock-frequency = <100000>;
 	};
 
+	sd: sdhc at 5a400000 {
+		compatible = "socionext,uniphier-sdhc";
+		status = "disabled";
+		reg = <0x5a400000 0x200>;
+		interrupts = <0 76 4>;
+		pinctrl-names = "default", "1.8v";
+		pinctrl-0 = <&pinctrl_sd>;
+		pinctrl-1 = <&pinctrl_sd_1v8>;
+		clocks = <&mio 0>;
+		bus-width = <4>;
+	};
+
+	emmc: sdhc at 5a500000 {
+		compatible = "socionext,uniphier-sdhc";
+		status = "disabled";
+		reg = <0x5a500000 0x200>;
+		interrupts = <0 78 4>;
+		pinctrl-names = "default", "1.8v";
+		pinctrl-0 = <&pinctrl_emmc>;
+		pinctrl-1 = <&pinctrl_emmc_1v8>;
+		clocks = <&mio 1>;
+		bus-width = <8>;
+		non-removable;
+	};
+
 	usb0: usb at 5a800100 {
 		compatible = "socionext,uniphier-ehci", "generic-ehci";
 		status = "disabled";
arch/arm/dts/uniphier-ph1-ld6b-ref.dts +4 -0
index e0a972f..71fe961 100644
@@ -53,6 +53,10 @@
 	status = "okay";
 };
 
+&sd {
+	status = "okay";
+};
+
 &usb0 {
 	status = "okay";
 };
arch/arm/dts/uniphier-ph1-pro4-ref.dts +8 -0
index 02e74a7..70e3a20 100644
@@ -54,6 +54,14 @@
 	status = "okay";
 };
 
+&sd {
+	status = "okay";
+};
+
+&sd1 {
+	status = "okay";
+};
+
 &usb0 {
 	status = "okay";
 };
arch/arm/dts/uniphier-ph1-pro4.dtsi +37 -0
index cb5b8f1..f413549 100644
@@ -140,6 +140,43 @@
 		clock-frequency = <400000>;
 	};
 
+	sd: sdhc at 5a400000 {
+		compatible = "socionext,uniphier-sdhc";
+		status = "disabled";
+		reg = <0x5a400000 0x200>;
+		interrupts = <0 76 4>;
+		pinctrl-names = "default", "1.8v";
+		pinctrl-0 = <&pinctrl_sd>;
+		pinctrl-1 = <&pinctrl_sd_1v8>;
+		clocks = <&mio 0>;
+		bus-width = <4>;
+	};
+
+	emmc: sdhc at 5a500000 {
+		compatible = "socionext,uniphier-sdhc";
+		status = "disabled";
+		reg = <0x5a500000 0x200>;
+		interrupts = <0 78 4>;
+		pinctrl-names = "default", "1.8v";
+		pinctrl-0 = <&pinctrl_emmc>;
+		pinctrl-1 = <&pinctrl_emmc_1v8>;
+		clocks = <&mio 1>;
+		bus-width = <8>;
+		non-removable;
+	};
+
+	sd1: sdhc at 5a600000 {
+		compatible = "socionext,uniphier-sdhc";
+		status = "disabled";
+		reg = <0x5a600000 0x200>;
+		interrupts = <0 85 4>;
+		pinctrl-names = "default", "1.8v";
+		pinctrl-0 = <&pinctrl_sd1>;
+		pinctrl-1 = <&pinctrl_sd1_1v8>;
+		clocks = <&mio 2>;
+		bus-width = <4>;
+	};
+
 	usb2: usb at 5a800100 {
 		compatible = "socionext,uniphier-ehci", "generic-ehci";
 		status = "disabled";
arch/arm/dts/uniphier-ph1-pro5-4kbox.dts +8 -0
index d46e827..721796a 100644
@@ -47,6 +47,14 @@
 	status = "okay";
 };
 
+&emmc {
+	status = "okay";
+};
+
+&sd {
+	status = "okay";
+};
+
 /* for U-boot only */
 / {
 	soc {
arch/arm/dts/uniphier-ph1-pro5.dtsi +24 -0
index 087b25a..56b5f3d 100644
@@ -152,6 +152,30 @@
 		clock-frequency = <400000>;
 	};
 
+	emmc: sdhc at 68400000 {
+		compatible = "socionext,uniphier-sdhc";
+		status = "disabled";
+		reg = <0x68400000 0x800>;
+		interrupts = <0 78 4>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_emmc>;
+		clocks = <&mio 1>;
+		bus-width = <8>;
+		non-removable;
+	};
+
+	sd: sdhc at 68800000 {
+		compatible = "socionext,uniphier-sdhc";
+		status = "disabled";
+		reg = <0x68800000 0x800>;
+		interrupts = <0 76 4>;
+		pinctrl-names = "default", "1.8v";
+		pinctrl-0 = <&pinctrl_sd>;
+		pinctrl-1 = <&pinctrl_sd_1v8>;
+		clocks = <&mio 0>;
+		bus-width = <4>;
+	};
+
 	usb0: usb at 65a00000 {
 		compatible = "socionext,uniphier-xhci", "generic-xhci";
 		status = "disabled";
arch/arm/dts/uniphier-ph1-sld3-ref.dts +4 -0
index 1f3aee9..2d44eba 100644
@@ -52,6 +52,10 @@
 	status = "okay";
 };
 
+&sd {
+	status = "okay";
+};
+
 &usb0 {
 	status = "okay";
 };
arch/arm/dts/uniphier-ph1-sld3.dtsi +19 -0
index 85dde66..d118e17 100644
@@ -186,6 +186,25 @@
 			clocks = <&sysctrl 10>, <&sysctrl 18>;
 		};
 
+		emmc: sdhc at 5a400000 {
+			compatible = "socionext,uniphier-sdhc";
+			status = "disabled";
+			reg = <0x5a400000 0x200>;
+			interrupts = <0 78 4>;
+			clocks = <&mio 1>;
+			bus-width = <8>;
+			non-removable;
+		};
+
+		sd: sdhc at 5a500000 {
+			compatible = "socionext,uniphier-sdhc";
+			status = "disabled";
+			reg = <0x5a500000 0x200>;
+			interrupts = <0 76 4>;
+			clocks = <&mio 0>;
+			bus-width = <4>;
+		};
+
 		usb0: usb at 5a800100 {
 			compatible = "socionext,uniphier-ehci", "generic-ehci";
 			status = "disabled";
arch/arm/dts/uniphier-ph1-sld8-ref.dts +4 -0
index b58bf07..cdaf6eb 100644
@@ -51,6 +51,10 @@
 	status = "okay";
 };
 
+&sd {
+	status = "okay";
+};
+
 &usb0 {
 	status = "okay";
 };
arch/arm/dts/uniphier-ph1-sld8.dtsi +25 -0
index f93db83..159354f 100644
@@ -108,6 +108,31 @@
 		clock-frequency = <100000>;
 	};
 
+	sd: sdhc at 5a400000 {
+		compatible = "socionext,uniphier-sdhc";
+		status = "disabled";
+		reg = <0x5a400000 0x200>;
+		interrupts = <0 76 4>;
+		pinctrl-names = "default", "1.8v";
+		pinctrl-0 = <&pinctrl_sd>;
+		pinctrl-1 = <&pinctrl_sd_1v8>;
+		clocks = <&mio 0>;
+		bus-width = <4>;
+	};
+
+	emmc: sdhc at 5a500000 {
+		compatible = "socionext,uniphier-sdhc";
+		status = "disabled";
+		interrupts = <0 78 4>;
+		reg = <0x5a500000 0x200>;
+		pinctrl-names = "default", "1.8v";
+		pinctrl-0 = <&pinctrl_emmc>;
+		pinctrl-1 = <&pinctrl_emmc_1v8>;
+		clocks = <&mio 1>;
+		bus-width = <8>;
+		non-removable;
+	};
+
 	usb0: usb at 5a800100 {
 		compatible = "socionext,uniphier-ehci", "generic-ehci";
 		status = "disabled";
arch/arm/dts/uniphier-pinctrl.dtsi +15 -0
index b1691d0..494139a 100644
@@ -12,6 +12,11 @@
 		function = "emmc";
 	};
 
+	pinctrl_emmc_1v8: emmc_grp_1v8 {
+		groups = "emmc", "emmc_dat8";
+		function = "emmc";
+	};
+
 	pinctrl_i2c0: i2c0_grp {
 		groups = "i2c0";
 		function = "i2c0";
@@ -37,11 +42,21 @@
 		function = "sd";
 	};
 
+	pinctrl_sd_1v8: sd_grp_1v8 {
+		groups = "sd";
+		function = "sd";
+	};
+
 	pinctrl_sd1: sd1_grp {
 		groups = "sd1";
 		function = "sd1";
 	};
 
+	pinctrl_sd1_1v8: sd1_grp_1v8 {
+		groups = "sd1";
+		function = "sd1";
+	};
+
 	pinctrl_uart0: uart0_grp {
 		groups = "uart0";
 		function = "uart0";
arch/arm/dts/uniphier-proxstream2-gentil.dts +4 -0
index a49215e..4ae16d2 100644
@@ -41,6 +41,10 @@
 	status = "okay";
 };
 
+&emmc {
+	status = "okay";
+};
+
 &usb0 {
 	status = "okay";
 };
arch/arm/dts/uniphier-proxstream2-vodka.dts +4 -0
index 63bd363..e9731aa 100644
@@ -41,6 +41,10 @@
 	status = "okay";
 };
 
+&emmc {
+	status = "okay";
+};
+
 &usb0 {
 	status = "okay";
 };
arch/arm/dts/uniphier-proxstream2.dtsi +24 -0
index a70b135..a01725f 100644
@@ -163,6 +163,30 @@
 		clock-frequency = <400000>;
 	};
 
+	emmc: sdhc at 5a000000 {
+		compatible = "socionext,uniphier-sdhc";
+		status = "disabled";
+		reg = <0x5a000000 0x800>;
+		interrupts = <0 78 4>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_emmc>;
+		clocks = <&mio 1>;
+		bus-width = <8>;
+		non-removable;
+	};
+
+	sd: sdhc at 5a400000 {
+		compatible = "socionext,uniphier-sdhc";
+		status = "disabled";
+		reg = <0x5a400000 0x800>;
+		interrupts = <0 76 4>;
+		pinctrl-names = "default", "1.8v";
+		pinctrl-0 = <&pinctrl_sd>;
+		pinctrl-1 = <&pinctrl_sd_1v8>;
+		clocks = <&mio 0>;
+		bus-width = <4>;
+	};
+
 	usb0: usb at 65a00000 {
 		compatible = "socionext,uniphier-xhci", "generic-xhci";
 		status = "disabled";
Signature · 1 line
1.9.1