Skip to contentSkip to conversation

ARM: OMAP: clock conversion to DT

PATCH Superseded Tero Kristo 5 participants 102 messages Jul 23, 2013 – Aug 2, 2013 1 message not in the archive Page 2 of 2

Subsystems (8)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#89 lore raw

PATCH v4 30/33 clk: OMAP: DRA7: Add APLL support

In reply to Tero Kristo

From: Keerthy <[email protected]>

The patch adds support for DRA7 PCIe APLL. The APLL sources the optional functional clocks for PCIe module.

APLL stands for Analog PLL. This is different when comapred with DPLL meaning Digital PLL, the phase detection is done using an analog circuit.

---
 arch/arm/mach-omap2/clock.h |    1 -
 drivers/clk/omap/Makefile   |    3 +-
 drivers/clk/omap/apll.c     |  213 +++++++++++++++++++++++++++++++++++++++++++
 drivers/clk/omap/clk.c      |    1 +
 include/linux/clk/omap.h    |    3 +
 5 files changed, 219 insertions(+), 2 deletions(-)
 create mode 100644 drivers/clk/omap/apll.c
arch/arm/mach-omap2/clock.h +0 -1
index 949d293..5f1c7d4 100644
@@ -38,7 +38,6 @@ struct omap_clk {
 	}
 
 struct clockdomain;
