Skip to contentSkip to conversation

cpufreq: exynos5440: support for cpufreq driver

PATCH In review Amit Daniel Kachhap 4 participants 13 messages Apr 8, 2013 – Apr 12, 2013

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

v6 cover cpufreq: exynos5440: support for cpufreq driver

Submitting the V6 version of exynos5440 cpufreq driver. This patchset addresses all the coding and design concerns raised especially by Viresh.

Changes in V6:
* Used cpufreq post-change notifier call back in case of failure as pointed by Viresh.
* Called cpufreq_frequency_table_cpuinfo before calling cpufreq_frequency_table_get_attr as pointed by Viresh.
* Used modified API cpufreq_notify_transition.

Changes in V5:
* Removed the unnecessary DT look up entry from mach-exynos5-dt.c.
* Fixed all coding and comments issue raised by Viresh.

Changes in V4:
* Added dev_err logs instead of pr_err.
* Used the devm_ioremap_resource API.
* Implemented several coding guidelines and minor error comments from Sylwester, Russell and Viresh.

Changes in V3:
* Converted the driver to probe based as suggested by Viresh. This is also beneficial for multiplatform kernel.
* Other coding guidelines related changes.
* Moved the DT node outside cpu0 node as the driver is now a platform driver.

Changes in V2:
* Added OPP library support to parse DT parameters.
* Removed a hack to handle interrupts in bootup.
* Implemented other review comments from Viresh and Inder.

