Skip to contentSkip to conversation

ARM: socfpga: dts: Add a ciu clock node for sdmmc

PATCH New dinguyen at opensource.altera.com 3 participants 4 messages Apr 10, 2015 – Apr 13, 2015 Device tree bindings

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: socfpga: dts: Add a ciu clock node for sdmmc

From: Dinh Nguyen <[email protected]>

The CIU(Card Interface Unit) clock is used by the dw_mmc IP to clock an SD card. The ciu_clk is the sdmmc_clk passed through a fixed divider of 4. This patch adds the ciu_clk node and makes the sdmmc_clk it's parent.

---
 arch/arm/boot/dts/socfpga.dtsi | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
arch/arm/boot/dts/socfpga.dtsi +9 -1
index d9176e6..25418ee 100644
@@ -451,6 +451,14 @@
 						clk-phase = <0 135>;
 					};
 
+					ciu_clk: ciu_clk {
+						#clock-cells = <0>;
+						compatible = "altr,socfpga-gate-clk";
+						clocks = <&sdmmc_clk>;
+						clk-gate = <0xa0 8>;
+						fixed-divider = <4>;
+					};
+
 					nand_x_clk: nand_x_clk {
 						#clock-cells = <0>;
 						compatible = "altr,socfpga-gate-clk";
@@ -635,7 +643,7 @@
 			fifo-depth = <0x400>;
 			#address-cells = <1>;
 			#size-cells = <0>;
-			clocks = <&l4_mp_clk>, <&sdmmc_clk>;
+			clocks = <&l4_mp_clk>, <&ciu_clk>;
 			clock-names = "biu", "ciu";
 		};
 
Signature · 1 line
2.2.1
#1 lore raw

PATCH 1/1 ARM: socfpga: dts: Add a ciu clock node for sdmmc

Hi!

Quoted 17 lines · dinguyen at opensource.altera.com

From: Dinh Nguyen <[email protected]>

The CIU(Card Interface Unit) clock is used by the dw_mmc IP to clock an SD card. The ciu_clk is the sdmmc_clk passed through a fixed divider of 4. This patch adds the ciu_clk node and makes the sdmmc_clk it's parent.

---
 arch/arm/boot/dts/socfpga.dtsi | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
arch/arm/boot/dts/socfpga.dtsi +0 -0
index d9176e6..25418ee 100644
@@ -451,6 +451,14 @@
 						clk-phase = <0 135>;

arch/arm/boot/dts/socfpga.dtsi line 461

Quoted 10 lines
arch/arm/boot/dts/socfpga.dtsi +8 -0
 					};
 
+					ciu_clk: ciu_clk {
+						#clock-cells = <0>;
+						compatible = "altr,socfpga-gate-clk";
+						clocks = <&sdmmc_clk>;
+						clk-gate = <0xa0 8>;
+						fixed-divider = <4>;
+					};
+

Hm, is this correct? The clk-gate at 0xa0 is for the SDMMC_CLK, no? Also, maybe the clock should be named "sdmmc_clk_divided" like in the datasheet, so it is easier to find.

arch/arm/boot/dts/socfpga.dtsi line 649

Quoted 12 lines
arch/arm/boot/dts/socfpga.dtsi +1 -1
 					nand_x_clk: nand_x_clk {
 						#clock-cells = <0>;
 						compatible = "altr,socfpga-gate-clk";
@@ -635,7 +643,7 @@
 			fifo-depth = <0x400>;
 			#address-cells = <1>;
 			#size-cells = <0>;
-			clocks = <&l4_mp_clk>, <&sdmmc_clk>;
+			clocks = <&l4_mp_clk>, <&ciu_clk>;
 			clock-names = "biu", "ciu";
 		};
 

Regards,
Steffen

Signature · 4 lines
Pengutronix e.K.                           | Steffen Trumtrar            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#2 lore raw

PATCH 1/1 ARM: socfpga: dts: Add a ciu clock node for sdmmc

Hi Steffen,

Quoted 23 lines · Steffen Trumtrar

Hi!

Quoted 19 lines · dinguyen at opensource.altera.com

From: Dinh Nguyen <[email protected]>

The CIU(Card Interface Unit) clock is used by the dw_mmc IP to clock an SD card. The ciu_clk is the sdmmc_clk passed through a fixed divider of 4. This patch adds the ciu_clk node and makes the sdmmc_clk it's parent.

---
 arch/arm/boot/dts/socfpga.dtsi | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
arch/arm/boot/dts/socfpga.dtsi +0 -0
index d9176e6..25418ee 100644
@@ -451,6 +451,14 @@
 						clk-phase = <0 135>;
 					};
 
Quoted 13 lines

arch/arm/boot/dts/socfpga.dtsi line 461

Quoted 8 lines
arch/arm/boot/dts/socfpga.dtsi +8 -0
+					ciu_clk: ciu_clk {
+						#clock-cells = <0>;
+						compatible = "altr,socfpga-gate-clk";
+						clocks = <&sdmmc_clk>;
+						clk-gate = <0xa0 8>;
+						fixed-divider = <4>;
+					};
+

Hm, is this correct? The clk-gate at 0xa0 is for the SDMMC_CLK, no? Also, maybe the clock should be named "sdmmc_clk_divided" like in the datasheet, so it is easier to find.

Well, I didn't want to go down the path of defining a new clock that is just a fork of the sdmmc_clk, so I just defined it as a gate-clock. I think ultimately the gating of the sdmmc_clk is being done.

I can rename it to sdmmc_clk_divided.

Dinh

#3 lore raw

PATCH 1/1 ARM: socfpga: dts: Add a ciu clock node for sdmmc

In reply to dinguyen at opensource.altera.com

Hi,

Quoted 16 lines · On Fri, Apr 10, 2015 at 1:56 PM, <[email protected]> wrote:

From: Dinh Nguyen <[email protected]>

The CIU(Card Interface Unit) clock is used by the dw_mmc IP to clock an SD card. The ciu_clk is the sdmmc_clk passed through a fixed divider of 4. This patch adds the ciu_clk node and makes the sdmmc_clk it's parent.

---
 arch/arm/boot/dts/socfpga.dtsi | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
arch/arm/boot/dts/socfpga.dtsi +0 -0
index d9176e6..25418ee 100644

arch/arm/boot/dts/socfpga.dtsi line 454

Quoted 4 lines
arch/arm/boot/dts/socfpga.dtsi +1 -0
@@ -451,6 +451,14 @@
                                                clk-phase = <0 135>;
                                        };
 
+                                       ciu_clk: ciu_clk {

Can't say I'm an expert on socfpga, but seems like this clock is only for sdmmc, right? ...so its name ought to have sdmmc in its name?

-Doug