-#define to_clk_hw_omap(_hw) container_of(_hw, struct clk_hw_omap, hw)
 
 #define DEFINE_STRUCT_CLK(_name, _parent_array_name, _clkops_name)	\
 	static struct clk _name = {				\
drivers/clk/omap/Makefile +2 -1
index 85b0dc7..6bceb27 100644
@@ -1,3 +1,4 @@
 obj-y					+= clk.o dpll.o autoidle.o gate.o \
 					   clk-44xx.o clk-54xx.o clk-7xx.o \
-					   clk-33xx.o interface.o clk-3xxx.o
+					   clk-33xx.o interface.o clk-3xxx.o \
+					   apll.o
drivers/clk/omap/apll.c new file +213 -0

213 lines not on this page · raw message

drivers/clk/omap/clk.c +1 -0
index 5cbefde..476f6cb 100644
@@ -29,6 +29,7 @@ static const struct of_device_id clk_match[] = {
 	{.compatible = "divider-clock", .data = of_omap_divider_setup, },
 	{.compatible = "gate-clock", .data = of_gate_clk_setup, },
 	{.compatible = "ti,omap4-dpll-clock", .data = of_omap4_dpll_setup, },
+	{.compatible = "ti,dra7-apll-clock", .data = of_dra7_apll_setup, },
 	{.compatible = "ti,gate-clock", .data = of_omap_gate_clk_setup, },
 	{.compatible = "ti,interface-clock",
 		.data = of_omap_interface_clk_setup, },
include/linux/clk/omap.h +3 -0
index 35008d9..0d70cd1 100644
@@ -162,6 +162,8 @@ struct omap_dt_clk {
 		.node_name = name,	\
 	}
 
+#define to_clk_hw_omap(_hw) container_of(_hw, struct clk_hw_omap, hw)
+
 void omap2_init_clk_hw_omap_clocks(struct clk *clk);
 int omap3_noncore_dpll_enable(struct clk_hw *hw);
 void omap3_noncore_dpll_disable(struct clk_hw *hw);
@@ -209,6 +211,7 @@ extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_hsotgusb_wait;
 int dt_omap_clk_init(void);
 extern void omap_dt_clocks_register(struct omap_dt_clk *oclks, int cnt);
 void of_omap4_dpll_setup(struct device_node *node);
+void of_dra7_apll_setup(struct device_node *node);
 void of_omap3_dpll_setup(struct device_node *node);
 void of_omap_fixed_factor_setup(struct device_node *node);
 void of_omap_divider_setup(struct device_node *node);
Signature · 1 line
1.7.9.5
#90 lore raw

PATCH v4 31/33 ARM: dts: clk: Add apll related clocks

In reply to Tero Kristo

From: Keerthy <[email protected]>

The patch adds a mux node to choose the parent of apll_pcie_ck node.

---
 arch/arm/boot/dts/dra7xx-clocks.dtsi |   19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)
arch/arm/boot/dts/dra7xx-clocks.dtsi +15 -4
index 8477ff9..e923311 100644
@@ -328,13 +328,24 @@ dpll_pcie_ref_m2ldo_ck: dpll_pcie_ref_m2ldo_ck at 4a008210 {
 	ti,autoidle-low;
 };
 
+/* APLL_PCIE */
+
+/* mux clock to select the reference clock */
+apll_pcie_in_clk_mux: apll_pcie_in_clk_mux at 4ae06118 {
+	compatible = "mux-clock";
+	clocks = <&dpll_pcie_ref_ck>, <&pciesref_acs_clk_ck>;
+	#clock-cells = <0>;
+	reg = <0x4a00821c 0x4>;
+	bit-mask = <0x80>;
+};
+
 apll_pcie_ck: apll_pcie_ck at 4a008200 {
 	#clock-cells = <0>;
-	compatible = "ti,omap4-dpll-clock";
-	clocks = <&dpll_pcie_ref_ck>;
-	reg = <0x4a008200 0x4>, <0x4a008204 0x4>, <0x4a008208 0x4>, <0x4a00820c 0x4>;
-	ti,clk-ref = <&dpll_pcie_ref_ck>;
+	clocks = <&apll_pcie_in_clk_mux>;
+	reg = <0x4a00821c 0x4>, <0x4a008220 0x4>;
 	ti,clk-bypass = <&dpll_pcie_ref_ck>;
+	ti,clk-ref = <&apll_pcie_in_clk_mux>;
+	compatible = "ti,dra7-apll-clock";
 };
 
 apll_pcie_clkvcoldo: apll_pcie_clkvcoldo {
Signature · 1 line
1.7.9.5
#91 lore raw

PATCH v4 32/33 clk: OMAP: DRA7: Change apll_pcie_m2_ck to fixed factor clock

In reply to Tero Kristo

From: Keerthy <[email protected]>

This patch changes apll_pcie_m2_ck to fixed factor clock as there are no configurable divider associated to m2.

---
 arch/arm/boot/dts/dra7xx-clocks.dtsi |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
arch/arm/boot/dts/dra7xx-clocks.dtsi +3 -6
index e923311..fcc14d4 100644
@@ -366,13 +366,10 @@ apll_pcie_clkvcoldo_div: apll_pcie_clkvcoldo_div {
 
 apll_pcie_m2_ck: apll_pcie_m2_ck at 4a008224 {
 	#clock-cells = <0>;
-	compatible = "divider-clock";
+	compatible = "fixed-factor-clock";
 	clocks = <&apll_pcie_ck>;
-	ti,autoidle-shift = <8>;
-	reg = <0x4a008224 0x4>;
-	bit-mask = <0x7f>;
-	index-starts-at-one;
-	ti,autoidle-low;
+	clock-mult = <1>;
+	clock-div = <1>;
 };
 
 sys_clk1_dclk_div: sys_clk1_dclk_div at 4ae061c8 {
Signature · 1 line
1.7.9.5
#92 lore raw

PATCH v4 33/33 clk: DTS: DRA7: Add PCIe related clock nodes

In reply to Tero Kristo

From: Keerthy <[email protected]>

This patch adds optfclk_pciephy_clk and optfclk_pciephy_div_clk which are used by PCIe phy. It also adds a mux clock to choose the source of optfclk_pciephy_div_clk clock.

---
 arch/arm/boot/dts/dra7xx-clocks.dtsi |   24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
arch/arm/boot/dts/dra7xx-clocks.dtsi +24 -0
index fcc14d4..32b9985 100644
@@ -2087,3 +2087,27 @@ vip3_gclk_mux: vip3_gclk_mux at 4a009030 {
 	reg = <0x4a009030 0x4>;
 	bit-mask = <0x1>;
 };
+
+optfclk_pciephy_div: optfclk_pciephy_div at 4a00821c {
+	compatible = "divider-clock";
+	clocks = <&apll_pcie_ck>;
+	#clock-cells = <0>;
+	reg = <0x4a00821c 0x4>;
+	bit-mask = <0x100>;
+};
+
+optfclk_pciephy_clk: optfclk_pciephy_clk at 4a0093b0 {
+	compatible = "gate-clock";
+	clocks = <&apll_pcie_ck>;
+	#clock-cells = <0>;
+	reg = <0x4a0093b0 0x4>;
+	bit-shift = <9>;
+};
+
+optfclk_pciephy_div_clk: optfclk_pciephy_div_clk at 4a0093b0 {
+	compatible = "gate-clock";
+	clocks = <&optfclk_pciephy_div>;
+	#clock-cells = <0>;
+	reg = <0x4a0093b0 0x4>;
+	bit-shift = <10>;
+};
Signature · 1 line
1.7.9.5
#93 lore raw

v4 cover ARM: OMAP: clock conversion to DT

In reply to Tero Kristo

Hrmph,

Seems like the old devicetree list was terminated yesterday, so if you reply to this you will get some bounces. Sorry about that.

-Tero

Quoted 83 lines · Tero Kristo

Hi,

Changes compared to previous version:

- Clock init files moved from mach-omap2/ to drivers/clk/omap/
- AM33xx support added [patches 15-20]
- OMAP3 support added [patches 21-29]
- DRA7 APLL support added (thanks Keerthy) [patches 30-33]

Test branch on top of 3.11-rc1 available here:

git://gitorious.org/~kristo/omap-pm/omap-pm-work.git
branch: mainline-3.11-rc1-omap-dt-clks

Testing done:

- boot + suspend tested on OMAP3 beagle C4 (omap3530)
- boot + suspend tested on OMAP4 panda ES (omap4460)
- boot tested on beagle bone (am335x)

A boot test was also executed for DRA7 and OMAP5 on a separate branch (mainline does not have OMAP5 / DRA7 support so far.)

TODO:
- Add AM35xx support (OMAP3 derivative, AM35xx only clock nodes missing)

Overall diffstat added just for fun:

  arch/arm/boot/dts/am33xx-clocks.dtsi               |  663 ++++
  arch/arm/boot/dts/am33xx.dtsi                      |    7 +
  arch/arm/boot/dts/dra7xx-clocks.dtsi               | 2113 ++++++++++++
  arch/arm/boot/dts/omap3.dtsi                       |    7 +
  arch/arm/boot/dts/omap3430es1-clocks.dtsi          |  166 +
  arch/arm/boot/dts/omap34xx-omap36xx-clocks.dtsi    |  240 ++
  arch/arm/boot/dts/omap34xx.dtsi                    |    9 +
  .../omap36xx-am35xx-omap3430es2plus-clocks.dtsi    |  214 ++
  arch/arm/boot/dts/omap36xx-clocks.dtsi             |   97 +
  .../boot/dts/omap36xx-omap3430es2plus-clocks.dtsi  |  185 +
  arch/arm/boot/dts/omap36xx.dtsi                    |   10 +
  arch/arm/boot/dts/omap3xxx-clocks.dtsi             | 1594 +++++++++
  arch/arm/boot/dts/omap443x-clocks.dtsi             |   17 +
  arch/arm/boot/dts/omap443x.dtsi                    |    8 +
  arch/arm/boot/dts/omap4460.dtsi                    |    8 +
  arch/arm/boot/dts/omap446x-clocks.dtsi             |   27 +
  arch/arm/boot/dts/omap44xx-clocks.dtsi             | 1654 +++++++++
  arch/arm/boot/dts/omap54xx-clocks.dtsi             | 1416 ++++++++
  arch/arm/mach-omap2/Makefile                       |    5 +-
  arch/arm/mach-omap2/cclock33xx_data.c              | 1059 ------
  arch/arm/mach-omap2/cclock3xxx_data.c              | 3641 --------------------
  arch/arm/mach-omap2/cclock44xx_data.c              | 1730 ----------
  arch/arm/mach-omap2/clock.c                        |    6 +
  arch/arm/mach-omap2/clock.h                        |  163 +-
  arch/arm/mach-omap2/clock3xxx.h                    |    7 +-
  arch/arm/mach-omap2/io.c                           |    7 +-
  arch/arm/mach-omap2/omap_hwmod.c                   |    5 +-
  drivers/clk/Makefile                               |    1 +
  drivers/clk/clk-divider.c                          |    6 +-
  drivers/clk/clk-fixed-factor.c                     |    6 +-
  drivers/clk/clk-gate.c                             |    8 +-
  drivers/clk/clk-mux.c                              |    6 +-
  drivers/clk/clkdev.c                               |   32 +
  drivers/clk/omap/Makefile                          |    4 +
  drivers/clk/omap/apll.c                            |  213 ++
  drivers/clk/omap/autoidle.c                        |  130 +
  drivers/clk/omap/clk-33xx.c                        |   85 +
  drivers/clk/omap/clk-3xxx.c                        |  171 +
  drivers/clk/omap/clk-44xx.c                        |  118 +
  drivers/clk/omap/clk-54xx.c                        |   58 +
  drivers/clk/omap/clk-7xx.c                         |   67 +
  drivers/clk/omap/clk.c                             |   84 +
  drivers/clk/omap/dpll.c                            |  387 +++
  drivers/clk/omap/gate.c                            |  166 +
  drivers/clk/omap/interface.c                       |  110 +
  include/linux/clk/omap.h                           |  223 ++
  46 files changed, 10327 insertions(+), 6606 deletions(-)

-Tero

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

#94 lore raw

v4 cover ARM: OMAP: clock conversion to DT

In reply to Tero Kristo
Quoted 14 lines · Tero Kristo

Hi,

Changes compared to previous version:

- Clock init files moved from mach-omap2/ to drivers/clk/omap/
- AM33xx support added [patches 15-20]
- OMAP3 support added [patches 21-29]
- DRA7 APLL support added (thanks Keerthy) [patches 30-33]

Test branch on top of 3.11-rc1 available here:

git://gitorious.org/~kristo/omap-pm/omap-pm-work.git
branch: mainline-3.11-rc1-omap-dt-clks

Quoted 8 lines

Testing done:

- boot + suspend tested on OMAP3 beagle C4 (omap3530)
- boot + suspend tested on OMAP4 panda ES (omap4460)
- boot tested on beagle bone (am335x)

A boot test was also executed for DRA7 and OMAP5 on a separate branch (mainline does not have OMAP5 / DRA7 support so far.)

Thanks to your hints, I was able to get this to work with 3.11-rc1 on omap5 uevm using the following 3 patches. Please include them in your series. Thanks.

cheers,
-roger
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ARM-dts-OMAP5-Provide-clock-tree-data.patch
Type: text/x-patch
Size: 802 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130724/2dbc50ae/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-CLK-omap5-Call-clock-init-function-at-boot.patch
Type: text/x-patch
Size: 1311 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130724/2dbc50ae/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-CLK-omap5-Initialize-USB_DPLL-at-boot.patch
Type: text/x-patch
Size: 1552 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130724/2dbc50ae/attachment-0005.bin>

#95 lore raw

v4 cover ARM: OMAP: clock conversion to DT

Quoted 21 lines · Roger Quadros
Quoted 20 lines · Tero Kristo

Hi,

Changes compared to previous version:

- Clock init files moved from mach-omap2/ to drivers/clk/omap/
- AM33xx support added [patches 15-20]
- OMAP3 support added [patches 21-29]
- DRA7 APLL support added (thanks Keerthy) [patches 30-33]

Test branch on top of 3.11-rc1 available here:

git://gitorious.org/~kristo/omap-pm/omap-pm-work.git
branch: mainline-3.11-rc1-omap-dt-clks

Testing done:

- boot + suspend tested on OMAP3 beagle C4 (omap3530)
- boot + suspend tested on OMAP4 panda ES (omap4460)
- boot tested on beagle bone (am335x)

Quoted 5 lines
Quoted 2 lines

A boot test was also executed for DRA7 and OMAP5 on a separate branch (mainline does not have OMAP5 / DRA7 support so far.)

Thanks to your hints, I was able to get this to work with 3.11-rc1 on omap5 uevm using the following 3 patches. Please include them in your series. Thanks.

Your patches don't apply cleanly to mainline currently, as the omap5 base support is still not merged. I deliberately left out the full omap5 integration because of that. Lets see how and when the integration proceeds, but I can track your patches meanwhile.

-Tero

#96 lore raw

v4 cover ARM: OMAP: clock conversion to DT

Quoted 22 lines · Tero Kristo
Quoted 21 lines · Roger Quadros
Quoted 20 lines · Tero Kristo

Hi,

Changes compared to previous version:

- Clock init files moved from mach-omap2/ to drivers/clk/omap/
- AM33xx support added [patches 15-20]
- OMAP3 support added [patches 21-29]
- DRA7 APLL support added (thanks Keerthy) [patches 30-33]

Test branch on top of 3.11-rc1 available here:

git://gitorious.org/~kristo/omap-pm/omap-pm-work.git
branch: mainline-3.11-rc1-omap-dt-clks

Testing done:

- boot + suspend tested on OMAP3 beagle C4 (omap3530)
- boot + suspend tested on OMAP4 panda ES (omap4460)
- boot tested on beagle bone (am335x)

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

A boot test was also executed for DRA7 and OMAP5 on a separate branch (mainline does not have OMAP5 / DRA7 support so far.)

Thanks to your hints, I was able to get this to work with 3.11-rc1 on omap5 uevm using the following 3 patches. Please include them in your series. Thanks.

Your patches don't apply cleanly to mainline currently, as the omap5 base support is still not merged. I deliberately left out the full omap5 integration because of that. Lets see how and when the integration proceeds, but I can track your patches meanwhile.

Strange, I didn't use any out of tree patch. Just 3.11-rc1 with your 33 patches on top.

Are you on 3.11-rc2?

cheers,
-roger

#97 lore raw

v4 cover ARM: OMAP: clock conversion to DT

Quoted 29 lines · Roger Quadros
Quoted 28 lines · Tero Kristo
Quoted 26 lines · Roger Quadros
Quoted 14 lines · Tero Kristo

Hi,

Changes compared to previous version:

- Clock init files moved from mach-omap2/ to drivers/clk/omap/
- AM33xx support added [patches 15-20]
- OMAP3 support added [patches 21-29]
- DRA7 APLL support added (thanks Keerthy) [patches 30-33]

Test branch on top of 3.11-rc1 available here:

git://gitorious.org/~kristo/omap-pm/omap-pm-work.git
branch: mainline-3.11-rc1-omap-dt-clks

Quoted 8 lines

Testing done:

- boot + suspend tested on OMAP3 beagle C4 (omap3530)
- boot + suspend tested on OMAP4 panda ES (omap4460)
- boot tested on beagle bone (am335x)

A boot test was also executed for DRA7 and OMAP5 on a separate branch (mainline does not have OMAP5 / DRA7 support so far.)

Thanks to your hints, I was able to get this to work with 3.11-rc1 on omap5 uevm using the following 3 patches. Please include them in your series. Thanks.

Quoted 6 lines
Quoted 2 lines

Your patches don't apply cleanly to mainline currently, as the omap5 base support is still not merged. I deliberately left out the full omap5 integration because of that. Lets see how and when the integration proceeds, but I can track your patches meanwhile.

Strange, I didn't use any out of tree patch. Just 3.11-rc1 with your 33 patches on top.

Are you on 3.11-rc2?

Oh, so OMAP5 hwmod data was actually merged now, cool. Sorry about the fuss. I can include your patches to the next rev if one is made.

-Tero

A message that is not in the archive (sent off-list or not yet received): [email protected]

#99 lore raw

PATCH v4 29/33 CLK: omap: add omap3 clock init file

Quoted 10 lines · Tero Kristo

clk-3xxx.c now contains the clock init functionality for omap3, including DT clock registration and adding of static clkdev entries.

This patch also splits the OMAP3 clock registration code under mach-omap2 to use OMAP3 subtype specific clk init functions.

---
  arch/arm/mach-omap2/Makefile          |    2 +-
  arch/arm/mach-omap2/cclock3xxx_data.c | 3641 ---------------------------------

Tony and a lot of people is not going to like removing support for non-dt boot for OMAP3 before "it's time is due" ;)

Signature · 2 lines
Regards,
Nishanth Menon
maintainer
#100 lore raw

PATCH v4 29/33 CLK: omap: add omap3 clock init file

Quoted 7 lines · Nishanth Menon
Quoted 6 lines · Tero Kristo

clk-3xxx.c now contains the clock init functionality for omap3, including DT clock registration and adding of static clkdev entries.

This patch also splits the OMAP3 clock registration code under mach-omap2 to use OMAP3 subtype specific clk init functions.

Quoted 7 lines
Quoted 4 lines
---
 arch/arm/mach-omap2/Makefile          |    2 +-
 arch/arm/mach-omap2/cclock3xxx_data.c | 3641 ---------------------------------

Tony and a lot of people is not going to like removing support for non-dt boot for OMAP3 before "it's time is due" ;)

I think the only showstopper for that is that we need the pending pinctrl changes merged first to keep off-idle working. So the omap3 legacy code removal probably needs to wait until v3.13 merge window. For omap4 and am33xx we can do it now.

Regards,

Tony

#101 lore raw

PATCH v4 29/33 CLK: omap: add omap3 clock init file

Quoted 16 lines · Tony Lindgren
Quoted 7 lines · Nishanth Menon
Quoted 6 lines · Tero Kristo

clk-3xxx.c now contains the clock init functionality for omap3, including DT clock registration and adding of static clkdev entries.

This patch also splits the OMAP3 clock registration code under mach-omap2 to use OMAP3 subtype specific clk init functions.

Quoted 7 lines
Quoted 4 lines
---
  arch/arm/mach-omap2/Makefile          |    2 +-
  arch/arm/mach-omap2/cclock3xxx_data.c | 3641 ---------------------------------

Tony and a lot of people is not going to like removing support for non-dt boot for OMAP3 before "it's time is due" ;)

Quoted 9 lines

I think the only showstopper for that is that we need the pending pinctrl changes merged first to keep off-idle working. So the omap3 legacy code removal probably needs to wait until v3.13 merge window. For omap4 and am33xx we can do it now.

Regards,

Tony

I'll modify the series in such way that OMAP3 retains the legacy clock data within the kernel for now, and will use either DT or kernel data based on init type. Kernel data can then be removed when time is ripe for it.

-Tero

maintainer
#102 lore raw

PATCH v4 29/33 CLK: omap: add omap3 clock init file

Quoted 11 lines · Tero Kristo
Quoted 9 lines · Tony Lindgren
Quoted 3 lines · Nishanth Menon

Tony and a lot of people is not going to like removing support for non-dt boot for OMAP3 before "it's time is due" ;)

I think the only showstopper for that is that we need the pending pinctrl changes merged first to keep off-idle working. So the omap3 legacy code removal probably needs to wait until v3.13 merge window. For omap4 and am33xx we can do it now.

Quoted 4 lines

I'll modify the series in such way that OMAP3 retains the legacy clock data within the kernel for now, and will use either DT or kernel data based on init type. Kernel data can then be removed when time is ripe for it.

OK thanks sounds good to me.

Regards,

Tony