Skip to contentSkip to conversation

cpufreq: use cpufreq-cpu0 driver for exynos based platforms

PATCH In review Thomas Abraham 4 participants 14 messages May 23, 2014 – May 26, 2014

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

v5 cover cpufreq: use cpufreq-cpu0 driver for exynos based platforms

Changes since v4:
- Various changes in clock code suggested by Tomasz Figa <[email protected]>
- This series depends on mutiple other patches
[a] patch that introduces read-only attribute for clock dividers.
- http://lists.infradead.org/pipermail/linux-arm-kernel/2014-May/259264.html
[b] the series "PM / OPP: move cpufreq specific helpers out of OPP layer"
- https://www.mail-archive.com/[email protected]/msg104610.html
[c] the series "cpufreq: opp: Add device tree based lookup of boost mode frequency"
- http://www.spinics.net/lists/arm-kernel/msg334336.html

Changes since v3:
- Addressed comments from Tomasz Figa <[email protected]>
[http://www.spinics.net/lists/cpufreq/msg09290.html]
- Rebased to v3.15-rc4

Changes since v2:
- Safe operating voltage is not required while switching APLL frequency since the temporary parent's clock is divided down to keep armclk within permissible limits. Thanks to Heiko Stuebner <[email protected]> for suggesting this.
- Rob had suggested to use max frequency for each of the divider clock outputs instead of divider values. But due to certain SoC specific characteristics, the divider values corresponding to the input clock frequency for the CMU_CPU clock blocks have to be used.

Changes since v1:
- Removes Exynos4x12 and Exynos5250 cpufreq driver also.
- Device tree based clock configuration lookup as suggested by Lukasz Majewski and Tomasz Figa.
- safe operating point binding reworked as suggested by Shawn Guo.

The patch series removes the use of Exynos specific cpufreq driver and enables the use of cpufreq-cpu0 driver for Exynos4210, Exynos4x12 and Exynos5250 based platforms. This is being done for few reasons.

(a) The Exynos cpufreq driver reads/writes clock controller registers bypassing the Exynos CCF driver which is sort of problematic.
(b) Removes the need for having clock controller register definitions in the cpufreq driver and also removes the need for statically io-remapping clock controller address space (helps in moving towards multiplatform kernel).

Thomas Abraham (7):
cpufreq: cpufreq-cpu0: allow use of optional boost mode frequencies
clk: samsung: add infrastructure to register cpu clocks
Documentation: devicetree: add cpu clock configuration data binding for Exynos4/5
clk: exynos: use cpu-clock provider type to represent arm clock
ARM: dts: Exynos: add cpu nodes, opp and cpu clock configuration data
ARM: Exynos: switch to using generic cpufreq-cpu0 driver
cpufreq: exynos: remove all exynos specific cpufreq driver support

 .../devicetree/bindings/clock/exynos4-clock.txt    |   37 ++
 .../devicetree/bindings/clock/exynos5250-clock.txt |   36 ++
 .../devicetree/bindings/cpufreq/cpufreq-cpu0.txt   |    2 +
 arch/arm/boot/dts/exynos4210-origen.dts            |    6 +
 arch/arm/boot/dts/exynos4210-trats.dts             |    6 +
 arch/arm/boot/dts/exynos4210-universal_c210.dts    |    6 +
 arch/arm/boot/dts/exynos4210.dtsi                  |   35 ++
 arch/arm/boot/dts/exynos4212.dtsi                  |   18 +
 arch/arm/boot/dts/exynos4412-odroidx.dts           |    6 +
 arch/arm/boot/dts/exynos4412-origen.dts            |    6 +
 arch/arm/boot/dts/exynos4412-trats2.dts            |    6 +
 arch/arm/boot/dts/exynos4412.dtsi                  |   31 ++
 arch/arm/boot/dts/exynos4x12.dtsi                  |   36 ++
 arch/arm/boot/dts/exynos5250-arndale.dts           |    6 +
 arch/arm/boot/dts/exynos5250-cros-common.dtsi      |    6 +
 arch/arm/boot/dts/exynos5250-smdk5250.dts          |    6 +
 arch/arm/boot/dts/exynos5250.dtsi                  |   41 ++
 arch/arm/mach-exynos/exynos.c                      |    4 +-
 drivers/clk/samsung/Makefile                       |    2 +-
 drivers/clk/samsung/clk-cpu.c                      |  448 ++++++++++++++++++++
 drivers/clk/samsung/clk-exynos4.c                  |   25 +-
 drivers/clk/samsung/clk-exynos5250.c               |   16 +-
 drivers/clk/samsung/clk.h                          |    4 +
 drivers/cpufreq/Kconfig                            |    1 +
 drivers/cpufreq/Kconfig.arm                        |   52 ---
 drivers/cpufreq/Makefile                           |    4 -
 drivers/cpufreq/cpufreq-cpu0.c                     |    3 +
 drivers/cpufreq/exynos-cpufreq.c                   |  218 ----------
 drivers/cpufreq/exynos-cpufreq.h                   |   99 -----
 drivers/cpufreq/exynos4210-cpufreq.c               |  157 -------
 drivers/cpufreq/exynos4x12-cpufreq.c               |  208 ---------
 drivers/cpufreq/exynos5250-cpufreq.c               |  183 --------
 include/dt-bindings/clock/exynos5250.h             |    1 +
 33 files changed, 779 insertions(+), 936 deletions(-)
 create mode 100644 drivers/clk/samsung/clk-cpu.c
 delete mode 100644 drivers/cpufreq/exynos-cpufreq.c
 delete mode 100644 drivers/cpufreq/exynos-cpufreq.h
 delete mode 100644 drivers/cpufreq/exynos4210-cpufreq.c
 delete mode 100644 drivers/cpufreq/exynos4x12-cpufreq.c
 delete mode 100644 drivers/cpufreq/exynos5250-cpufreq.c
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v5 1/7 cpufreq: cpufreq-cpu0: allow use of optional boost mode frequencies

From: Thomas Abraham <[email protected]>

Lookup for the optional boost-frequency property in cpu0 node and if available, enable support for boost mode frequencies. The frequencies usable in boost mode are determined while preparing the cpufreq table from the list of operating points available.

Cc Shawn Guo <[email protected]>
Cc Lukasz Majewski <[email protected]>
---
 .../devicetree/bindings/cpufreq/cpufreq-cpu0.txt   |    2 ++
 drivers/cpufreq/Kconfig                            |    1 +
 drivers/cpufreq/cpufreq-cpu0.c                     |    3 +++
 3 files changed, 6 insertions(+)
Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt +2 -0
index f055515..60f321a 100644
@@ -19,6 +19,8 @@ Optional properties:
 - cooling-min-level:
 - cooling-max-level:
      Please refer to Documentation/devicetree/bindings/thermal/thermal.txt.
+- boost-frequency:
+     Please refer to Documentation/devicetree/bindings/cpufreq/cpufreq-boost.txt
 
 Examples:
 
drivers/cpufreq/Kconfig +1 -0
index 1fbe11f..52741b9 100644
@@ -187,6 +187,7 @@ config GENERIC_CPUFREQ_CPU0
 	tristate "Generic CPU0 cpufreq driver"
 	depends on HAVE_CLK && REGULATOR && OF && THERMAL && CPU_THERMAL
 	select PM_OPP
+	select CPU_FREQ_BOOST_SW
 	help
 	  This adds a generic cpufreq driver for CPU0 frequency management.
 	  It supports both uniprocessor (UP) and symmetric multiprocessor (SMP)
drivers/cpufreq/cpufreq-cpu0.c +3 -0
index 1bf6bba..93d3d6d 100644
@@ -194,6 +194,9 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev)
 			transition_latency += ret * 1000;
 	}
 
