Skip to contentSkip to conversation

Renesas ARM Based SoC Cpufreq Updates for v3.17

GIT PULL New Simon Horman 5 participants 6 messages Jun 23, 2014 – Jul 7, 2014

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

Hi Olof, Hi Kevin, Hi Arnd,

Please consider this Renesas ARM based SoC cpufreq update for v3.17.

The following changes since commit 7171511eaec5bf23fb06078f59784a3a0626b38f:

Linux 3.16-rc1 (2014-06-15 17:45:28 -1000)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git renesas-cpufreq-for-v3.17

for you to fetch changes up to 06e32c91dbce3c24ccbe84e3af2a35199662bca0:

ARM: shmobile: add cpufreq-cpu0 driver for common SH-Mobile (2014-06-16 19:50:54 +0900)

----------------------------------------------------------------
Renesas ARM Based SoC Cpufreq Updates for v3.17

* Add cpufreq-cpu0 driver

----------------------------------------------------------------
Gaku Inami (1):
ARM: shmobile: add cpufreq-cpu0 driver for common SH-Mobile

 arch/arm/mach-shmobile/Makefile              |  1 +
 arch/arm/mach-shmobile/cpufreq.c             | 31 ++++++++++++++++++++++++++++
 arch/arm/mach-shmobile/include/mach/common.h |  7 +++++++
 3 files changed, 39 insertions(+)
 create mode 100644 arch/arm/mach-shmobile/cpufreq.c
#1 lore raw

PATCH 1/1 ARM: shmobile: add cpufreq-cpu0 driver for common SH-Mobile

From: Gaku Inami <[email protected]>

I add a new file(cpufreq.c) for the following reasons.
- Registration of platform_device must be unified in SH-Mobile.
- We can't create a node of cpufreq drivers into device tree. (Because cpufreq driver is virtual device.)

---
 arch/arm/mach-shmobile/Makefile              |  1 +
 arch/arm/mach-shmobile/cpufreq.c             | 31 ++++++++++++++++++++++++++++
 arch/arm/mach-shmobile/include/mach/common.h |  7 +++++++
 3 files changed, 39 insertions(+)
 create mode 100644 arch/arm/mach-shmobile/cpufreq.c
arch/arm/mach-shmobile/Makefile +1 -0
index 38d5fe8..1b966da 100644
@@ -48,6 +48,7 @@ obj-$(CONFIG_ARCH_SH7372)	+= entry-intc.o
 # PM objects
 obj-$(CONFIG_SUSPEND)		+= suspend.o
 obj-$(CONFIG_CPU_IDLE)		+= cpuidle.o
+obj-$(CONFIG_CPU_FREQ)		+= cpufreq.o
 obj-$(CONFIG_ARCH_SH7372)	+= pm-sh7372.o sleep-sh7372.o pm-rmobile.o
 obj-$(CONFIG_ARCH_SH73A0)	+= pm-sh73a0.o
 obj-$(CONFIG_ARCH_R8A7740)	+= pm-r8a7740.o pm-rmobile.o
arch/arm/mach-shmobile/cpufreq.c new file +31 -0
new file mode 100644
index 0000000..e2c868f
@@ -0,0 +1,31 @@
+/*
+ * CPUFreq support code for SH-Mobile ARM
+ *
+ *  Copyright (C) 2014 Gaku Inami
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+
+#include <linux/of.h>
+#include <linux/of_device.h>
+#include <linux/platform_device.h>
+
+int __init shmobile_cpufreq_init(void)
+{
+	struct device_node *np;
+
+	np = of_cpu_device_node_get(0);
+	if (np == NULL) {
+		pr_err("failed to find cpu0 node\n");
+		return 0;
+	}
+
+	if (of_get_property(np, "operating-points", NULL))
+		platform_device_register_simple("cpufreq-cpu0", -1, NULL, 0);
+
+	of_node_put(np);
+
+	return 0;
+}
arch/arm/mach-shmobile/include/mach/common.h +7 -0
index f7a360e..921a18e 100644
@@ -45,12 +45,19 @@ int shmobile_cpuidle_init(void);
 static inline int shmobile_cpuidle_init(void) { return 0; }
 #endif
 
+#ifdef CONFIG_CPU_FREQ
+int shmobile_cpufreq_init(void);
+#else
+static inline int shmobile_cpufreq_init(void) { return 0; }
+#endif
+
 extern void __iomem *shmobile_scu_base;
 
 static inline void __init shmobile_init_late(void)
 {
 	shmobile_suspend_init();
 	shmobile_cpuidle_init();
+	shmobile_cpufreq_init();
 }
 
 #endif /* __ARCH_MACH_COMMON_H */
