From: Lee Jones <lee.jones@linaro.org>
To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: kernel@stlinux.com, rjw@rjwysocki.net, viresh.kumar@linaro.org,
linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
ajitpal.singh@st.com, Lee Jones <lee.jones@linaro.org>
Subject: [PATCH v2 5/9] ARM: STi: Register CPUFreq device
Date: Wed, 24 Jun 2015 14:59:04 +0100 [thread overview]
Message-ID: <1435154348-28840-6-git-send-email-lee.jones@linaro.org> (raw)
In-Reply-To: <1435154348-28840-1-git-send-email-lee.jones@linaro.org>
DT will not allow pseudo-devices. Only devices which represent real
hardware are permitted. So we have to register the CPUFreq driver
from platform code instead.
Rather than create a new file, we're bundling this in with the SMP
functionality and renaming it from 'smp' to the more generic 'cpu'.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
arch/arm/mach-sti/Makefile | 2 +-
arch/arm/mach-sti/board-dt.c | 3 ++-
arch/arm/mach-sti/{platsmp.c => cpu.c} | 17 +++++++++++++++--
arch/arm/mach-sti/{smp.h => cpu.h} | 2 ++
4 files changed, 20 insertions(+), 4 deletions(-)
rename arch/arm/mach-sti/{platsmp.c => cpu.c} (91%)
rename arch/arm/mach-sti/{smp.h => cpu.h} (92%)
diff --git a/arch/arm/mach-sti/Makefile b/arch/arm/mach-sti/Makefile
index acb3309..caaeeaa 100644
--- a/arch/arm/mach-sti/Makefile
+++ b/arch/arm/mach-sti/Makefile
@@ -1,2 +1,2 @@
-obj-$(CONFIG_SMP) += platsmp.o headsmp.o
+obj-$(CONFIG_SMP) += cpu.o headsmp.o
obj-$(CONFIG_ARCH_STI) += board-dt.o
diff --git a/arch/arm/mach-sti/board-dt.c b/arch/arm/mach-sti/board-dt.c
index b373aca..482159f 100644
--- a/arch/arm/mach-sti/board-dt.c
+++ b/arch/arm/mach-sti/board-dt.c
@@ -12,7 +12,7 @@
#include <asm/hardware/cache-l2x0.h>
#include <asm/mach/arch.h>
-#include "smp.h"
+#include "cpu.h"
static const char *stih41x_dt_match[] __initdata = {
"st,stih415",
@@ -31,4 +31,5 @@ DT_MACHINE_START(STM, "STiH415/416 SoC with Flattened Device Tree")
L2C_AUX_CTRL_WAY_SIZE(4),
.l2c_aux_mask = 0xc0000fff,
.smp = smp_ops(sti_smp_ops),
+ .init_late = init_cpufreq,
MACHINE_END
diff --git a/arch/arm/mach-sti/platsmp.c b/arch/arm/mach-sti/cpu.c
similarity index 91%
rename from arch/arm/mach-sti/platsmp.c
rename to arch/arm/mach-sti/cpu.c
index d4b624f..283cb30 100644
--- a/arch/arm/mach-sti/platsmp.c
+++ b/arch/arm/mach-sti/cpu.c
@@ -1,5 +1,5 @@
/*
- * arch/arm/mach-sti/platsmp.c
+ * arch/arm/mach-sti/cpu.c
*
* Copyright (C) 2013 STMicroelectronics (R&D) Limited.
* http://www.st.com
@@ -13,6 +13,7 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
+
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/delay.h>
@@ -20,13 +21,17 @@
#include <linux/io.h>
#include <linux/of.h>
#include <linux/of_address.h>
+#include <linux/platform_device.h>
#include <asm/cacheflush.h>
#include <asm/smp_plat.h>
#include <asm/smp_scu.h>
-#include "smp.h"
+#include "cpu.h"
+/**
+ * SMP Operations
+ */
static void write_pen_release(int val)
{
pen_release = val;
@@ -114,3 +119,11 @@ struct smp_operations __initdata sti_smp_ops = {
.smp_secondary_init = sti_secondary_init,
.smp_boot_secondary = sti_boot_secondary,
};
+
+/**
+ * CPUFreq Registration
+ */
+void init_cpufreq(void)
+{
+ platform_device_register_simple("sti-cpufreq", -1, NULL, 0);
+}
diff --git a/arch/arm/mach-sti/smp.h b/arch/arm/mach-sti/cpu.h
similarity index 92%
rename from arch/arm/mach-sti/smp.h
rename to arch/arm/mach-sti/cpu.h
index 1871b72..39e05ff 100644
--- a/arch/arm/mach-sti/smp.h
+++ b/arch/arm/mach-sti/cpu.h
@@ -14,4 +14,6 @@
extern struct smp_operations sti_smp_ops;
+extern void init_cpufreq(void);
+
#endif
--
1.9.1
next prev parent reply other threads:[~2015-06-24 13:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-24 13:58 [PATCH v2 0/9] cpufreq: Introduce support for ST's cpufreq functionality Lee Jones
2015-06-24 13:59 ` [PATCH v2 1/9] ARM: STi: STiH407: Provide generic (safe) DVFS configuration Lee Jones
2015-06-24 13:59 ` [PATCH v2 2/9] ARM: STi: STiH407: Provide CPU with clocking information Lee Jones
2015-06-24 13:59 ` [PATCH v2 3/9] ARM: STi: STiH407: Link CPU with its voltage supply Lee Jones
2015-06-24 13:59 ` [PATCH v2 4/9] ARM: STi: STiH407: Provide CPU with a means to look-up Major number Lee Jones
2015-06-24 13:59 ` Lee Jones [this message]
2015-06-24 13:59 ` [PATCH v2 6/9] ARM: STi: STiH407: Move PWM nodes STiH407 => STiH407-family Lee Jones
2015-06-24 13:59 ` [PATCH v2 8/9] dt: cpufreq: st: Provide bindings for ST's CPUFreq implementation Lee Jones
2015-06-24 13:59 ` [PATCH v2 9/9] cpufreq: st: Provide runtime initialised driver for ST's platforms Lee Jones
[not found] ` <1435154348-28840-1-git-send-email-lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-06-24 13:59 ` [PATCH v2 7/9] ARM: multi_v7_defconfig: Enable support for PWM Regulators Lee Jones
2015-06-24 14:52 ` Javier Martinez Canillas
2015-06-25 8:42 ` Lee Jones
2015-06-25 9:18 ` Javier Martinez Canillas
2015-06-25 15:02 ` Lee Jones
2015-06-25 16:29 ` Javier Martinez Canillas
2015-07-01 12:31 ` Lee Jones
2015-07-08 10:50 ` [PATCH v2 0/9] cpufreq: Introduce support for ST's cpufreq functionality Viresh Kumar
2015-07-08 10:59 ` Lee Jones
2015-07-08 11:12 ` Viresh Kumar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1435154348-28840-6-git-send-email-lee.jones@linaro.org \
--to=lee.jones@linaro.org \
--cc=ajitpal.singh@st.com \
--cc=devicetree@vger.kernel.org \
--cc=kernel@stlinux.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).