Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1286538 > unrolled thread
| Started by | Lee Jones <lee.jones@linaro.org> |
|---|---|
| First post | 2015-12-08 15:40 +0100 |
| Last post | 2015-12-09 12:30 +0100 |
| Articles | 5 — 3 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v5 08/11] ARM: STi: Register CPUFreq device Lee Jones <lee.jones@linaro.org> - 2015-12-08 15:40 +0100
Re: [PATCH v5 08/11] ARM: STi: Register CPUFreq device Viresh Kumar <viresh.kumar@linaro.org> - 2015-12-09 03:40 +0100
Re: [PATCH v5 08/11] ARM: STi: Register CPUFreq device Viresh Kumar <viresh.kumar@linaro.org> - 2015-12-09 10:20 +0100
Re: [PATCH v5 08/11] ARM: STi: Register CPUFreq device Arnd Bergmann <arnd@arndb.de> - 2015-12-09 10:20 +0100
Re: [PATCH v5 08/11] ARM: STi: Register CPUFreq device Lee Jones <lee.jones@linaro.org> - 2015-12-09 12:30 +0100
| From | Lee Jones <lee.jones@linaro.org> |
|---|---|
| Date | 2015-12-08 15:40 +0100 |
| Subject | [PATCH v5 08/11] ARM: STi: Register CPUFreq device |
| Message-ID | <qDrAS-3yq-23@gated-at.bofh.it> |
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} | 1 +
4 files changed, 19 insertions(+), 4 deletions(-)
rename arch/arm/mach-sti/{platsmp.c => cpu.c} (93%)
rename arch/arm/mach-sti/{smp.h => cpu.h} (93%)
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 ae10fb2..60b23a7 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 *const stih41x_dt_match[] __initconst = {
"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 93%
rename from arch/arm/mach-sti/platsmp.c
rename to arch/arm/mach-sti/cpu.c
index c4ad6ea..335ecaf 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>
@@ -21,13 +22,17 @@
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/memblock.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;
@@ -161,3 +166,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 93%
rename from arch/arm/mach-sti/smp.h
rename to arch/arm/mach-sti/cpu.h
index ae22707..957c4d1 100644
--- a/arch/arm/mach-sti/smp.h
+++ b/arch/arm/mach-sti/cpu.h
@@ -15,5 +15,6 @@
extern struct smp_operations sti_smp_ops;
void sti_secondary_startup(void);
+extern void init_cpufreq(void);
#endif
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| Date | 2015-12-09 03:40 +0100 |
| Message-ID | <qDCPD-2c5-1@gated-at.bofh.it> |
| In reply to | #1286538 |
On 08-12-15, 14:32, Lee Jones wrote:
> +/**
> + * SMP Operations
> + */
Why do you need a documentation style comment here?
> static void write_pen_release(int val)
> {
> pen_release = val;
> @@ -161,3 +166,11 @@ struct smp_operations __initdata sti_smp_ops = {
> .smp_secondary_init = sti_secondary_init,
> .smp_boot_secondary = sti_boot_secondary,
> };
> +
> +/**
> + * CPUFreq Registration
> + */
Here too.
> +void init_cpufreq(void)
> +{
> + platform_device_register_simple("sti-cpufreq", -1, NULL, 0);
> +}
I don't think you need this, as you can do all the stuff you want from
the module_init() function in the driver. You just have to make sure
that your driver is only compilable and workable on the right STi platform.
--
viresh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| Date | 2015-12-09 10:20 +0100 |
| Message-ID | <qDJ4J-6qQ-1@gated-at.bofh.it> |
| In reply to | #1286538 |
On 09-12-15, 10:15, Arnd Bergmann wrote:
> On Tuesday 08 December 2015 14:32:01 Lee Jones wrote:
> > @@ -161,3 +166,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);
> > +}
> >
>
> Can you please do this under drivers/cpufreq somewhere?
>
> I really don't want to any more of these in platform code. Requiring a
> device to be created just to probe the driver is really silly.
He is actually creating two device right now..
- create sti-cpufreq device
- so that sti-cpufreq driver get probed
- And fix OPPs here first and then create cpufreq-dt device
- so that cpufreq-dt driver get probed
:)
I already recommended him that he can replace the first two points by
doing things from module_init() instead. And then create cpufreq-dt
device.
--
viresh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2015-12-09 10:20 +0100 |
| Message-ID | <qDJ4J-6qQ-3@gated-at.bofh.it> |
| In reply to | #1286538 |
On Tuesday 08 December 2015 14:32:01 Lee Jones wrote:
> @@ -161,3 +166,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);
> +}
>
Can you please do this under drivers/cpufreq somewhere?
I really don't want to any more of these in platform code. Requiring a
device to be created just to probe the driver is really silly.
Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Lee Jones <lee.jones@linaro.org> |
|---|---|
| Date | 2015-12-09 12:30 +0100 |
| Message-ID | <qDL6y-7It-3@gated-at.bofh.it> |
| In reply to | #1287224 |
On Wed, 09 Dec 2015, Arnd Bergmann wrote:
> On Tuesday 08 December 2015 14:32:01 Lee Jones wrote:
> > @@ -161,3 +166,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);
> > +}
> >
>
> Can you please do this under drivers/cpufreq somewhere?
>
> I really don't want to any more of these in platform code. Requiring a
> device to be created just to probe the driver is really silly.
Already on it. Bear with.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web