Skip to contentSkip to conversation

DW-MSHC support on Exynos4412-TRATS2 board

PATCH New Tomasz Figa 2 participants 5 messages Dec 12, 2013 – Dec 20, 2013

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

cover DW-MSHC support on Exynos4412-TRATS2 board

This series fixes spotted issues with DW-MSHC support on Exynos4x12 SoCs and then enables DW-MSHC controller to handle eMMC memory on Exynos4412-TRATS2 board. As opposed to using sdhci-s3c for eMMC, MMC 4.4 extensions can be used and in general performance is improved.

Tested on Exynos4412-TRATS2 board.

Tomasz Figa (3):
clk: samsung: exynos4: Fix definition of div_mmc_pre4 divider
ARM: dts: exynos4x12: Fix definition of MSHC device tree nodes
ARM: dts: exynos4412-trats2: Use MSHC controller for eMMC memory

 arch/arm/boot/dts/exynos4412-odroidx.dts |  5 +----
 arch/arm/boot/dts/exynos4412-origen.dts  |  5 +----
 arch/arm/boot/dts/exynos4412-trats2.dts  | 20 ++++++++++++++++----
 arch/arm/boot/dts/exynos4412.dtsi        |  8 --------
 arch/arm/boot/dts/exynos4x12.dtsi        | 13 +++++++++++++
 drivers/clk/samsung/clk-exynos4.c        |  3 ++-
 6 files changed, 33 insertions(+), 21 deletions(-)
Signature · 1 line
1.8.4.3
#1 lore raw

PATCH 1/3 clk: samsung: exynos4: Fix definition of div_mmc_pre4 divider

The clock was missing CLK_SET_RATE_PARENT flag, which caused rate setting failures due to inability of reconfiguration of second divider behind it.

---
 drivers/clk/samsung/clk-exynos4.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/clk/samsung/clk-exynos4.c +2 -1
index ad5ff50..d967571 100644
@@ -530,7 +530,8 @@ static struct samsung_div_clock exynos4_div_clks[] __initdata = {
 	DIV(sclk_i2s1, "sclk_i2s1", "sclk_audio1", DIV_PERIL5, 0, 6),
 	DIV(sclk_i2s2, "sclk_i2s2", "sclk_audio2", DIV_PERIL5, 8, 6),
 	DIV(none, "div_mmc4", "mout_mmc4", DIV_FSYS3, 0, 4),
-	DIV(none, "div_mmc_pre4", "div_mmc4", DIV_FSYS3, 8, 8),
+	DIV_F(none, "div_mmc_pre4", "div_mmc4", DIV_FSYS3, 8, 8,
+			CLK_SET_RATE_PARENT, 0),
 	DIV(none, "div_uart0", "mout_uart0", DIV_PERIL0, 0, 4),
 	DIV(none, "div_uart1", "mout_uart1", DIV_PERIL0, 4, 4),
 	DIV(none, "div_uart2", "mout_uart2", DIV_PERIL0, 8, 4),
Signature · 1 line
1.8.4.3
#2 lore raw

PATCH 2/3 ARM: dts: exynos4x12: Fix definition of MSHC device tree nodes

In reply to Tomasz Figa

All SoCs from Exynos4x12 series contain the MSHC block, so its node can be located in exynos4x12.dtsi. In addition, missing clock specifiers are added, generic SoC attributes are moved from board dts files to common dtsi file of SoC family and the node is renamed to a more generic name to follow node naming recommendations.

---
 arch/arm/boot/dts/exynos4412-odroidx.dts |  5 +----
 arch/arm/boot/dts/exynos4412-origen.dts  |  5 +----
 arch/arm/boot/dts/exynos4412.dtsi        |  8 --------
 arch/arm/boot/dts/exynos4x12.dtsi        | 13 +++++++++++++
 4 files changed, 15 insertions(+), 16 deletions(-)
arch/arm/boot/dts/exynos4412-odroidx.dts +1 -4
index 46c678e..8aad5f7 100644
@@ -38,9 +38,7 @@
 		};
 	};
 