+	if (of_find_property(cpu_dev->of_node, "boost-frequencies", NULL))
+		cpu0_cpufreq_driver.boost_supported = true;
+
 	ret = cpufreq_register_driver(&cpu0_cpufreq_driver);
 	if (ret) {
 		pr_err("failed register driver: %d\n", ret);
Signature · 1 line
1.7.9.5
maintainer
#2 lore raw

Re: [PATCH v5 1/7] cpufreq: cpufreq-cpu0: allow use of optional boost mode frequencies

Quoted 34 lines · Thomas Abraham

From: Thomas Abraham <[email protected]>

Lookup for the optional boost-frequency property in cpu0 node and if available, enable support for boost mode frequencies. The frequencies usable in boost mode are determined while preparing the cpufreq table from the list of operating points available.

Cc Shawn Guo <[email protected]>
Cc Lukasz Majewski <[email protected]>
---
 .../devicetree/bindings/cpufreq/cpufreq-cpu0.txt   |    2 ++
 drivers/cpufreq/Kconfig                            |    1 +
 drivers/cpufreq/cpufreq-cpu0.c                     |    3 +++
 3 files changed, 6 insertions(+)
Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt +2 -0
index f055515..60f321a 100644
@@ -19,6 +19,8 @@ Optional properties:
 - cooling-min-level:
 - cooling-max-level:
      Please refer to Documentation/devicetree/bindings/thermal/thermal.txt.
+- boost-frequency:
+     Please refer to Documentation/devicetree/bindings/cpufreq/cpufreq-boost.txt
 
 Examples:
 
drivers/cpufreq/Kconfig +0 -0
index 1fbe11f..52741b9 100644

drivers/cpufreq/Kconfig config GENERIC_CPUFREQ_CPU0 · line 190

Quoted 4 lines
drivers/cpufreq/Kconfig +1 -0
@@ -187,6 +187,7 @@ config GENERIC_CPUFREQ_CPU0
        tristate "Generic CPU0 cpufreq driver"
        depends on HAVE_CLK && REGULATOR && OF && THERMAL && CPU_THERMAL
        select PM_OPP
+       select CPU_FREQ_BOOST_SW

Drop this. Select it from your platform driver if you want.

Quoted 20 lines
drivers/cpufreq/Kconfig +0 -0
        help
          This adds a generic cpufreq driver for CPU0 frequency management.
          It supports both uniprocessor (UP) and symmetric multiprocessor (SMP)
drivers/cpufreq/cpufreq-cpu0.c +3 -1
index 1bf6bba..93d3d6d 100644
@@ -194,6 +194,9 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev)
                        transition_latency += ret * 1000;
        }
 
+       if (of_find_property(cpu_dev->of_node, "boost-frequencies", NULL))
+               cpu0_cpufreq_driver.boost_supported = true;
+
        ret = cpufreq_register_driver(&cpu0_cpufreq_driver);
        if (ret) {
                pr_err("failed register driver: %d\n", ret);
--

1.7.9.5

#3 lore raw

PATCH v5 2/7 clk: samsung: add infrastructure to register cpu clocks

In reply to Thomas Abraham

From: Thomas Abraham <[email protected]>

The CPU clock provider supplies the clock to the CPU clock domain. The composition and organization of the CPU clock provider could vary among Exynos SoCs. A CPU clock provider can be composed of clock mux, dividers and gates. This patch defines a new clock type for CPU clock provider and adds infrastructure to register the CPU clock providers for Samsung platforms.

---
 drivers/clk/samsung/Makefile  |    2 +-
 drivers/clk/samsung/clk-cpu.c |  448 +++++++++++++++++++++++++++++++++++++++++
 drivers/clk/samsung/clk.h     |    4 +
 3 files changed, 453 insertions(+), 1 deletion(-)
 create mode 100644 drivers/clk/samsung/clk-cpu.c
drivers/clk/samsung/Makefile +1 -1
index 25646c6..83620a1 100644
@@ -2,7 +2,7 @@
 # Samsung Clock specific Makefile
 #
 
-obj-$(CONFIG_COMMON_CLK)	+= clk.o clk-pll.o
+obj-$(CONFIG_COMMON_CLK)	+= clk.o clk-pll.o clk-cpu.o
 obj-$(CONFIG_SOC_EXYNOS3250)	+= clk-exynos3250.o
 obj-$(CONFIG_ARCH_EXYNOS4)	+= clk-exynos4.o
 obj-$(CONFIG_SOC_EXYNOS5250)	+= clk-exynos5250.o
drivers/clk/samsung/clk-cpu.c new file +448 -0

448 lines not on this page · raw message

drivers/clk/samsung/clk.h +4 -0
index 9693b80..43da899 100644
@@ -372,4 +372,8 @@ extern struct samsung_clk_reg_dump *samsung_clk_alloc_reg_dump(
 			const unsigned long *rdump,
 			unsigned long nr_rdump);
 
+extern int __init exynos_register_arm_clock(struct samsung_clk_provider *ctx,
+		unsigned int lookup_id,	const char *parent,
+		const char *alt_parent, struct device_node *np);
+
 #endif /* __SAMSUNG_CLK_H */
Signature · 1 line
1.7.9.5
#4 lore raw

PATCH v5 3/7 Documentation: devicetree: add cpu clock configuration data binding for Exynos4/5

In reply to Thomas Abraham

From: Thomas Abraham <[email protected]>

The clock blocks within the CMU_CPU clock domain are put together into a new composite clock type called the cpu clock. This clock type requires configuration data that will be atomically programmed in the multiple clock blocks encapsulated within the cpu clock type when the parent clock frequency is changed. This configuration data is held in the clock controller node. Update clock binding documentation about this configuration data format for Samsung Exynos4 and Exynos5 platforms.

Cc Tomasz Figa <[email protected]>
Cc Rob Herring <[email protected]>
Cc Pawel Moll <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Ian Campbell <[email protected]>
Cc Kumar Gala <[email protected]>
---
 .../devicetree/bindings/clock/exynos4-clock.txt    |   37 ++++++++++++++++++++
 .../devicetree/bindings/clock/exynos5250-clock.txt |   36 +++++++++++++++++++
 2 files changed, 73 insertions(+)
Documentation/devicetree/bindings/clock/exynos4-clock.txt +37 -0
index f5a5b19..0934e02 100644
@@ -15,6 +15,35 @@ Required Properties:
 
 - #clock-cells: should be 1.
 
+- samsung,armclk-divider-table: when the frequency of the APLL is changed
+  the divider clocks in CMU_CPU clock domain also need to be updated. These
+  divider clocks have SoC specific divider clock output requirements for a
+  specific APLL clock speeds. When APLL clock rate is changed, these divider
+  clocks are reprogrammed with pre-determined values in order to maintain the
+  SoC specific divider clock outputs. This property lists the divider values
+  for divider clocks in the CMU_CPU block for supported APLL clock speeds.
+  The format of each entry included in the arm-frequency-table should be
+  as defined below
+
+  - for Exynos4210 and Exynos4212 based platforms:
+      cell #1: arm clock parent frequency
+      cell #2 ~ cell 9#: value of clock divider in the following order
+	        corem0_ratio, corem1_ratio, periph_ratio, atb_ratio,
+		pclk_dbg_ratio, apll_ratio, copy_ratio, hpm_ratio.
+
+  - for Exynos4412 based platforms:
+      cell #1: expected arm clock parent frequency
+      cell #2 ~ cell #10: value of clock divider in the following order
+	       corem0_ratio, corem1_ratio, periph_ratio, atb_ratio,
+               pclk_dbg_ratio, apll_ratio, copy_ratio, hpm_ratio, cores_ratio
+
+- samsung,armclk-cells: defines the number of cells in
+  samsung,armclk-divider-table property. The value of this property depends on
+  the SoC type.
+
+  - for Exynos4210 and Exynos4212: the value should be 9.
+  - for Exynos4412: the value should be 10.
+
 Each clock is assigned an identifier and client nodes can use this identifier
 to specify the clock which they consume.
 
@@ -28,6 +57,14 @@ Example 1: An example of a clock controller node is listed below.
 		compatible = "samsung,exynos4210-clock";
 		reg = <0x10030000 0x20000>;
 		#clock-cells = <1>;
+
+		samsung,armclk-cells = <9>;
+		samsung,armclk-divider-table = <1200000 3 7 3 4 1 7 5 0>,
+					       <1000000 3 7 3 4 1 7 4 0>,
+					       < 800000 3 7 3 3 1 7 3 0>,
+					       < 500000 3 7 3 3 1 7 3 0>,
+					       < 400000 3 7 3 3 1 7 3 0>,
+					       < 200000 1 3 1 1 1 0 3 0>;
 	};
 
 Example 2: UART controller node that consumes the clock generated by the clock
