Skip to contentSkip to conversation

arm: dts: am43x-clock: add tbclk data for ehrpwm.

PATCH In review Sourav Poddar 3 participants 6 messages Apr 29, 2014 – May 28, 2014

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

PATCH v3 1/1 arm: dts: am43x-clock: add tbclk data for ehrpwm.

We need "tbclk" clock data for the functioning of ehrpwm module. Hence, populating the required clock information in clock dts file.

---
v2->v3
- correct bitshifting

 arch/arm/boot/dts/am43xx-clocks.dtsi |   48 ++++++++++++++++++++++++++++++++++
 drivers/clk/ti/clk-43xx.c            |    6 +++++
 2 files changed, 54 insertions(+)
arch/arm/boot/dts/am43xx-clocks.dtsi +48 -0
index 142009c..42d7b1f 100644
@@ -87,6 +87,54 @@
 		clock-mult = <1>;
 		clock-div = <1>;
 	};
+
+	ehrpwm0_tbclk: ehrpwm0_tbclk {
+		#clock-cells = <0>;
+		compatible = "ti,gate-clock";
+		clocks = <&dpll_per_m2_ck>;
+		ti,bit-shift = <0>;
+		reg = <0x0664>;
+	};
+
+	ehrpwm1_tbclk: ehrpwm1_tbclk {
+		#clock-cells = <0>;
+		compatible = "ti,gate-clock";
+		clocks = <&dpll_per_m2_ck>;
+		ti,bit-shift = <1>;
+		reg = <0x0664>;
+	};
+
+	ehrpwm2_tbclk: ehrpwm2_tbclk {
+		#clock-cells = <0>;
+		compatible = "ti,gate-clock";
+		clocks = <&dpll_per_m2_ck>;
+		ti,bit-shift = <2>;
+		reg = <0x0664>;
+	};
+
+	ehrpwm3_tbclk: ehrpwm3_tbclk {
+		#clock-cells = <0>;
+		compatible = "ti,gate-clock";
+		clocks = <&dpll_per_m2_ck>;
+		ti,bit-shift = <4>;
+		reg = <0x0664>;
+	};
+
+	ehrpwm4_tbclk: ehrpwm4_tbclk {
+		#clock-cells = <0>;
+		compatible = "ti,gate-clock";
+		clocks = <&dpll_per_m2_ck>;
+		ti,bit-shift = <5>;
+		reg = <0x0664>;
+	};
+
+	ehrpwm5_tbclk: ehrpwm5_tbclk {
+		#clock-cells = <0>;
+		compatible = "ti,gate-clock";
+		clocks = <&dpll_per_m2_ck>;
+		ti,bit-shift = <6>;
+		reg = <0x0664>;
+	};
 };
 &prcm_clocks {
 	clk_32768_ck: clk_32768_ck {
drivers/clk/ti/clk-43xx.c +6 -0
index 67c8de5..527a43d 100644
@@ -105,6 +105,12 @@ static struct ti_dt_clk am43xx_clks[] = {
 	DT_CLK(NULL, "func_12m_clk", "func_12m_clk"),
 	DT_CLK(NULL, "vtp_clk_div", "vtp_clk_div"),
 	DT_CLK(NULL, "usbphy_32khz_clkmux", "usbphy_32khz_clkmux"),
+	DT_CLK("48300200.ehrpwm", "tbclk", "ehrpwm0_tbclk"),
+	DT_CLK("48302200.ehrpwm", "tbclk", "ehrpwm1_tbclk"),
+	DT_CLK("48304200.ehrpwm", "tbclk", "ehrpwm2_tbclk"),
+	DT_CLK("48306200.ehrpwm", "tbclk", "ehrpwm3_tbclk"),
+	DT_CLK("48308200.ehrpwm", "tbclk", "ehrpwm4_tbclk"),
+	DT_CLK("4830a200.ehrpwm", "tbclk", "ehrpwm5_tbclk"),
 	{ .node_name = NULL },
 };
 
Signature · 1 line
1.7.9.5
Acked-by on v3 1/1
#1 lore raw
Quoted 5 lines · Sourav Poddar

We need "tbclk" clock data for the functioning of ehrpwm module. Hence, populating the required clock information in clock dts file.

Quoted 85 lines

---
v2->v3
- correct bitshifting

  arch/arm/boot/dts/am43xx-clocks.dtsi |   48 ++++++++++++++++++++++++++++++++++
  drivers/clk/ti/clk-43xx.c            |    6 +++++
  2 files changed, 54 insertions(+)
arch/arm/boot/dts/am43xx-clocks.dtsi +48 -0
index 142009c..42d7b1f 100644
@@ -87,6 +87,54 @@
  		clock-mult = <1>;
  		clock-div = <1>;
  	};
+
+	ehrpwm0_tbclk: ehrpwm0_tbclk {
+		#clock-cells = <0>;
+		compatible = "ti,gate-clock";
+		clocks = <&dpll_per_m2_ck>;
+		ti,bit-shift = <0>;
+		reg = <0x0664>;
+	};
+
+	ehrpwm1_tbclk: ehrpwm1_tbclk {
+		#clock-cells = <0>;
+		compatible = "ti,gate-clock";
+		clocks = <&dpll_per_m2_ck>;
+		ti,bit-shift = <1>;
+		reg = <0x0664>;
+	};
+
+	ehrpwm2_tbclk: ehrpwm2_tbclk {
+		#clock-cells = <0>;
+		compatible = "ti,gate-clock";
+		clocks = <&dpll_per_m2_ck>;
+		ti,bit-shift = <2>;
+		reg = <0x0664>;
+	};
+
+	ehrpwm3_tbclk: ehrpwm3_tbclk {
+		#clock-cells = <0>;
+		compatible = "ti,gate-clock";
+		clocks = <&dpll_per_m2_ck>;
+		ti,bit-shift = <4>;
+		reg = <0x0664>;
+	};
+
+	ehrpwm4_tbclk: ehrpwm4_tbclk {
+		#clock-cells = <0>;
+		compatible = "ti,gate-clock";
+		clocks = <&dpll_per_m2_ck>;
+		ti,bit-shift = <5>;
+		reg = <0x0664>;
+	};
+
+	ehrpwm5_tbclk: ehrpwm5_tbclk {
+		#clock-cells = <0>;
+		compatible = "ti,gate-clock";
+		clocks = <&dpll_per_m2_ck>;
+		ti,bit-shift = <6>;
+		reg = <0x0664>;
+	};
  };
  &prcm_clocks {
  	clk_32768_ck: clk_32768_ck {
drivers/clk/ti/clk-43xx.c +6 -0
index 67c8de5..527a43d 100644
@@ -105,6 +105,12 @@ static struct ti_dt_clk am43xx_clks[] = {
  	DT_CLK(NULL, "func_12m_clk", "func_12m_clk"),
  	DT_CLK(NULL, "vtp_clk_div", "vtp_clk_div"),
  	DT_CLK(NULL, "usbphy_32khz_clkmux", "usbphy_32khz_clkmux"),
+	DT_CLK("48300200.ehrpwm", "tbclk", "ehrpwm0_tbclk"),
+	DT_CLK("48302200.ehrpwm", "tbclk", "ehrpwm1_tbclk"),
+	DT_CLK("48304200.ehrpwm", "tbclk", "ehrpwm2_tbclk"),
+	DT_CLK("48306200.ehrpwm", "tbclk", "ehrpwm3_tbclk"),
+	DT_CLK("48308200.ehrpwm", "tbclk", "ehrpwm4_tbclk"),
+	DT_CLK("4830a200.ehrpwm", "tbclk", "ehrpwm5_tbclk"),
  	{ .node_name = NULL },
  };
 
#2 lore raw

Quoting Tero Kristo (2014-04-29 07:51:14)

Quoted 8 lines · Sourav Poddar
Quoted 5 lines

We need "tbclk" clock data for the functioning of ehrpwm module. Hence, populating the required clock information in clock dts file.

Looks good to me.

Tero, just to be clear, are you planning on batching up OMAPish clock patches and sending a pull request (once they have been reviewed on the list)?

Thanks,
Mike

Quoted 88 lines
Quoted 87 lines

---
v2->v3
- correct bitshifting

  arch/arm/boot/dts/am43xx-clocks.dtsi |   48 ++++++++++++++++++++++++++++++++++
  drivers/clk/ti/clk-43xx.c            |    6 +++++
  2 files changed, 54 insertions(+)
arch/arm/boot/dts/am43xx-clocks.dtsi +48 -0
index 142009c..42d7b1f 100644
@@ -87,6 +87,54 @@
              clock-mult = <1>;
              clock-div = <1>;
      };
+
+     ehrpwm0_tbclk: ehrpwm0_tbclk {
+             #clock-cells = <0>;
+             compatible = "ti,gate-clock";
+             clocks = <&dpll_per_m2_ck>;
+             ti,bit-shift = <0>;
+             reg = <0x0664>;
+     };
+
+     ehrpwm1_tbclk: ehrpwm1_tbclk {
+             #clock-cells = <0>;
+             compatible = "ti,gate-clock";
+             clocks = <&dpll_per_m2_ck>;
+             ti,bit-shift = <1>;
+             reg = <0x0664>;
+     };
+
+     ehrpwm2_tbclk: ehrpwm2_tbclk {
+             #clock-cells = <0>;
+             compatible = "ti,gate-clock";
+             clocks = <&dpll_per_m2_ck>;
+             ti,bit-shift = <2>;
+             reg = <0x0664>;
+     };
+
+     ehrpwm3_tbclk: ehrpwm3_tbclk {
+             #clock-cells = <0>;
+             compatible = "ti,gate-clock";
+             clocks = <&dpll_per_m2_ck>;
+             ti,bit-shift = <4>;
+             reg = <0x0664>;
+     };
+
+     ehrpwm4_tbclk: ehrpwm4_tbclk {
+             #clock-cells = <0>;
+             compatible = "ti,gate-clock";
+             clocks = <&dpll_per_m2_ck>;
+             ti,bit-shift = <5>;
+             reg = <0x0664>;
+     };
+
+     ehrpwm5_tbclk: ehrpwm5_tbclk {
+             #clock-cells = <0>;
+             compatible = "ti,gate-clock";
+             clocks = <&dpll_per_m2_ck>;
+             ti,bit-shift = <6>;
+             reg = <0x0664>;
+     };
  };
  &prcm_clocks {
      clk_32768_ck: clk_32768_ck {
drivers/clk/ti/clk-43xx.c +6 -0
index 67c8de5..527a43d 100644
@@ -105,6 +105,12 @@ static struct ti_dt_clk am43xx_clks[] = {
      DT_CLK(NULL, "func_12m_clk", "func_12m_clk"),
      DT_CLK(NULL, "vtp_clk_div", "vtp_clk_div"),
      DT_CLK(NULL, "usbphy_32khz_clkmux", "usbphy_32khz_clkmux"),
+     DT_CLK("48300200.ehrpwm", "tbclk", "ehrpwm0_tbclk"),
+     DT_CLK("48302200.ehrpwm", "tbclk", "ehrpwm1_tbclk"),
+     DT_CLK("48304200.ehrpwm", "tbclk", "ehrpwm2_tbclk"),
+     DT_CLK("48306200.ehrpwm", "tbclk", "ehrpwm3_tbclk"),
+     DT_CLK("48308200.ehrpwm", "tbclk", "ehrpwm4_tbclk"),
+     DT_CLK("4830a200.ehrpwm", "tbclk", "ehrpwm5_tbclk"),
      { .node_name = NULL },
  };
 
#3 lore raw
Quoted 8 lines · Mike Turquette

Quoting Tero Kristo (2014-04-29 07:51:14)

Quoted 7 lines · Sourav Poddar
Quoted 5 lines

We need "tbclk" clock data for the functioning of ehrpwm module. Hence, populating the required clock information in clock dts file.

Quoted 7 lines
Quoted 1 line

Looks good to me.

Tero, just to be clear, are you planning on batching up OMAPish clock patches and sending a pull request (once they have been reviewed on the list)?

No, I haven't been planning on sending a pull-req, as I believe you still want to ack the TI related clock driver patches yourself also. If you want to change the setup I am of course willing to negotiate the terms. :)

-Tero

Quoted 92 lines

Thanks,
Mike

Quoted 88 lines
Quoted 87 lines

---
v2->v3
- correct bitshifting

   arch/arm/boot/dts/am43xx-clocks.dtsi |   48 ++++++++++++++++++++++++++++++++++
   drivers/clk/ti/clk-43xx.c            |    6 +++++
   2 files changed, 54 insertions(+)
arch/arm/boot/dts/am43xx-clocks.dtsi +48 -0
index 142009c..42d7b1f 100644
@@ -87,6 +87,54 @@
               clock-mult = <1>;
               clock-div = <1>;
       };
+
+     ehrpwm0_tbclk: ehrpwm0_tbclk {
+             #clock-cells = <0>;
+             compatible = "ti,gate-clock";
+             clocks = <&dpll_per_m2_ck>;
+             ti,bit-shift = <0>;
+             reg = <0x0664>;
+     };
+
+     ehrpwm1_tbclk: ehrpwm1_tbclk {
+             #clock-cells = <0>;
+             compatible = "ti,gate-clock";
+             clocks = <&dpll_per_m2_ck>;
+             ti,bit-shift = <1>;
+             reg = <0x0664>;
+     };
+
+     ehrpwm2_tbclk: ehrpwm2_tbclk {
+             #clock-cells = <0>;
+             compatible = "ti,gate-clock";
+             clocks = <&dpll_per_m2_ck>;
+             ti,bit-shift = <2>;
+             reg = <0x0664>;
+     };
+
+     ehrpwm3_tbclk: ehrpwm3_tbclk {
+             #clock-cells = <0>;
+             compatible = "ti,gate-clock";
+             clocks = <&dpll_per_m2_ck>;
+             ti,bit-shift = <4>;
+             reg = <0x0664>;
+     };
+
+     ehrpwm4_tbclk: ehrpwm4_tbclk {
+             #clock-cells = <0>;
+             compatible = "ti,gate-clock";
+             clocks = <&dpll_per_m2_ck>;
+             ti,bit-shift = <5>;
+             reg = <0x0664>;
+     };
+
+     ehrpwm5_tbclk: ehrpwm5_tbclk {
+             #clock-cells = <0>;
+             compatible = "ti,gate-clock";
+             clocks = <&dpll_per_m2_ck>;
+             ti,bit-shift = <6>;
+             reg = <0x0664>;
+     };
   };
   &prcm_clocks {
       clk_32768_ck: clk_32768_ck {
drivers/clk/ti/clk-43xx.c +6 -0
index 67c8de5..527a43d 100644
@@ -105,6 +105,12 @@ static struct ti_dt_clk am43xx_clks[] = {
       DT_CLK(NULL, "func_12m_clk", "func_12m_clk"),
       DT_CLK(NULL, "vtp_clk_div", "vtp_clk_div"),
       DT_CLK(NULL, "usbphy_32khz_clkmux", "usbphy_32khz_clkmux"),
+     DT_CLK("48300200.ehrpwm", "tbclk", "ehrpwm0_tbclk"),
+     DT_CLK("48302200.ehrpwm", "tbclk", "ehrpwm1_tbclk"),
+     DT_CLK("48304200.ehrpwm", "tbclk", "ehrpwm2_tbclk"),
+     DT_CLK("48306200.ehrpwm", "tbclk", "ehrpwm3_tbclk"),
+     DT_CLK("48308200.ehrpwm", "tbclk", "ehrpwm4_tbclk"),
+     DT_CLK("4830a200.ehrpwm", "tbclk", "ehrpwm5_tbclk"),
       { .node_name = NULL },
   };
 
#4 lore raw
Quoted 17 lines · Tero Kristo
Quoted 8 lines · Mike Turquette

Quoting Tero Kristo (2014-04-29 07:51:14)

Quoted 7 lines · Sourav Poddar
Quoted 5 lines

We need "tbclk" clock data for the functioning of ehrpwm module. Hence, populating the required clock information in clock dts file.

Quoted 7 lines
Quoted 1 line

Looks good to me.

Tero, just to be clear, are you planning on batching up OMAPish clock patches and sending a pull request (once they have been reviewed on the list)?

Quoted 6 lines

No, I haven't been planning on sending a pull-req, as I believe you still want to ack the TI related clock driver patches yourself also. If you want to change the setup I am of course willing to negotiate the terms. :)

-Tero

So, based on our discussions, this is now queued for 3.15-rc/clk-dt.

-Tero

Quoted 96 lines
Quoted 95 lines

Thanks,
Mike

Quoted 90 lines
Quoted 89 lines

---
v2->v3
- correct bitshifting

   arch/arm/boot/dts/am43xx-clocks.dtsi |   48
++++++++++++++++++++++++++++++++++
   drivers/clk/ti/clk-43xx.c            |    6 +++++
   2 files changed, 54 insertions(+)
arch/arm/boot/dts/am43xx-clocks.dtsi +48 -0
index 142009c..42d7b1f 100644
@@ -87,6 +87,54 @@
               clock-mult = <1>;
               clock-div = <1>;
       };
+
+     ehrpwm0_tbclk: ehrpwm0_tbclk {
+             #clock-cells = <0>;
+             compatible = "ti,gate-clock";
+             clocks = <&dpll_per_m2_ck>;
+             ti,bit-shift = <0>;
+             reg = <0x0664>;
+     };
+
+     ehrpwm1_tbclk: ehrpwm1_tbclk {
+             #clock-cells = <0>;
+             compatible = "ti,gate-clock";
+             clocks = <&dpll_per_m2_ck>;
+             ti,bit-shift = <1>;
+             reg = <0x0664>;
+     };
+
+     ehrpwm2_tbclk: ehrpwm2_tbclk {
+             #clock-cells = <0>;
+             compatible = "ti,gate-clock";
+             clocks = <&dpll_per_m2_ck>;
+             ti,bit-shift = <2>;
+             reg = <0x0664>;
+     };
+
+     ehrpwm3_tbclk: ehrpwm3_tbclk {
+             #clock-cells = <0>;
+             compatible = "ti,gate-clock";
+             clocks = <&dpll_per_m2_ck>;
+             ti,bit-shift = <4>;
+             reg = <0x0664>;
+     };
+
+     ehrpwm4_tbclk: ehrpwm4_tbclk {
+             #clock-cells = <0>;
+             compatible = "ti,gate-clock";
+             clocks = <&dpll_per_m2_ck>;
+             ti,bit-shift = <5>;
+             reg = <0x0664>;
+     };
+
+     ehrpwm5_tbclk: ehrpwm5_tbclk {
+             #clock-cells = <0>;
+             compatible = "ti,gate-clock";
+             clocks = <&dpll_per_m2_ck>;
+             ti,bit-shift = <6>;
+             reg = <0x0664>;
+     };
   };
   &prcm_clocks {
       clk_32768_ck: clk_32768_ck {
drivers/clk/ti/clk-43xx.c +6 -0
index 67c8de5..527a43d 100644
@@ -105,6 +105,12 @@ static struct ti_dt_clk am43xx_clks[] = {
       DT_CLK(NULL, "func_12m_clk", "func_12m_clk"),
       DT_CLK(NULL, "vtp_clk_div", "vtp_clk_div"),
       DT_CLK(NULL, "usbphy_32khz_clkmux", "usbphy_32khz_clkmux"),
+     DT_CLK("48300200.ehrpwm", "tbclk", "ehrpwm0_tbclk"),
+     DT_CLK("48302200.ehrpwm", "tbclk", "ehrpwm1_tbclk"),
+     DT_CLK("48304200.ehrpwm", "tbclk", "ehrpwm2_tbclk"),
+     DT_CLK("48306200.ehrpwm", "tbclk", "ehrpwm3_tbclk"),
+     DT_CLK("48308200.ehrpwm", "tbclk", "ehrpwm4_tbclk"),
+     DT_CLK("4830a200.ehrpwm", "tbclk", "ehrpwm5_tbclk"),
       { .node_name = NULL },
   };
 
#5 lore raw
Quoted 30 lines · Tero Kristo
Quoted 29 lines · Tero Kristo
Quoted 12 lines · Mike Turquette

Quoting Tero Kristo (2014-04-29 07:51:14)

Quoted 10 lines · Sourav Poddar
Quoted 6 lines

We need "tbclk" clock data for the functioning of ehrpwm module. Hence, populating the required clock information in clock dts file.

Quoted 8 lines
Quoted 1 line

Looks good to me.

Tero, just to be clear, are you planning on batching up OMAPish clock patches and sending a pull request (once they have been reviewed on the list)?

No, I haven't been planning on sending a pull-req, as I believe you still want to ack the TI related clock driver patches yourself also. If you want to change the setup I am of course willing to negotiate the terms. :)

Quoted 4 lines
Quoted 1 line

-Tero

So, based on our discussions, this is now queued for 3.15-rc/clk-dt.

I don't want to cross threads, so we'll work out the details of the for-3.16 stuff in the "Pending clock and hwmod patches" thread.

However, after this next merge window I am happy to move to a pull request-based model for OMAP clock patches, since things should slowly start to settle down.

Regards,
Mike

Quoted 101 lines

-Tero

Quoted 96 lines
Quoted 95 lines

Thanks,
Mike

Quoted 90 lines
Quoted 89 lines

---
v2->v3
- correct bitshifting

   arch/arm/boot/dts/am43xx-clocks.dtsi |   48
++++++++++++++++++++++++++++++++++
   drivers/clk/ti/clk-43xx.c            |    6 +++++
   2 files changed, 54 insertions(+)
arch/arm/boot/dts/am43xx-clocks.dtsi +48 -0
index 142009c..42d7b1f 100644
@@ -87,6 +87,54 @@
               clock-mult = <1>;
               clock-div = <1>;
       };
+
+     ehrpwm0_tbclk: ehrpwm0_tbclk {
+             #clock-cells = <0>;
+             compatible = "ti,gate-clock";
+             clocks = <&dpll_per_m2_ck>;
+             ti,bit-shift = <0>;
+             reg = <0x0664>;
+     };
+
+     ehrpwm1_tbclk: ehrpwm1_tbclk {
+             #clock-cells = <0>;
+             compatible = "ti,gate-clock";
+             clocks = <&dpll_per_m2_ck>;
+             ti,bit-shift = <1>;
+             reg = <0x0664>;
+     };
+
+     ehrpwm2_tbclk: ehrpwm2_tbclk {
+             #clock-cells = <0>;
+             compatible = "ti,gate-clock";
+             clocks = <&dpll_per_m2_ck>;
+             ti,bit-shift = <2>;
+             reg = <0x0664>;
+     };
+
+     ehrpwm3_tbclk: ehrpwm3_tbclk {
+             #clock-cells = <0>;
+             compatible = "ti,gate-clock";
+             clocks = <&dpll_per_m2_ck>;
+             ti,bit-shift = <4>;
+             reg = <0x0664>;
+     };
+
+     ehrpwm4_tbclk: ehrpwm4_tbclk {
+             #clock-cells = <0>;
+             compatible = "ti,gate-clock";
+             clocks = <&dpll_per_m2_ck>;
+             ti,bit-shift = <5>;
+             reg = <0x0664>;
+     };
+
+     ehrpwm5_tbclk: ehrpwm5_tbclk {
+             #clock-cells = <0>;
+             compatible = "ti,gate-clock";
+             clocks = <&dpll_per_m2_ck>;
+             ti,bit-shift = <6>;
+             reg = <0x0664>;
+     };
   };
   &prcm_clocks {
       clk_32768_ck: clk_32768_ck {
drivers/clk/ti/clk-43xx.c +6 -0
index 67c8de5..527a43d 100644
@@ -105,6 +105,12 @@ static struct ti_dt_clk am43xx_clks[] = {
       DT_CLK(NULL, "func_12m_clk", "func_12m_clk"),
       DT_CLK(NULL, "vtp_clk_div", "vtp_clk_div"),
       DT_CLK(NULL, "usbphy_32khz_clkmux", "usbphy_32khz_clkmux"),
+     DT_CLK("48300200.ehrpwm", "tbclk", "ehrpwm0_tbclk"),
+     DT_CLK("48302200.ehrpwm", "tbclk", "ehrpwm1_tbclk"),
+     DT_CLK("48304200.ehrpwm", "tbclk", "ehrpwm2_tbclk"),
+     DT_CLK("48306200.ehrpwm", "tbclk", "ehrpwm3_tbclk"),
+     DT_CLK("48308200.ehrpwm", "tbclk", "ehrpwm4_tbclk"),
+     DT_CLK("4830a200.ehrpwm", "tbclk", "ehrpwm5_tbclk"),
       { .node_name = NULL },
   };