All these patches are dependent on Thomas Abraham common clock patches.
(http://www.mail-archive.com/[email protected]/msg15860.html)
This whole patch series is based on Rafael tree.
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git bleeding-edge

Amit Daniel Kachhap (4):
cpufreq: exynos: Add cpufreq driver for exynos5440
cpufreq: exynos: Remove error return even if no soc is found
arm: exynos: Enable OPP library support for exynos5440
arm: dts: Add cpufreq controller node for Exynos5440 SoC

 .../bindings/cpufreq/cpufreq-exynos5440.txt        |   28 ++
 arch/arm/boot/dts/exynos5440.dtsi                  |   12 +
 arch/arm/mach-exynos/Kconfig                       |    2 +
 drivers/cpufreq/Kconfig.arm                        |    9 +
 drivers/cpufreq/Makefile                           |    1 +
 drivers/cpufreq/exynos-cpufreq.c                   |    2 +-
 drivers/cpufreq/exynos5440-cpufreq.c               |  479 ++++++++++++++++++++
 7 files changed, 532 insertions(+), 1 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/cpufreq/cpufreq-exynos5440.txt
 create mode 100644 drivers/cpufreq/exynos5440-cpufreq.c
#1 lore raw

PATCH v6 1/4 cpufreq: exynos: Add cpufreq driver for exynos5440

This patch adds dvfs support for exynos5440 SOC. This soc has 4 cores and they scale at same frequency. The nature of exynos5440 clock controller is different from previous exynos controllers so not using the common exynos cpufreq framework. The major difference being interrupt notification for frequency change. Also, OPP library is used for device tree parsing to get different parameters like frequency, voltage etc. Since the opp library sorts the frequency table in ascending order so they are again re-arranged in descending order. This will have one-to-one mapping with the clock controller state management logic.

Cc Viresh Kumar <[email protected]>
Cc Rafael J. Wysocki <[email protected]>
Cc Kukjin Kim <[email protected]>
---
 .../bindings/cpufreq/cpufreq-exynos5440.txt        |   28 ++
 drivers/cpufreq/Kconfig.arm                        |    9 +
 drivers/cpufreq/Makefile                           |    1 +
 drivers/cpufreq/exynos5440-cpufreq.c               |  479 ++++++++++++++++++++
 4 files changed, 517 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/cpufreq/cpufreq-exynos5440.txt
 create mode 100644 drivers/cpufreq/exynos5440-cpufreq.c
Documentation/devicetree/bindings/cpufreq/cpufreq-exynos5440.txt new file +28 -0
new file mode 100644
index 0000000..caff1a5
@@ -0,0 +1,28 @@
+
+Exynos5440 cpufreq driver
+-------------------
+
+Exynos5440 SoC cpufreq driver for CPU frequency scaling.
+
+Required properties:
+- interrupts: Interrupt to know the completion of cpu frequency change.
+- operating-points: Table of frequencies and voltage CPU could be transitioned into,
+	in the decreasing order. Frequency should be in KHz units and voltage
+	should be in microvolts.
+
+Optional properties:
+- clock-latency: Clock monitor latency in microsecond.
+
+All the required listed above must be defined under node cpufreq.
+
+Example:
+--------
+	cpufreq@160000 {
+		compatible = "samsung,exynos5440-cpufreq";
+		reg = <0x160000 0x1000>;
+		interrupts = <0 57 0>;
+		operating-points = <
+				1000000 975000
+				800000  925000>;
+		clock-latency = <100000>;
+	};
drivers/cpufreq/Kconfig.arm +9 -0
index f3f3b14..bce2195 100644
@@ -42,6 +42,15 @@ config ARM_EXYNOS5250_CPUFREQ
 	  This adds the CPUFreq driver for Samsung EXYNOS5250
 	  SoC.
 
+config ARM_EXYNOS5440_CPUFREQ
+	def_bool SOC_EXYNOS5440
+	depends on HAVE_CLK && PM_OPP && OF
+	help
+	  This adds the CPUFreq driver for Samsung EXYNOS5440
+	  SoC. The nature of exynos5440 clock controller is
+	  different than previous exynos controllers so not using
+	  the common exynos framework.
+
 config ARM_HIGHBANK_CPUFREQ
 	tristate "Calxeda Highbank-based"
 	depends on ARCH_HIGHBANK
drivers/cpufreq/Makefile +1 -0
index 5db1f1f..6ad0b91 100644
@@ -56,6 +56,7 @@ 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
 obj-$(CONFIG_ARM_INTEGRATOR)		+= integrator-cpufreq.o
drivers/cpufreq/exynos5440-cpufreq.c new file +479 -0

479 lines not on this page · raw message

Signature · 1 line
1.7.1
maintainer
#2 lore raw

Re: [PATCH V6 1/4] cpufreq: exynos: Add cpufreq driver for exynos5440

drivers/cpufreq/Kconfig.arm config ARM_EXYNOS5250_CPUFREQ · line 47

Quoted 11 lines · Amit Daniel Kachhap
drivers/cpufreq/Kconfig.arm +3 -0
index f3f3b14..bce2195 100644
@@ -42,6 +42,15 @@ config ARM_EXYNOS5250_CPUFREQ
          This adds the CPUFreq driver for Samsung EXYNOS5250
          SoC.
 
+config ARM_EXYNOS5440_CPUFREQ
+       def_bool SOC_EXYNOS5440
+       depends on HAVE_CLK && PM_OPP && OF

Don't you need a depend on your Soc or mach or arch? Don't send another version for this now.. Just send a new patch over this patchset.

Quoted 8 lines
drivers/cpufreq/exynos5440-cpufreq.c +6 -0
 
+static int exynos_target(struct cpufreq_policy *policy,
+                         unsigned int target_freq,
+                         unsigned int relation)
+{
+       unsigned int index, tmp;
+       int ret = 0, i;

drivers/cpufreq/exynos5440-cpufreq.c line 235

Quoted 10 lines
drivers/cpufreq/exynos5440-cpufreq.c +10 -0
+       struct cpufreq_frequency_table *freq_table = dvfs_info->freq_table;
+
+       mutex_lock(&cpufreq_lock);
+       freqs.old = dvfs_info->cur_frequency;
+
+       ret = cpufreq_frequency_table_target(policy, freq_table,
+                                          target_freq, relation, &index);
+       if (ret)
+               goto out;
+

Move freqs.old = *** here.

drivers/cpufreq/exynos5440-cpufreq.c line 237

Quoted 2 lines
drivers/cpufreq/exynos5440-cpufreq.c +2 -0
+       freqs.new = freq_table[index].frequency;
+       freqs.cpu = policy->cpu;

You don't need this. Below call takes care of it.

Rest is fine.. Just resend this patch with all above issues fixed and i will Ack it without any further reviews :)

Don't wait for few days for doing this, send it right now. :)

maintainer
#3 lore raw

Re: [PATCH V6 1/4] cpufreq: exynos: Add cpufreq driver for exynos5440

Quoted 10 lines · Viresh Kumar
Quoted 8 lines · Amit Daniel Kachhap
drivers/cpufreq/Kconfig.arm +0 -0
index f3f3b14..bce2195 100644
@@ -42,6 +42,15 @@ config ARM_EXYNOS5250_CPUFREQ
          This adds the CPUFreq driver for Samsung EXYNOS5250
          SoC.
 
Quoted 6 lines

drivers/cpufreq/Kconfig.arm config ARM_EXYNOS5250_CPUFREQ · line 47

Quoted 3 lines
drivers/cpufreq/Kconfig.arm +3 -0
+config ARM_EXYNOS5440_CPUFREQ
+       def_bool SOC_EXYNOS5440
+       depends on HAVE_CLK && PM_OPP && OF

Don't you need a depend on your Soc or mach or arch? Don't send another version for this now.. Just send a new patch over this patchset.

Sorry, i overlooked def_bool... This comments stands invalid.

#4 lore raw

PATCH RESEND v6 1/4 cpufreq: exynos: Add cpufreq driver for exynos5440

This patch adds dvfs support for exynos5440 SOC. This soc has 4 cores and they scale at same frequency. The nature of exynos5440 clock controller is different from previous exynos controllers so not using the common exynos cpufreq framework. The major difference being interrupt notification for frequency change. Also, OPP library is used for device tree parsing to get different parameters like frequency, voltage etc. Since the opp library sorts the frequency table in ascending order so they are again re-arranged in descending order. This will have one-to-one mapping with the clock controller state management logic.

Cc Viresh Kumar <[email protected]>
Cc Rafael J. Wysocki <[email protected]>
Cc Kukjin Kim <[email protected]>

---

Re-sending this patch with a minor comment from Viresh about the correct usage of cpufreq_notify_transition API.

 .../bindings/cpufreq/cpufreq-exynos5440.txt        |   28 ++
 drivers/cpufreq/Kconfig.arm                        |    9 +
 drivers/cpufreq/Makefile                           |    1 +
 drivers/cpufreq/exynos5440-cpufreq.c               |  478 ++++++++++++++++++++
 4 files changed, 516 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/cpufreq/cpufreq-exynos5440.txt
 create mode 100644 drivers/cpufreq/exynos5440-cpufreq.c
Documentation/devicetree/bindings/cpufreq/cpufreq-exynos5440.txt new file +28 -0
new file mode 100644
index 0000000..caff1a5
@@ -0,0 +1,28 @@
+
+Exynos5440 cpufreq driver
+-------------------
+
+Exynos5440 SoC cpufreq driver for CPU frequency scaling.
+
+Required properties:
+- interrupts: Interrupt to know the completion of cpu frequency change.
+- operating-points: Table of frequencies and voltage CPU could be transitioned into,
+	in the decreasing order. Frequency should be in KHz units and voltage
+	should be in microvolts.
+
+Optional properties:
+- clock-latency: Clock monitor latency in microsecond.
+
+All the required listed above must be defined under node cpufreq.
+
+Example:
+--------
+	cpufreq@160000 {
+		compatible = "samsung,exynos5440-cpufreq";
+		reg = <0x160000 0x1000>;
+		interrupts = <0 57 0>;
+		operating-points = <
+				1000000 975000
+				800000  925000>;
+		clock-latency = <100000>;
+	};
drivers/cpufreq/Kconfig.arm +9 -0
index f3f3b14..bce2195 100644
@@ -42,6 +42,15 @@ config ARM_EXYNOS5250_CPUFREQ
 	  This adds the CPUFreq driver for Samsung EXYNOS5250
 	  SoC.
 
+config ARM_EXYNOS5440_CPUFREQ
+	def_bool SOC_EXYNOS5440
+	depends on HAVE_CLK && PM_OPP && OF
+	help
+	  This adds the CPUFreq driver for Samsung EXYNOS5440
+	  SoC. The nature of exynos5440 clock controller is
+	  different than previous exynos controllers so not using
+	  the common exynos framework.
+
 config ARM_HIGHBANK_CPUFREQ
 	tristate "Calxeda Highbank-based"
 	depends on ARCH_HIGHBANK
drivers/cpufreq/Makefile +1 -0
index 5db1f1f..6ad0b91 100644
@@ -56,6 +56,7 @@ 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
 obj-$(CONFIG_ARM_INTEGRATOR)		+= integrator-cpufreq.o
drivers/cpufreq/exynos5440-cpufreq.c new file +478 -0

478 lines not on this page · raw message

Signature · 1 line
1.7.1
#5 lore raw

Re: [RESEND PATCH V6 1/4] cpufreq: exynos: Add cpufreq driver for exynos5440

Hi,

Quoted 8 lines · Amit Daniel Kachhap
drivers/cpufreq/exynos5440-cpufreq.c new file +8 -0
+
+static int init_div_table(void)
+{
+       struct cpufreq_frequency_table *freq_tbl = dvfs_info->freq_table;
+       unsigned int tmp, clk_div, ema_div, freq, volt_id;
+       int i = 0;
+       struct opp *opp;
+

drivers/cpufreq/exynos5440-cpufreq.c line 132

Quoted 10 lines
drivers/cpufreq/exynos5440-cpufreq.c new file +10 -0
+       for (i = 0; freq_tbl[i].frequency != CPUFREQ_TABLE_END; i++) {
+
+               opp = opp_find_freq_exact(dvfs_info->dev,
+                                       freq_tbl[i].frequency * 1000, true);
+               if (IS_ERR(opp)) {
+                       dev_err(dvfs_info->dev,
+                               "failed to find valid OPP for %u KHZ\n",
+                               freq_tbl[i].frequency);
+                       return PTR_ERR(opp);
+               }

please use RCU read locks.

drivers/cpufreq/exynos5440-cpufreq.c line 143

Quoted 11 lines
drivers/cpufreq/exynos5440-cpufreq.c new file +11 -0
+
+               freq = freq_tbl[i].frequency / 1000; /* In MHZ */
+               clk_div = ((freq / CPU_DIV_FREQ_MAX) & P0_7_CPUCLKDEV_MASK)
+                                       << P0_7_CPUCLKDEV_SHIFT;
+               clk_div |= ((freq / CPU_ATB_FREQ_MAX) & P0_7_ATBCLKDEV_MASK)
+                                       << P0_7_ATBCLKDEV_SHIFT;
+               clk_div |= ((freq / CPU_DBG_FREQ_MAX) & P0_7_CSCLKDEV_MASK)
+                                       << P0_7_CSCLKDEV_SHIFT;
+
+               /* Calculate EMA */
+               volt_id = opp_get_voltage(opp);

Please use RCU read locks as documented for OPP library.

Regards,
Nishanth Menon

#6 lore raw

Re: [RESEND PATCH V6 1/4] cpufreq: exynos: Add cpufreq driver for exynos5440

Quoted 23 lines · Nishanth Menon

Hi,

Quoted 8 lines · Amit Daniel Kachhap
drivers/cpufreq/exynos5440-cpufreq.c new file +8 -0
+
+static int init_div_table(void)
+{
+       struct cpufreq_frequency_table *freq_tbl = dvfs_info->freq_table;
+       unsigned int tmp, clk_div, ema_div, freq, volt_id;
+       int i = 0;
+       struct opp *opp;
+

drivers/cpufreq/exynos5440-cpufreq.c line 132

Quoted 10 lines
drivers/cpufreq/exynos5440-cpufreq.c new file +10 -0
+       for (i = 0; freq_tbl[i].frequency != CPUFREQ_TABLE_END; i++) {
+
+               opp = opp_find_freq_exact(dvfs_info->dev,
+                                       freq_tbl[i].frequency * 1000, true);
+               if (IS_ERR(opp)) {
+                       dev_err(dvfs_info->dev,
+                               "failed to find valid OPP for %u KHZ\n",
+                               freq_tbl[i].frequency);
+                       return PTR_ERR(opp);
+               }

please use RCU read locks.

Quoted 12 lines

drivers/cpufreq/exynos5440-cpufreq.c line 143

Quoted 11 lines
drivers/cpufreq/exynos5440-cpufreq.c new file +11 -0
+
+               freq = freq_tbl[i].frequency / 1000; /* In MHZ */
+               clk_div = ((freq / CPU_DIV_FREQ_MAX) & P0_7_CPUCLKDEV_MASK)
+                                       << P0_7_CPUCLKDEV_SHIFT;
+               clk_div |= ((freq / CPU_ATB_FREQ_MAX) & P0_7_ATBCLKDEV_MASK)
+                                       << P0_7_ATBCLKDEV_SHIFT;
+               clk_div |= ((freq / CPU_DBG_FREQ_MAX) & P0_7_CSCLKDEV_MASK)
+                                       << P0_7_CSCLKDEV_SHIFT;
+
+               /* Calculate EMA */
+               volt_id = opp_get_voltage(opp);

Please use RCU read locks as documented for OPP library.

Argh. I overlooked that and the series has been applied already. Care to send a fix against linux-pm.git/linux-next?

Rafael

Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
#7 lore raw

Re: [RESEND PATCH V6 1/4] cpufreq: exynos: Add cpufreq driver for exynos5440

Hi Rafael,

Quoted 37 lines · Rafael J. Wysocki
Quoted 23 lines · Nishanth Menon

Hi,

Quoted 8 lines · Amit Daniel Kachhap
drivers/cpufreq/exynos5440-cpufreq.c new file +8 -0
+
+static int init_div_table(void)
+{
+       struct cpufreq_frequency_table *freq_tbl = dvfs_info->freq_table;
+       unsigned int tmp, clk_div, ema_div, freq, volt_id;
+       int i = 0;
+       struct opp *opp;
+

drivers/cpufreq/exynos5440-cpufreq.c line 132

Quoted 10 lines
drivers/cpufreq/exynos5440-cpufreq.c new file +10 -0
+       for (i = 0; freq_tbl[i].frequency != CPUFREQ_TABLE_END; i++) {
+
+               opp = opp_find_freq_exact(dvfs_info->dev,
+                                       freq_tbl[i].frequency * 1000, true);
+               if (IS_ERR(opp)) {
+                       dev_err(dvfs_info->dev,
+                               "failed to find valid OPP for %u KHZ\n",
+                               freq_tbl[i].frequency);
+                       return PTR_ERR(opp);
+               }

please use RCU read locks.

Quoted 12 lines

drivers/cpufreq/exynos5440-cpufreq.c line 143

Quoted 11 lines
drivers/cpufreq/exynos5440-cpufreq.c new file +11 -0
+
+               freq = freq_tbl[i].frequency / 1000; /* In MHZ */
+               clk_div = ((freq / CPU_DIV_FREQ_MAX) & P0_7_CPUCLKDEV_MASK)
+                                       << P0_7_CPUCLKDEV_SHIFT;
+               clk_div |= ((freq / CPU_ATB_FREQ_MAX) & P0_7_ATBCLKDEV_MASK)
+                                       << P0_7_ATBCLKDEV_SHIFT;
+               clk_div |= ((freq / CPU_DBG_FREQ_MAX) & P0_7_CSCLKDEV_MASK)
+                                       << P0_7_CSCLKDEV_SHIFT;
+
+               /* Calculate EMA */
+               volt_id = opp_get_voltage(opp);

Please use RCU read locks as documented for OPP library.

Quoted 2 lines

Argh. I overlooked that and the series has been applied already. Care to send a fix against linux-pm.git/linux-next?

Will submit a patch with RCU lock changes.

Thanks,
Amit Daniel

Quoted 12 lines

Rafael

--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#8 lore raw

Re: [PATCH V6 1/4] cpufreq: exynos: Add cpufreq driver for exynos5440

In reply to Viresh Kumar
Quoted 11 lines · Viresh Kumar
Quoted 10 lines · Viresh Kumar
Quoted 8 lines · Amit Daniel Kachhap
drivers/cpufreq/Kconfig.arm +0 -0
index f3f3b14..bce2195 100644
@@ -42,6 +42,15 @@ config ARM_EXYNOS5250_CPUFREQ
          This adds the CPUFreq driver for Samsung EXYNOS5250
          SoC.
 
Quoted 8 lines
Quoted 6 lines

drivers/cpufreq/Kconfig.arm config ARM_EXYNOS5250_CPUFREQ · line 47

Quoted 3 lines
drivers/cpufreq/Kconfig.arm +3 -0
+config ARM_EXYNOS5440_CPUFREQ
+       def_bool SOC_EXYNOS5440
+       depends on HAVE_CLK && PM_OPP && OF

Don't you need a depend on your Soc or mach or arch? Don't send another version for this now.. Just send a new patch over this patchset.

Sorry, i overlooked def_bool... This comments stands invalid.

Ok, I resend this patch addressing all comments.

Thanks,
Amit

Quoted 5 lines

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#9 lore raw

PATCH v6 2/4 cpufreq: exynos: Remove error return even if no soc is found

In reply to Amit Daniel Kachhap

This patch helps to have single binary for exynos5440 and previous exynos soc's. This change is needed for adding exynos5440 cpufreq driver which does not uses exynos-cpufreq common file and adds it own driver.

Cc Viresh Kumar <[email protected]>
Cc Rafael J. Wysocki <[email protected]>
Cc Kukjin Kim <[email protected]>
---
 drivers/cpufreq/exynos-cpufreq.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/cpufreq/exynos-cpufreq.c +1 -1
index c0c4ce5..475b4f6 100644
@@ -294,7 +294,7 @@ static int __init exynos_cpufreq_init(void)
 	else if (soc_is_exynos5250())
 		ret = exynos5250_cpufreq_init(exynos_info);
 	else
-		pr_err("%s: CPU type not found\n", __func__);
+		return 0;
 
 	if (ret)
 		goto err_vdd_arm;
Signature · 1 line
1.7.1
#10 lore raw

PATCH v6 3/4 arm: exynos: Enable OPP library support for exynos5440

In reply to Amit Daniel Kachhap

The OPP library support is needed for exynos5440 cpu frequency dynamic scaling driver.

Cc Viresh Kumar <[email protected]>
Cc Rafael J. Wysocki <[email protected]>
Cc Kukjin Kim <[email protected]>
---
 arch/arm/mach-exynos/Kconfig |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/mach-exynos/Kconfig +2 -0
index 70f94c8..d5dde07 100644
@@ -72,10 +72,12 @@ config SOC_EXYNOS5440
 	bool "SAMSUNG EXYNOS5440"
 	default y
 	depends on ARCH_EXYNOS5
+	select ARCH_HAS_OPP
 	select ARM_ARCH_TIMER
 	select AUTO_ZRELADDR
 	select PINCTRL
 	select PINCTRL_EXYNOS5440
+	select PM_OPP
 	help
 	  Enable EXYNOS5440 SoC support
 
Signature · 1 line
1.7.1
#11 lore raw

PATCH v6 4/4 arm: dts: Add cpufreq controller node for Exynos5440 SoC

In reply to Amit Daniel Kachhap

Add cpufreq controller device node for Exynos5440 SoC for passing parameters like controller base address, interrupt and cpufreq table. This node is added outside cpu0 as this driver is now a platform driver and a new device structure is needed.

Cc Viresh Kumar <[email protected]>
Cc Rafael J. Wysocki <[email protected]>
Cc Kukjin Kim <[email protected]>
---
 arch/arm/boot/dts/exynos5440.dtsi |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
arch/arm/boot/dts/exynos5440.dtsi +12 -0
index 9a99755..94074ea 100644
@@ -63,6 +63,18 @@
 
 	};
 
+	cpufreq@160000 {
+		compatible = "samsung,exynos5440-cpufreq";
+		reg = <0x160000 0x1000>;
+		interrupts = <0 57 0>;
+		operating-points = <
+				/* KHz	  uV */
+				1200000 1025000
+				1000000 975000
+				800000  925000
+		>;
+	};
+
 	serial@B0000 {
 		compatible = "samsung,exynos4210-uart";
 		reg = <0xB0000 0x1000>;
Signature · 1 line
1.7.1
maintainer Acked-by on the v6 series
#12 lore raw
In reply to Amit Daniel Kachhap
Quoted 43 lines · Amit Daniel Kachhap

Submitting the V6 version of exynos5440 cpufreq driver. This patchset addresses all the coding and design concerns raised especially by Viresh.

Changes in V6:
* Used cpufreq post-change notifier call back in case of failure as pointed by Viresh.
* Called cpufreq_frequency_table_cpuinfo before calling cpufreq_frequency_table_get_attr as pointed by Viresh.
* Used modified API cpufreq_notify_transition.

Changes in V5:
* Removed the unnecessary DT look up entry from mach-exynos5-dt.c.
* Fixed all coding and comments issue raised by Viresh.

Changes in V4:
* Added dev_err logs instead of pr_err.
* Used the devm_ioremap_resource API.
* Implemented several coding guidelines and minor error comments from Sylwester, Russell and Viresh.

Changes in V3:
* Converted the driver to probe based as suggested by Viresh. This is also beneficial for multiplatform kernel.
* Other coding guidelines related changes.
* Moved the DT node outside cpu0 node as the driver is now a platform driver.

Changes in V2:
* Added OPP library support to parse DT parameters.
* Removed a hack to handle interrupts in bootup.
* Implemented other review comments from Viresh and Inder.

All these patches are dependent on Thomas Abraham common clock patches.
(http://www.mail-archive.com/[email protected]/msg15860.html)
This whole patch series is based on Rafael tree.
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git bleeding-edge

Amit Daniel Kachhap (4):
cpufreq: exynos: Add cpufreq driver for exynos5440
cpufreq: exynos: Remove error return even if no soc is found
arm: exynos: Enable OPP library support for exynos5440
arm: dts: Add cpufreq controller node for Exynos5440 SoC

Quoted 10 lines
 .../bindings/cpufreq/cpufreq-exynos5440.txt        |   28 ++
 arch/arm/boot/dts/exynos5440.dtsi                  |   12 +
 arch/arm/mach-exynos/Kconfig                       |    2 +
 drivers/cpufreq/Kconfig.arm                        |    9 +
 drivers/cpufreq/Makefile                           |    1 +
 drivers/cpufreq/exynos-cpufreq.c                   |    2 +-
 drivers/cpufreq/exynos5440-cpufreq.c               |  479 ++++++++++++++++++++
 7 files changed, 532 insertions(+), 1 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/cpufreq/cpufreq-exynos5440.txt
 create mode 100644 drivers/cpufreq/exynos5440-cpufreq.c

With the resent of 1/4,