Documentation/devicetree/bindings/clock/exynos5250-clock.txt +36 -0
index 536eacd..3d63d09 100644
@@ -13,6 +13,24 @@ Required Properties:
 
 - #clock-cells: should be 1.
 
+- samsung,armclk-divider-table: when the frequency of the APLL is changed
+  the divider clocks in CMU_CPU clock domain also need to be updated. These
+  divider clocks have SoC specific divider clock output requirements for a
+  specific APLL clock speeds. When APLL clock rate is changed, these divider
+  clocks are reprogrammed with pre-determined values in order to maintain the
+  SoC specific divider clock outputs. This property lists the divider values
+  for divider clocks in the CMU_CPU block for supported APLL clock speeds.
+  The format of each entry included in the arm-frequency-table should be
+  as defined below
+
+      cell #1: expected arm clock parent frequency
+      cell #2 ~ cell #9: value of clock divider in the following order
+	       cpud_ratio, acp_ratio, periph_ratio, atb_ratio,
+               pclk_dbg_ratio, apll_ratio, copy_ratio, hpm_ratio
+
+- samsung,armclk-cells: defines the number of cells in
+  samsung,armclk-divider-table property. The value of this property should be 9.
+
 Each clock is assigned an identifier and client nodes can use this identifier
 to specify the clock which they consume.
 
@@ -26,6 +44,24 @@ Example 1: An example of a clock controller node is listed below.
 		compatible = "samsung,exynos5250-clock";
 		reg = <0x10010000 0x30000>;
 		#clock-cells = <1>;
+
+		samsung,armclk-cells = <9>;
+		samsung,armclk-divider-table = <1700000 3 7 7 7 3 5 0 2>,
+					       <1600000 3 7 7 7 1 4 0 2>,
+					       <1500000 2 7 7 7 1 4 0 2>,
+					       <1400000 2 7 7 6 1 4 0 2>,
+					       <1300000 2 7 7 6 1 3 0 2>,
+					       <1200000 2 7 7 5 1 3 0 2>,
+					       <1100000 3 7 7 5 1 3 0 2>,
+					       <1000000 1 7 7 4 1 2 0 2>,
+					       < 900000 1 7 7 4 1 2 0 2>,
+					       < 800000 1 7 7 4 1 2 0 2>,
+					       < 700000 1 7 7 3 1 1 0 2>,
+					       < 600000 1 7 7 3 1 1 0 2>,
+					       < 500000 1 7 7 2 1 1 0 2>,
+					       < 400000 1 7 7 2 1 1 0 2>,
+					       < 300000 1 7 7 1 1 1 0 2>,
+					       < 200000 1 7 7 1 1 1 0 2>;
 	};
 
 Example 2: UART controller node that consumes the clock generated by the clock
Signature · 1 line
1.7.9.5
#5 lore raw

PATCH v5 4/7 clk: exynos: use cpu-clock provider type to represent arm clock

In reply to Thomas Abraham

From: Thomas Abraham <[email protected]>

With the addition of the new Samsung specific cpu-clock type, the arm clock can be represented as a cpu-clock type and the independent clock blocks that made up the arm clock can be removed.

---
 drivers/clk/samsung/clk-exynos4.c      |   25 +++++++++++++++++--------
 drivers/clk/samsung/clk-exynos5250.c   |   16 +++++++++++-----
 include/dt-bindings/clock/exynos5250.h |    1 +
 3 files changed, 29 insertions(+), 13 deletions(-)