-	mshc at 12550000 {
-		#address-cells = <1>;
-		#size-cells = <0>;
+	mmc at 12550000 {
 		pinctrl-0 = <&sd4_clk &sd4_cmd &sd4_bus4 &sd4_bus8>;
 		pinctrl-names = "default";
 		vmmc-supply = <&ldo20_reg &buck8_reg>;
@@ -49,7 +47,6 @@
 		num-slots = <1>;
 		supports-highspeed;
 		broken-cd;
-		fifo-depth = <0x80>;
 		card-detect-delay = <200>;
 		samsung,dw-mshc-ciu-div = <3>;
 		samsung,dw-mshc-sdr-timing = <2 3>;
arch/arm/boot/dts/exynos4412-origen.dts +1 -4
index d65984c..0fe0161 100644
@@ -122,9 +122,7 @@
 		status = "okay";
 	};
 
-	mshc at 12550000 {
-		#address-cells = <1>;
-		#size-cells = <0>;
+	mmc at 12550000 {
 		pinctrl-0 = <&sd4_clk &sd4_cmd &sd4_bus4 &sd4_bus8>;
 		pinctrl-names = "default";
 		status = "okay";
@@ -132,7 +130,6 @@
 		num-slots = <1>;
 		supports-highspeed;
 		broken-cd;
-		fifo-depth = <0x80>;
 		card-detect-delay = <200>;
 		samsung,dw-mshc-ciu-div = <3>;
 		samsung,dw-mshc-sdr-timing = <2 3>;
arch/arm/boot/dts/exynos4412.dtsi +0 -8
index e743e67..7a0c871 100644
@@ -34,7 +34,6 @@
 			     <0 12 0>, <0 13 0>, <0 14 0>, <0 15 0>,
 			     <0 107 0>, <0 108 0>, <0 48 0>, <0 42 0>;
 	};
-
 	mct at 10050000 {
 		compatible = "samsung,exynos4412-mct";
 		reg = <0x10050000 0x800>;
@@ -61,11 +60,4 @@
 		};
 	};
 
-	mshc at 12550000 {
-		compatible = "samsung,exynos4412-dw-mshc";
-		reg = <0x12550000 0x1000>;
-		interrupts = <0 77 0>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-	};
 };
arch/arm/boot/dts/exynos4x12.dtsi +13 -0
index ad531fe..1917c82 100644
@@ -28,6 +28,7 @@
 		pinctrl3 = &pinctrl_3;
 		fimc-lite0 = &fimc_lite_0;
 		fimc-lite1 = &fimc_lite_1;
+		mshc0 = &mshc_0;
 	};
 
 	pd_isp: isp-power-domain at 10023CA0 {
@@ -176,4 +177,16 @@
 			};
 		};
 	};
+
+	mshc_0: mmc at 12550000 {
+		compatible = "samsung,exynos4412-dw-mshc";
+		reg = <0x12550000 0x1000>;
+		interrupts = <0 77 0>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		fifo-depth = <0x80>;
+		clocks = <&clock 301>, <&clock 149>;
+		clock-names = "biu", "ciu";
+		status = "disabled";
+	};
 };
Signature · 1 line
1.8.4.3
#3 lore raw

PATCH 3/3 ARM: dts: exynos4412-trats2: Use MSHC controller for eMMC memory

In reply to Tomasz Figa

This patch removes device tree node of SDHCI0 controller and replaces it with MSHC to enable support MMC 4.4 and improve performance of eMMC memory.

---
 arch/arm/boot/dts/exynos4412-trats2.dts | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
arch/arm/boot/dts/exynos4412-trats2.dts +16 -4
index fb7b9ae..890ad27 100644
@@ -442,13 +442,25 @@
 		};
 	};
 
-	sdhci at 12510000 {
-		bus-width = <8>;
+	mmc at 12550000 {
+		num-slots = <1>;
+		supports-highspeed;
+		broken-cd;
 		non-removable;
-		pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus8>;
-		pinctrl-names = "default";
+		card-detect-delay = <200>;
 		vmmc-supply = <&vemmc_reg>;
+		clock-frequency = <400000000>;
+		samsung,dw-mshc-ciu-div = <0>;
+		samsung,dw-mshc-sdr-timing = <2 3>;
+		samsung,dw-mshc-ddr-timing = <1 2>;
+		pinctrl-0 = <&sd4_clk &sd4_cmd &sd4_bus4 &sd4_bus8>;
+		pinctrl-names = "default";
 		status = "okay";
+
+		slot at 0 {
+			reg = <0>;
+			bus-width = <8>;
+		};
 	};
 
 	serial at 13800000 {
Signature · 1 line
1.8.4.3
#4 lore raw

cover DW-MSHC support on Exynos4412-TRATS2 board

In reply to Tomasz Figa
Quoted 12 lines · Tomasz Figa

This series fixes spotted issues with DW-MSHC support on Exynos4x12 SoCs and then enables DW-MSHC controller to handle eMMC memory on Exynos4412-TRATS2 board. As opposed to using sdhci-s3c for eMMC, MMC 4.4 extensions can be used and in general performance is improved.

Tested on Exynos4412-TRATS2 board.

Tomasz Figa (3):
clk: samsung: exynos4: Fix definition of div_mmc_pre4 divider
ARM: dts: exynos4x12: Fix definition of MSHC device tree nodes
ARM: dts: exynos4412-trats2: Use MSHC controller for eMMC memory

Quoted 8 lines
  arch/arm/boot/dts/exynos4412-odroidx.dts |  5 +----
  arch/arm/boot/dts/exynos4412-origen.dts  |  5 +----
  arch/arm/boot/dts/exynos4412-trats2.dts  | 20 ++++++++++++++++----
  arch/arm/boot/dts/exynos4412.dtsi        |  8 --------
  arch/arm/boot/dts/exynos4x12.dtsi        | 13 +++++++++++++
  drivers/clk/samsung/clk-exynos4.c        |  3 ++-
  6 files changed, 33 insertions(+), 21 deletions(-)

Looks good to me, applied.

Thanks,
Kukjin