Signature · 1 line
2.0.0.rc2
#2 lore raw

PATCH 1/1 ARM: shmobile: add cpufreq-cpu0 driver for common SH-Mobile

arch/arm/mach-shmobile/cpufreq.c line 25

Quoted 13 lines · Simon Horman
arch/arm/mach-shmobile/cpufreq.c +11 -0
 
+int __init shmobile_cpufreq_init(void)
+{
+       struct device_node *np;
+
+       np = of_cpu_device_node_get(0);
+       if (np == NULL) {
+               pr_err("failed to find cpu0 node\n");
+               return 0;
+       }
+
+       if (of_get_property(np, "operating-points", NULL))

Probably you don't need any of above checks as these are done from cpufreq-cpu0 probe as well.. So, simply create a platform device and let cpufreq-cpu0 driver decide its fate.

Quoted 6 lines
arch/arm/mach-shmobile/cpufreq.c +6 -0
+               platform_device_register_simple("cpufreq-cpu0", -1, NULL, 0);
+
+       of_node_put(np);
+
+       return 0;
+}
#3 lore raw

PATCH 1/1 ARM: shmobile: add cpufreq-cpu0 driver for common SH-Mobile

Quoted 4 lines · Viresh Kumar
Quoted 1 line · Simon Horman
arch/arm/mach-shmobile/cpufreq.c +0 -0
Quoted 15 lines

arch/arm/mach-shmobile/cpufreq.c line 25

Quoted 11 lines
arch/arm/mach-shmobile/cpufreq.c +11 -0
+int __init shmobile_cpufreq_init(void)
+{
+       struct device_node *np;
+
+       np = of_cpu_device_node_get(0);
+       if (np == NULL) {
+               pr_err("failed to find cpu0 node\n");
+               return 0;
+       }
+
+       if (of_get_property(np, "operating-points", NULL))

Probably you don't need any of above checks as these are done from cpufreq-cpu0 probe as well.. So, simply create a platform device and let cpufreq-cpu0 driver decide its fate.

Thanks.

Inami-san, could you look into this and make an incremental patch as appropriate?

Quoted 12 lines

arch/arm/mach-shmobile/cpufreq.c line 31

Quoted 7 lines
arch/arm/mach-shmobile/cpufreq.c +6 -0
+               platform_device_register_simple("cpufreq-cpu0", -1, NULL, 0);
+
+       of_node_put(np);
+
+       return 0;
+}

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

#4 lore raw

PATCH 1/1 ARM: shmobile: add cpufreq-cpu0 driver for common SH-Mobile

Quoted 18 lines · Simon Horman
Quoted 17 lines · Viresh Kumar

arch/arm/mach-shmobile/cpufreq.c line 25

Quoted 12 lines · Simon Horman
arch/arm/mach-shmobile/cpufreq.c +11 -0
+int __init shmobile_cpufreq_init(void)
+{
+       struct device_node *np;
+
+       np = of_cpu_device_node_get(0);
+       if (np == NULL) {
+               pr_err("failed to find cpu0 node\n");
+               return 0;
+       }
+
+       if (of_get_property(np, "operating-points", NULL))

Probably you don't need any of above checks as these are done from cpufreq-cpu0 probe as well.. So, simply create a platform device and let cpufreq-cpu0 driver decide its fate.

Quoted 4 lines

Thanks.

Inami-san, could you look into this and make an incremental patch as appropriate?

Thank you for your feedback.
I will make an incremental patch based on renesas-devel-v3.16-rc2-20140623.

#5 lore raw
In reply to Simon Horman
Quoted 13 lines · Simon Horman

Hi Olof, Hi Kevin, Hi Arnd,

Please consider this Renesas ARM based SoC cpufreq update for v3.17.

The following changes since commit 7171511eaec5bf23fb06078f59784a3a0626b38f:

Linux 3.16-rc1 (2014-06-15 17:45:28 -1000)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git renesas-cpufreq-for-v3.17

Quoted 9 lines

for you to fetch changes up to 06e32c91dbce3c24ccbe84e3af2a35199662bca0:

ARM: shmobile: add cpufreq-cpu0 driver for common SH-Mobile (2014-06-16 19:50:54 +0900)

----------------------------------------------------------------
Renesas ARM Based SoC Cpufreq Updates for v3.17

* Add cpufreq-cpu0 driver

Technically inaccurate (for next time): This doesn't add a driver, it adds registration of a device.

Merged into next/soc.

-Olof