drivers/clk/samsung/clk-exynos4.c +17 -8
index c4df294..fd235e4 100644
@@ -471,7 +471,8 @@ static struct samsung_mux_clock exynos4210_mux_clks[] __initdata = {
 	MUX(0, "mout_fimd1", group1_p4210, E4210_SRC_LCD1, 0, 4),
 	MUX(0, "mout_mipi1", group1_p4210, E4210_SRC_LCD1, 12, 4),
 	MUX(CLK_SCLK_MPLL, "sclk_mpll", mout_mpll_p, SRC_CPU, 8, 1),
-	MUX(CLK_MOUT_CORE, "mout_core", mout_core_p4210, SRC_CPU, 16, 1),
+	MUX_F(CLK_MOUT_CORE, "mout_core", mout_core_p4210, SRC_CPU, 16, 1, 0,
+			CLK_MUX_READ_ONLY),
 	MUX(CLK_SCLK_VPLL, "sclk_vpll", sclk_vpll_p4210, SRC_TOP0, 8, 1),
 	MUX(CLK_MOUT_FIMC0, "mout_fimc0", group1_p4210, SRC_CAM, 0, 4),
 	MUX(CLK_MOUT_FIMC1, "mout_fimc1", group1_p4210, SRC_CAM, 4, 4),
@@ -530,7 +531,8 @@ static struct samsung_mux_clock exynos4x12_mux_clks[] __initdata = {
 	MUX(0, "mout_jpeg", mout_jpeg_p, E4X12_SRC_CAM1, 8, 1),
 	MUX(CLK_SCLK_MPLL, "sclk_mpll", mout_mpll_p, SRC_DMC, 12, 1),
 	MUX(CLK_SCLK_VPLL, "sclk_vpll", mout_vpll_p, SRC_TOP0, 8, 1),
-	MUX(CLK_MOUT_CORE, "mout_core", mout_core_p4x12, SRC_CPU, 16, 1),
+	MUX_F(CLK_MOUT_CORE, "mout_core", mout_core_p4x12, SRC_CPU, 16, 1, 0,
+			CLK_MUX_READ_ONLY),
 	MUX(CLK_MOUT_FIMC0, "mout_fimc0", group1_p4x12, SRC_CAM, 0, 4),
 	MUX(CLK_MOUT_FIMC1, "mout_fimc1", group1_p4x12, SRC_CAM, 4, 4),
 	MUX(CLK_MOUT_FIMC2, "mout_fimc2", group1_p4x12, SRC_CAM, 8, 4),
@@ -572,8 +574,10 @@ static struct samsung_mux_clock exynos4x12_mux_clks[] __initdata = {
 
 /* list of divider clocks supported in all exynos4 soc's */
 static struct samsung_div_clock exynos4_div_clks[] __initdata = {
-	DIV(0, "div_core", "mout_core", DIV_CPU0, 0, 3),
-	DIV(0, "div_core2", "div_core", DIV_CPU0, 28, 3),
+	DIV_F(0, "div_core", "mout_core", DIV_CPU0, 0, 3,
+			CLK_GET_RATE_NOCACHE, CLK_DIVIDER_READ_ONLY),
+	DIV_F(0, "div_core2", "div_core", DIV_CPU0, 28, 3,
+			CLK_GET_RATE_NOCACHE, CLK_DIVIDER_READ_ONLY),
 	DIV(0, "div_fimc0", "mout_fimc0", DIV_CAM, 0, 4),
 	DIV(0, "div_fimc1", "mout_fimc1", DIV_CAM, 4, 4),
 	DIV(0, "div_fimc2", "mout_fimc2", DIV_CAM, 8, 4),
@@ -619,8 +623,10 @@ static struct samsung_div_clock exynos4_div_clks[] __initdata = {
 	DIV(0, "div_spi_pre2", "div_spi2", DIV_PERIL2, 8, 8),
 	DIV(0, "div_audio1", "mout_audio1", DIV_PERIL4, 0, 4),
 	DIV(0, "div_audio2", "mout_audio2", DIV_PERIL4, 16, 4),
-	DIV(CLK_ARM_CLK, "arm_clk", "div_core2", DIV_CPU0, 28, 3),
-	DIV(CLK_SCLK_APLL, "sclk_apll", "mout_apll", DIV_CPU0, 24, 3),
+	DIV_F(CLK_ARM_CLK, "arm_clk", "div_core2", DIV_CPU0, 28, 3,
+			CLK_GET_RATE_NOCACHE, CLK_DIVIDER_READ_ONLY),
+	DIV_F(CLK_SCLK_APLL, "sclk_apll", "mout_apll", DIV_CPU0, 24, 3,
+			CLK_GET_RATE_NOCACHE, CLK_DIVIDER_READ_ONLY),
 	DIV_F(0, "div_mipi_pre0", "div_mipi0", DIV_LCD0, 20, 4,
 			CLK_SET_RATE_PARENT, 0),
 	DIV_F(0, "div_mmc_pre0", "div_mmc0", DIV_FSYS1, 8, 8,
@@ -1005,7 +1011,6 @@ static struct samsung_gate_clock exynos4x12_gate_clks[] __initdata = {
 
 static struct samsung_clock_alias exynos4_aliases[] __initdata = {
 	ALIAS(CLK_MOUT_CORE, NULL, "moutcore"),
-	ALIAS(CLK_ARM_CLK, NULL, "armclk"),
 	ALIAS(CLK_SCLK_APLL, NULL, "mout_apll"),
 };
 
@@ -1244,6 +1249,8 @@ static void __init exynos4_clk_init(struct device_node *np,
 			ARRAY_SIZE(exynos4210_gate_clks));
 		samsung_clk_register_alias(ctx, exynos4210_aliases,
 			ARRAY_SIZE(exynos4210_aliases));
+		exynos_register_arm_clock(ctx, CLK_ARM_CLK, mout_core_p4210[0],
+			mout_core_p4210[1], np);
 	} else {
 		samsung_clk_register_mux(ctx, exynos4x12_mux_clks,
 			ARRAY_SIZE(exynos4x12_mux_clks));
@@ -1253,6 +1260,8 @@ static void __init exynos4_clk_init(struct device_node *np,
 			ARRAY_SIZE(exynos4x12_gate_clks));
 		samsung_clk_register_alias(ctx, exynos4x12_aliases,
 			ARRAY_SIZE(exynos4x12_aliases));
+		exynos_register_arm_clock(ctx, CLK_ARM_CLK, mout_core_p4x12[0],
+			mout_core_p4x12[1], np);
 	}
 
 	samsung_clk_register_alias(ctx, exynos4_aliases,
@@ -1265,7 +1274,7 @@ static void __init exynos4_clk_init(struct device_node *np,
 		exynos4_soc == EXYNOS4210 ? "Exynos4210" : "Exynos4x12",
 		_get_rate("sclk_apll"),	_get_rate("sclk_mpll"),
 		_get_rate("sclk_epll"), _get_rate("sclk_vpll"),
-		_get_rate("arm_clk"));
+		_get_rate("armclk"));
 }
 
 
drivers/clk/samsung/clk-exynos5250.c +11 -5
index 1fad4c5..6e91b97 100644
@@ -292,7 +292,8 @@ static struct samsung_mux_clock exynos5250_mux_clks[] __initdata = {
 	 */
 	MUX_FA(0, "mout_apll", mout_apll_p, SRC_CPU, 0, 1,
 					CLK_SET_RATE_PARENT, 0, "mout_apll"),
-	MUX_A(0, "mout_cpu", mout_cpu_p, SRC_CPU, 16, 1, "mout_cpu"),
+	MUX_FA(0, "mout_cpu", mout_cpu_p, SRC_CPU, 16, 1,
+			0, CLK_MUX_READ_ONLY, "mout_cpu"),
 
 	/*
 	 * CMU_CORE
@@ -379,9 +380,12 @@ static struct samsung_div_clock exynos5250_div_clks[] __initdata = {
 	/*
 	 * CMU_CPU
 	 */
-	DIV(0, "div_arm", "mout_cpu", DIV_CPU0, 0, 3),
-	DIV(0, "div_apll", "mout_apll", DIV_CPU0, 24, 3),
-	DIV_A(0, "div_arm2", "div_arm", DIV_CPU0, 28, 3, "armclk"),
+	DIV_F(0, "div_arm", "mout_cpu", DIV_CPU0, 0, 3,
+			CLK_GET_RATE_NOCACHE, CLK_DIVIDER_READ_ONLY),
+	DIV_F(0, "div_apll", "mout_apll", DIV_CPU0, 24, 3,
+			CLK_GET_RATE_NOCACHE, CLK_DIVIDER_READ_ONLY),
+	DIV_F(0, "div_arm2", "div_arm", DIV_CPU0, 28, 3,
+			CLK_GET_RATE_NOCACHE, CLK_DIVIDER_READ_ONLY),
 
 	/*
 	 * CMU_TOP
@@ -797,6 +801,8 @@ static void __init exynos5250_clk_init(struct device_node *np)
 			ARRAY_SIZE(exynos5250_div_clks));
 	samsung_clk_register_gate(ctx, exynos5250_gate_clks,
 			ARRAY_SIZE(exynos5250_gate_clks));
+	exynos_register_arm_clock(ctx, CLK_ARM_CLK, mout_cpu_p[0],
+			mout_cpu_p[1], np);
 
 	/*
 	 * Enable arm clock down (in idle) and set arm divider
@@ -821,6 +827,6 @@ static void __init exynos5250_clk_init(struct device_node *np)
 	exynos5250_clk_sleep_init();
 
 	pr_info("Exynos5250: clock setup completed, armclk=%ld\n",
-			_get_rate("div_arm2"));
+			_get_rate("armclk"));
 }
 CLK_OF_DECLARE(exynos5250_clk, "samsung,exynos5250-clock", exynos5250_clk_init);
include/dt-bindings/clock/exynos5250.h +1 -0
index be6e97c..d3565be 100644
@@ -21,6 +21,7 @@
 #define CLK_FOUT_CPLL		6
 #define CLK_FOUT_EPLL		7
 #define CLK_FOUT_VPLL		8
+#define CLK_ARM_CLK		12
 
 /* gate for special clocks (sclk) */
 #define CLK_SCLK_CAM_BAYER	128
Signature · 1 line
1.7.9.5
#6 lore raw

PATCH v5 5/7 ARM: dts: Exynos: add cpu nodes, opp and cpu clock configuration data

In reply to Thomas Abraham

From: Thomas Abraham <[email protected]>

For all Exynos based platforms, add CPU nodes, operating points and cpu clock data for migrating from Exynos specific cpufreq driver to using generic cpufreq-cpu0 driver.

---
 arch/arm/boot/dts/exynos4210-origen.dts         |    6 ++++
 arch/arm/boot/dts/exynos4210-trats.dts          |    6 ++++
 arch/arm/boot/dts/exynos4210-universal_c210.dts |    6 ++++
 arch/arm/boot/dts/exynos4210.dtsi               |   35 +++++++++++++++++++
 arch/arm/boot/dts/exynos4212.dtsi               |   18 ++++++++++
 arch/arm/boot/dts/exynos4412-odroidx.dts        |    6 ++++
 arch/arm/boot/dts/exynos4412-origen.dts         |    6 ++++
 arch/arm/boot/dts/exynos4412-trats2.dts         |    6 ++++
 arch/arm/boot/dts/exynos4412.dtsi               |   31 +++++++++++++++++
 arch/arm/boot/dts/exynos4x12.dtsi               |   36 ++++++++++++++++++++
 arch/arm/boot/dts/exynos5250-arndale.dts        |    6 ++++
 arch/arm/boot/dts/exynos5250-cros-common.dtsi   |    6 ++++
 arch/arm/boot/dts/exynos5250-smdk5250.dts       |    6 ++++
 arch/arm/boot/dts/exynos5250.dtsi               |   41 +++++++++++++++++++++++
 14 files changed, 215 insertions(+)
arch/arm/boot/dts/exynos4210-origen.dts +6 -0
index 72fb11f..4324b25 100644
@@ -32,6 +32,12 @@
 		bootargs ="root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC2,115200 init=/linuxrc";
 	};
 
+	cpus {
+		cpu@0 {
+			cpu0-supply = <&buck1_reg>;
+		};
+	};
+
 	regulators {
 		compatible = "simple-bus";
 		#address-cells = <1>;
arch/arm/boot/dts/exynos4210-trats.dts +6 -0
index f516da9..fe32b6a 100644
@@ -30,6 +30,12 @@
 		bootargs = "console=ttySAC2,115200N8 root=/dev/mmcblk0p5 rootwait earlyprintk panic=5";
 	};
 
+	cpus {
+		cpu: cpu@0 {
+			cpu0-supply = <&varm_breg>;
+		};
+	};
+
 	regulators {
 		compatible = "simple-bus";
 
arch/arm/boot/dts/exynos4210-universal_c210.dts +6 -0
index d50eb3a..8ab12d6 100644
@@ -28,6 +28,12 @@
 		bootargs = "console=ttySAC2,115200N8 root=/dev/mmcblk0p5 rw rootwait earlyprintk panic=5 maxcpus=1";
 	};
 
+	cpus {
+		cpu: cpu@0 {
+			cpu0-supply = <&vdd_arm_reg>;
+		};
+	};
+
 	sysram@02020000 {
 		smp-sysram@0 {
 			status = "disabled";
arch/arm/boot/dts/exynos4210.dtsi +35 -0
index ee3001f..e42b87c 100644
@@ -31,6 +31,33 @@
 		pinctrl2 = &pinctrl_2;
 	};
 
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		cpu@0 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a9";
+			reg = <0>;
+			clocks = <&clock CLK_ARM_CLK>;
+			clock-names = "cpu";
+
+			operating-points = <
+				1200000 1250000
+				1000000 1150000
+				800000	1075000
+				500000	975000
+				400000	975000
+				200000	950000
+			>;
+		};
+
+		cpu@1 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a9";
+			reg = <1>;
+		};
+	};
+
 	sysram@02020000 {
 		compatible = "mmio-sram";
 		reg = <0x02020000 0x20000>;
@@ -91,6 +118,14 @@
 		compatible = "samsung,exynos4210-clock";
 		reg = <0x10030000 0x20000>;
 		#clock-cells = <1>;
+
+		samsung,armclk-cells = <9>;
+		samsung,armclk-divider-table = <1200000 3 7 3 4 1 7 5 0>,
+					       <1000000 3 7 3 4 1 7 4 0>,
+					       < 800000 3 7 3 3 1 7 3 0>,
+					       < 500000 3 7 3 3 1 7 3 0>,
+					       < 400000 3 7 3 3 1 7 3 0>,
+					       < 200000 1 3 1 1 1 0 3 0>;
 	};
 
 	pmu {
arch/arm/boot/dts/exynos4212.dtsi +18 -0
index 3c00e6e..87847d5 100644
@@ -22,6 +22,24 @@
 / {
 	compatible = "samsung,exynos4212", "samsung,exynos4";
 
+	clock: clock-controller@10030000 {
+		samsung,armclk-cells = <9>;
+		samsung,armclk-divider-table = <1500000 3 7 0 6 1 2 6 0>,
+					       <1400000 3 7 0 6 1 2 6 0>,
+					       <1300000 3 7 0 5 1 2 5 0>,
+					       <1200000 3 7 0 5 1 2 5 0>,
+					       <1100000 3 6 0 4 1 2 4 0>,
+					       <1000000 2 5 0 4 1 1 4 0>,
+					       < 900000 2 5 0 3 1 1 3 0>,
+					       < 800000 2 5 0 3 1 1 3 0>,
+					       < 700000 2 4 0 3 1 1 3 0>,
+					       < 600000 2 4 0 3 1 1 3 0>,
+					       < 500000 2 4 0 3 1 1 3 0>,
+					       < 400000 2 4 0 3 1 1 3 0>,
+					       < 300000 2 4 0 2 1 1 3 0>,
+					       < 200000 1 3 0 1 1 1 3 0>;
+	};
+
 	combiner: interrupt-controller@10440000 {
 		samsung,combiner-nr = <18>;
 	};
arch/arm/boot/dts/exynos4412-odroidx.dts +6 -0
index 31db28a..4671714 100644
@@ -22,6 +22,12 @@
 		reg = <0x40000000 0x40000000>;
 	};
 
+	cpus {
+		cpu@0 {
+			cpu0-supply = <&buck2_reg>;
+		};
+	};
+
 	leds {
 		compatible = "gpio-leds";
 		led1 {
arch/arm/boot/dts/exynos4412-origen.dts +6 -0
index e2c0dca..442bf90 100644
@@ -27,6 +27,12 @@
 		bootargs ="console=ttySAC2,115200";
 	};
 
+	cpus {
+		cpu@0 {
+			cpu0-supply = <&buck2_reg>;
+		};
+	};
+
 	firmware@0203F000 {
 		compatible = "samsung,secure-firmware";
 		reg = <0x0203F000 0x1000>;
arch/arm/boot/dts/exynos4412-trats2.dts +6 -0
index 7787844..3d9258d 100644
@@ -32,6 +32,12 @@
 		bootargs = "console=ttySAC2,115200N8 root=/dev/mmcblk0p5 rootwait earlyprintk panic=5";
 	};
 
+	cpus {
+		cpu@0 {
+			cpu0-supply = <&buck2_reg>;
+		};
+	};
+
 	firmware@0204F000 {
 		compatible = "samsung,secure-firmware";
 		reg = <0x0204F000 0x1000>;
arch/arm/boot/dts/exynos4412.dtsi +31 -0
index c42a3e1..c14b4f5 100644
@@ -22,6 +22,37 @@
 / {
 	compatible = "samsung,exynos4412", "samsung,exynos4";
 
+	cpus {
+		cpu@2 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a9";
+			reg = <2>;
+		};
+		cpu@3 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a9";
+			reg = <3>;
+		};
+	};
+
+	clock: clock-controller@10030000 {
+		samsung,armclk-cells = <10>;
+		samsung,armclk-divider-table = <1500000 3 7 0 6 1 2 6 0 7>,
+					       <1400000 3 7 0 6 1 2 6 0 6>,
+					       <1300000 3 7 0 5 1 2 5 0 6>,
+					       <1200000 3 7 0 5 1 2 5 0 5>,
+					       <1100000 3 6 0 4 1 2 4 0 5>,
+					       <1000000 2 5 0 4 1 1 4 0 4>,
+					       < 900000 2 5 0 3 1 1 3 0 4>,
+					       < 800000 2 5 0 3 1 1 3 0 3>,
+					       < 700000 2 4 0 3 1 1 3 0 3>,
+					       < 600000 2 4 0 3 1 1 3 0 2>,
+					       < 500000 2 4 0 3 1 1 3 0 2>,
+					       < 400000 2 4 0 3 1 1 3 0 1>,
+					       < 300000 2 4 0 2 1 1 3 0 1>,
+					       < 200000 1 3 0 1 1 1 3 0 0>;
+	};
+
 	combiner: interrupt-controller@10440000 {
 		samsung,combiner-nr = <20>;
 	};
arch/arm/boot/dts/exynos4x12.dtsi +36 -0
index c5a943d..6b43f71 100644
@@ -31,6 +31,42 @@
 		mshc0 = &mshc_0;
 	};
 
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		cpu@0 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a9";
+			reg = <0>;
+			clocks = <&clock CLK_ARM_CLK>;
+			clock-names = "cpu";
+
+			operating-points = <
+				1500000 1350000
+				1400000 1287500
+				1300000 1250000
+				1200000 1187500
+				1100000 1137500
+				1000000 1087500
+				 900000 1037500
+				 800000 1000000
+				 700000  987500
+				 600000  975000
+				 500000  950000
+				 400000  925000
+				 300000  900000
+				 200000  900000
+			>;
+			clock-latency = <200000>;
+			boost-frequencies = <1500000>;
+		};
+		cpu@1 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a9";
+			reg = <1>;
+		};
+	};
+
 	pmu {
 		compatible = "arm,cortex-a9-pmu";
 		interrupt-parent = <&combiner>;
arch/arm/boot/dts/exynos5250-arndale.dts +6 -0
index cde19c8..6367538 100644
@@ -25,6 +25,12 @@
 		bootargs = "console=ttySAC2,115200";
 	};
 
+	cpus {
+		cpu@0 {
+			cpu0-supply = <&buck2_reg>;
+		};
+	};
+
 	rtc@101E0000 {
 		status = "okay";
 	};
arch/arm/boot/dts/exynos5250-cros-common.dtsi +6 -0
index 89ac90f..34bb31c 100644
@@ -19,6 +19,12 @@
 	chosen {
 	};
 
+	cpus {
+		cpu@0 {
+			cpu0-supply = <&buck2_reg>;
+		};
+	};
+
 	pinctrl@11400000 {
 		/*
 		 * Disabled pullups since external part has its own pullups and
arch/arm/boot/dts/exynos5250-smdk5250.dts +6 -0
index a794a70..3632f7a 100644
@@ -27,6 +27,12 @@
 		bootargs = "root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC2,115200 init=/linuxrc";
 	};
 
+	cpus {
+		cpu@0 {
+			cpu0-supply = <&buck2_reg>;
+		};
+	};
+
 	rtc@101E0000 {
 		status = "okay";
 	};
arch/arm/boot/dts/exynos5250.dtsi +41 -0

53 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#7 lore raw

PATCH v5 6/7 ARM: Exynos: switch to using generic cpufreq-cpu0 driver

In reply to Thomas Abraham

From: Thomas Abraham <[email protected]>

Remove the platform device instantiation for Exynos specific cpufreq driver and add the platform device for cpufreq-cpu0 driver.

---
 arch/arm/mach-exynos/exynos.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm/mach-exynos/exynos.c +3 -1
index 93507ee..2193061 100644
@@ -184,7 +184,9 @@ void __init exynos_cpuidle_init(void)
 
 void __init exynos_cpufreq_init(void)
 {
-	platform_device_register_simple("exynos-cpufreq", -1, NULL, 0);
+	if (!(of_machine_is_compatible("samsung,exynos5420")) &&
+		!(of_machine_is_compatible("samsung,exynos5440")))
+		platform_device_register_simple("cpufreq-cpu0", -1, NULL, 0);
 }
 
 void __init exynos_init_late(void)
Signature · 1 line
1.7.9.5
maintainer Acked-by on v5 6/7
#8 lore raw

Re: [PATCH v5 6/7] ARM: Exynos: switch to using generic cpufreq-cpu0 driver

Quoted 9 lines · Thomas Abraham

From: Thomas Abraham <[email protected]>

Remove the platform device instantiation for Exynos specific cpufreq driver and add the platform device for cpufreq-cpu0 driver.

---
 arch/arm/mach-exynos/exynos.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
#9 lore raw

PATCH v5 7/7 cpufreq: exynos: remove all exynos specific cpufreq driver support

In reply to Thomas Abraham

From: Thomas Abraham <[email protected]>

Exynos4210, Exynos4x12 and Exynos5250 based platforms have switched over to use cpufreq-cpu0 driver for cpufreq functionality. So the Exynos specific cpufreq drivers for these platforms can be removed.

---
 drivers/cpufreq/Kconfig.arm          |   52 --------
 drivers/cpufreq/Makefile             |    4 -
 drivers/cpufreq/exynos-cpufreq.c     |  218 ----------------------------------
 drivers/cpufreq/exynos-cpufreq.h     |   99 ---------------
 drivers/cpufreq/exynos4210-cpufreq.c |  157 ------------------------
 drivers/cpufreq/exynos4x12-cpufreq.c |  208 --------------------------------
 drivers/cpufreq/exynos5250-cpufreq.c |  183 ----------------------------
 7 files changed, 921 deletions(-)
 delete mode 100644 drivers/cpufreq/exynos-cpufreq.c
 delete mode 100644 drivers/cpufreq/exynos-cpufreq.h
 delete mode 100644 drivers/cpufreq/exynos4210-cpufreq.c
 delete mode 100644 drivers/cpufreq/exynos4x12-cpufreq.c
 delete mode 100644 drivers/cpufreq/exynos5250-cpufreq.c
drivers/cpufreq/Kconfig.arm +0 -52
index 5805035..9721674 100644
@@ -24,43 +24,6 @@ config ARM_VEXPRESS_SPC_CPUFREQ
           This add the CPUfreq driver support for Versatile Express
 	  big.LITTLE platforms using SPC for power management.
 
-
-config ARM_EXYNOS_CPUFREQ
-	bool
-
-config ARM_EXYNOS4210_CPUFREQ
-	bool "SAMSUNG EXYNOS4210"
-	depends on CPU_EXYNOS4210 && !ARCH_MULTIPLATFORM
-	default y
-	select ARM_EXYNOS_CPUFREQ
-	help
-	  This adds the CPUFreq driver for Samsung EXYNOS4210
-	  SoC (S5PV310 or S5PC210).
-
-	  If in doubt, say N.
-
-config ARM_EXYNOS4X12_CPUFREQ
-	bool "SAMSUNG EXYNOS4x12"
-	depends on (SOC_EXYNOS4212 || SOC_EXYNOS4412) && !ARCH_MULTIPLATFORM
-	default y
-	select ARM_EXYNOS_CPUFREQ
-	help
-	  This adds the CPUFreq driver for Samsung EXYNOS4X12
-	  SoC (EXYNOS4212 or EXYNOS4412).
-
-	  If in doubt, say N.
-
-config ARM_EXYNOS5250_CPUFREQ
-	bool "SAMSUNG EXYNOS5250"
-	depends on SOC_EXYNOS5250 && !ARCH_MULTIPLATFORM
-	default y
-	select ARM_EXYNOS_CPUFREQ
-	help
-	  This adds the CPUFreq driver for Samsung EXYNOS5250
-	  SoC.
-
-	  If in doubt, say N.
-
 config ARM_EXYNOS5440_CPUFREQ
 	bool "SAMSUNG EXYNOS5440"
 	depends on SOC_EXYNOS5440
@@ -75,21 +38,6 @@ config ARM_EXYNOS5440_CPUFREQ
 
 	  If in doubt, say N.
 
-config ARM_EXYNOS_CPU_FREQ_BOOST_SW
-	bool "EXYNOS Frequency Overclocking - Software"
-	depends on ARM_EXYNOS_CPUFREQ
-	select CPU_FREQ_BOOST_SW
-	select EXYNOS_THERMAL
-	help
-	  This driver supports software managed overclocking (BOOST).
-	  It allows usage of special frequencies for Samsung Exynos
-	  processors if thermal conditions are appropriate.
-
-	  It reguires, for safe operation, thermal framework with properly
-	  defined trip points.
-
-	  If in doubt, say N.
-
 config ARM_HIGHBANK_CPUFREQ
 	tristate "Calxeda Highbank-based"
 	depends on ARCH_HIGHBANK && GENERIC_CPUFREQ_CPU0 && REGULATOR
drivers/cpufreq/Makefile +0 -4
index 738c8b7..8a75419 100644
@@ -51,10 +51,6 @@ obj-$(CONFIG_ARM_DT_BL_CPUFREQ)		+= arm_big_little_dt.o
 
 obj-$(CONFIG_ARCH_DAVINCI_DA850)	+= davinci-cpufreq.o
 obj-$(CONFIG_UX500_SOC_DB8500)		+= dbx500-cpufreq.o
-obj-$(CONFIG_ARM_EXYNOS_CPUFREQ)	+= exynos-cpufreq.o
-obj-$(CONFIG_ARM_EXYNOS4210_CPUFREQ)	+= exynos4210-cpufreq.o
-obj-$(CONFIG_ARM_EXYNOS4X12_CPUFREQ)	+= exynos4x12-cpufreq.o
-obj-$(CONFIG_ARM_EXYNOS5250_CPUFREQ)	+= exynos5250-cpufreq.o
 obj-$(CONFIG_ARM_EXYNOS5440_CPUFREQ)	+= exynos5440-cpufreq.o
 obj-$(CONFIG_ARM_HIGHBANK_CPUFREQ)	+= highbank-cpufreq.o
 obj-$(CONFIG_ARM_IMX6Q_CPUFREQ)		+= imx6q-cpufreq.o
drivers/cpufreq/exynos-cpufreq.c deleted +0 -218

218 lines not on this page · raw message

drivers/cpufreq/exynos-cpufreq.h deleted +0 -99

99 lines not on this page · raw message

drivers/cpufreq/exynos4210-cpufreq.c deleted +0 -157

157 lines not on this page · raw message

drivers/cpufreq/exynos4x12-cpufreq.c deleted +0 -208

208 lines not on this page · raw message

drivers/cpufreq/exynos5250-cpufreq.c deleted +0 -183

183 lines not on this page · raw message

Signature · 1 line
1.7.9.5
maintainer Acked-by on v5 7/7
#10 lore raw

Re: [PATCH v5 7/7] cpufreq: exynos: remove all exynos specific cpufreq driver support

Quoted 7 lines · Thomas Abraham

From: Thomas Abraham <[email protected]>

Exynos4210, Exynos4x12 and Exynos5250 based platforms have switched over to use cpufreq-cpu0 driver for cpufreq functionality. So the Exynos specific cpufreq drivers for these platforms can be removed.

Quoted 14 lines
---
 drivers/cpufreq/Kconfig.arm          |   52 --------
 drivers/cpufreq/Makefile             |    4 -
 drivers/cpufreq/exynos-cpufreq.c     |  218 ----------------------------------
 drivers/cpufreq/exynos-cpufreq.h     |   99 ---------------
 drivers/cpufreq/exynos4210-cpufreq.c |  157 ------------------------
 drivers/cpufreq/exynos4x12-cpufreq.c |  208 --------------------------------
 drivers/cpufreq/exynos5250-cpufreq.c |  183 ----------------------------
 7 files changed, 921 deletions(-)
 delete mode 100644 drivers/cpufreq/exynos-cpufreq.c
 delete mode 100644 drivers/cpufreq/exynos-cpufreq.h
 delete mode 100644 drivers/cpufreq/exynos4210-cpufreq.c
 delete mode 100644 drivers/cpufreq/exynos4x12-cpufreq.c
 delete mode 100644 drivers/cpufreq/exynos5250-cpufreq.c
#11 lore raw
In reply to Thomas Abraham
Quoted 10 lines · Thomas Abraham

Changes since v4:
- Various changes in clock code suggested by Tomasz Figa<[email protected]>
- This series depends on mutiple other patches
[a] patch that introduces read-only attribute for clock dividers.
- http://lists.infradead.org/pipermail/linux-arm-kernel/2014-May/259264.html
[b] the series "PM / OPP: move cpufreq specific helpers out of OPP layer"
- https://www.mail-archive.com/[email protected]/msg104610.html
[c] the series "cpufreq: opp: Add device tree based lookup of boost mode frequency"
- http://www.spinics.net/lists/arm-kernel/msg334336.html

This series looks good to me after quick loking at but as I replied on other thread, I'm not sure above changes are ready for 3.16 or not...

Maybe we can revisit this series for 3.17?...hmm...

- Kukjin

Quoted 81 lines

Changes since v3:
- Addressed comments from Tomasz Figa<[email protected]>
[http://www.spinics.net/lists/cpufreq/msg09290.html]
- Rebased to v3.15-rc4

Changes since v2:
- Safe operating voltage is not required while switching APLL frequency since the temporary parent's clock is divided down to keep armclk within permissible limits. Thanks to Heiko Stuebner<[email protected]> for suggesting this.
- Rob had suggested to use max frequency for each of the divider clock outputs instead of divider values. But due to certain SoC specific characteristics, the divider values corresponding to the input clock frequency for the CMU_CPU clock blocks have to be used.

Changes since v1:
- Removes Exynos4x12 and Exynos5250 cpufreq driver also.
- Device tree based clock configuration lookup as suggested by Lukasz Majewski and Tomasz Figa.
- safe operating point binding reworked as suggested by Shawn Guo.

The patch series removes the use of Exynos specific cpufreq driver and enables the use of cpufreq-cpu0 driver for Exynos4210, Exynos4x12 and Exynos5250 based platforms. This is being done for few reasons.

(a) The Exynos cpufreq driver reads/writes clock controller registers bypassing the Exynos CCF driver which is sort of problematic.
(b) Removes the need for having clock controller register definitions in the cpufreq driver and also removes the need for statically io-remapping clock controller address space (helps in moving towards multiplatform kernel).

Thomas Abraham (7):
cpufreq: cpufreq-cpu0: allow use of optional boost mode frequencies
clk: samsung: add infrastructure to register cpu clocks
Documentation: devicetree: add cpu clock configuration data binding for Exynos4/5
clk: exynos: use cpu-clock provider type to represent arm clock
ARM: dts: Exynos: add cpu nodes, opp and cpu clock configuration data
ARM: Exynos: switch to using generic cpufreq-cpu0 driver
cpufreq: exynos: remove all exynos specific cpufreq driver support

  .../devicetree/bindings/clock/exynos4-clock.txt    |   37 ++
  .../devicetree/bindings/clock/exynos5250-clock.txt |   36 ++
  .../devicetree/bindings/cpufreq/cpufreq-cpu0.txt   |    2 +
  arch/arm/boot/dts/exynos4210-origen.dts            |    6 +
  arch/arm/boot/dts/exynos4210-trats.dts             |    6 +
  arch/arm/boot/dts/exynos4210-universal_c210.dts    |    6 +
  arch/arm/boot/dts/exynos4210.dtsi                  |   35 ++
  arch/arm/boot/dts/exynos4212.dtsi                  |   18 +
  arch/arm/boot/dts/exynos4412-odroidx.dts           |    6 +
  arch/arm/boot/dts/exynos4412-origen.dts            |    6 +
  arch/arm/boot/dts/exynos4412-trats2.dts            |    6 +
  arch/arm/boot/dts/exynos4412.dtsi                  |   31 ++
  arch/arm/boot/dts/exynos4x12.dtsi                  |   36 ++
  arch/arm/boot/dts/exynos5250-arndale.dts           |    6 +
  arch/arm/boot/dts/exynos5250-cros-common.dtsi      |    6 +
  arch/arm/boot/dts/exynos5250-smdk5250.dts          |    6 +
  arch/arm/boot/dts/exynos5250.dtsi                  |   41 ++
  arch/arm/mach-exynos/exynos.c                      |    4 +-
  drivers/clk/samsung/Makefile                       |    2 +-
  drivers/clk/samsung/clk-cpu.c                      |  448 ++++++++++++++++++++
  drivers/clk/samsung/clk-exynos4.c                  |   25 +-
  drivers/clk/samsung/clk-exynos5250.c               |   16 +-
  drivers/clk/samsung/clk.h                          |    4 +
  drivers/cpufreq/Kconfig                            |    1 +
  drivers/cpufreq/Kconfig.arm                        |   52 ---
  drivers/cpufreq/Makefile                           |    4 -
  drivers/cpufreq/cpufreq-cpu0.c                     |    3 +
  drivers/cpufreq/exynos-cpufreq.c                   |  218 ----------
  drivers/cpufreq/exynos-cpufreq.h                   |   99 -----
  drivers/cpufreq/exynos4210-cpufreq.c               |  157 -------
  drivers/cpufreq/exynos4x12-cpufreq.c               |  208 ---------
  drivers/cpufreq/exynos5250-cpufreq.c               |  183 --------
  include/dt-bindings/clock/exynos5250.h             |    1 +
  33 files changed, 779 insertions(+), 936 deletions(-)

create mode 100644 drivers/clk/samsung/clk-cpu.c delete mode 100644 drivers/cpufreq/exynos-cpufreq.c delete mode 100644 drivers/cpufreq/exynos-cpufreq.h delete mode 100644 drivers/cpufreq/exynos4210-cpufreq.c delete mode 100644 drivers/cpufreq/exynos4x12-cpufreq.c delete mode 100644 drivers/cpufreq/exynos5250-cpufreq.c

#12 lore raw

Hi Kukjin,

Quoted 17 lines · Kukjin Kim
Quoted 8 lines · Thomas Abraham

Changes since v4:
- Various changes in clock code suggested by Tomasz Figa<[email protected]>
- This series depends on mutiple other patches
[a] patch that introduces read-only attribute for clock dividers.

       -

http://lists.infradead.org/pipermail/linux-arm-kernel/2014-May/259264.html

Quoted 8 lines

[b] the series "PM / OPP: move cpufreq specific helpers out of OPP
layer"

       -

https://www.mail-archive.com/[email protected]/msg104610.html
[c] the series "cpufreq: opp: Add device tree based lookup of boost
mode frequency"
- http://www.spinics.net/lists/arm-kernel/msg334336.html

Quoted 4 lines

This series looks good to me after quick loking at but as I replied on other thread, I'm not sure above changes are ready for 3.16 or not...

Maybe we can revisit this series for 3.17?...hmm...

Also two more issues:

1) DT bindings are not acked by DT maintainers,
2) there are my comments to DT bindings from v4 not addressed.

There are also several comments about the code of v4 not addressed, but this is not that important, as opposed to DT bindings which are supposed to be stable ABI.

Still, I don't think this is a big deal anymore, as we can have cpufreq working with multiplatform with my hack patch and polish the implementation of this series without any hurry.

Best regards,
Tomasz

#13 lore raw
Quoted 3 lines · Tomasz Figa

Hi Kukjin,

Hi,

Quoted 29 lines · Kukjin Kim
Quoted 8 lines · Thomas Abraham
Quoted 7 lines

Changes since v4:
- Various changes in clock code suggested by Tomasz Figa<[email protected]>
- This series depends on mutiple other patches
[a] patch that introduces read-only attribute for clock dividers.

       -

http://lists.infradead.org/pipermail/linux-arm-kernel/2014-

May/259264.html

Quoted 9 lines
Quoted 9 lines

[b] the series "PM / OPP: move cpufreq specific helpers out of OPP
layer"

       -

https://www.mail-archive.com/[email protected]/msg104610.html
[c] the series "cpufreq: opp: Add device tree based lookup of boost
mode frequency"
- http://www.spinics.net/lists/arm-kernel/msg334336.html

Quoted 4 lines

This series looks good to me after quick loking at but as I replied on other thread, I'm not sure above changes are ready for 3.16 or not...

Maybe we can revisit this series for 3.17?...hmm...

Also two more issues:

1) DT bindings are not acked by DT maintainers,
2) there are my comments to DT bindings from v4 not addressed.

Quoted 8 lines

There are also several comments about the code of v4 not addressed, but this is not that important, as opposed to DT bindings which are supposed to be stable ABI.

Still, I don't think this is a big deal anymore, as we can have cpufreq working with multiplatform with my hack patch and polish the implementation of this series without any hurry.

Yeah, I'm waiting for Viresh's ack on your v2 exynos-cpufreq changes for multiplatform...

- Kukjin