All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/10] Per SoC descriptor
@ 2011-10-03 17:35 Marc Zyngier
  2011-10-03 17:35 ` [PATCH v4 01/10] ARM: SoC: Introduce per " Marc Zyngier
                   ` (9 more replies)
  0 siblings, 10 replies; 24+ messages in thread
From: Marc Zyngier @ 2011-10-03 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

This patch series introduces a per-soc descriptor which should, in the
end, contain most of the SoC specific operations.

This first patch series introduces the arm_soc_desc structure, adds
per-soc SMP and CPU hotplug operations, and converts all SMP platform
to this new scheme.

Patches against next-20110930. Tested on VExpress (A5 and A15),
RealView EB-11MP, OMAP4 (Panda) and Tegra2 (Harmony).

Changelog:

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH v4 01/10] ARM: SoC: Introduce per SoC descriptor
  2011-10-03 17:35 [PATCH v4 00/10] Per SoC descriptor Marc Zyngier
@ 2011-10-03 17:35 ` Marc Zyngier
  2011-10-03 17:35 ` [PATCH v4 02/10] ARM: SoC: Add per SoC SMP and CPU hotplug operations Marc Zyngier
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 24+ messages in thread
From: Marc Zyngier @ 2011-10-03 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

The ARM core code expects the various SoCs to hide their
implementation differences behind a well established API.
The various sub-arch-specific bit are often either at
the machine descriptor level, or provided at link time
by the sub-arch code.

The SoC descriptor is a container that holds the SoC
specific bits that can be moved away from the machine
descriptor as well as an indirection point for the
global symbols (SMP and CPU hotplug support, for example).

This patch introduce this SoC descriptor, with the only field
being the name of the SoC.

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm/include/asm/mach/arch.h |    2 ++
 arch/arm/include/asm/soc.h       |   21 +++++++++++++++++++++
 arch/arm/kernel/setup.c          |    9 +++++++++
 3 files changed, 32 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/asm/soc.h

diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
index 7d19425..a366432 100644
--- a/arch/arm/include/asm/mach/arch.h
+++ b/arch/arm/include/asm/mach/arch.h
@@ -13,6 +13,7 @@
 struct tag;
 struct meminfo;
 struct sys_timer;
+struct arm_soc_desc;
 
 struct machine_desc {
 	unsigned int		nr;		/* architecture number	*/
@@ -34,6 +35,7 @@ struct machine_desc {
 	unsigned int		reserve_lp1 :1;	/* never has lp1	*/
 	unsigned int		reserve_lp2 :1;	/* never has lp2	*/
 	unsigned int		soft_reboot :1;	/* soft reboot		*/
+	struct arm_soc_desc	*soc;		/* SoC descriptor	*/
 	void			(*fixup)(struct tag *, char **,
 					 struct meminfo *);
 	void			(*reserve)(void);/* reserve mem blocks	*/
diff --git a/arch/arm/include/asm/soc.h b/arch/arm/include/asm/soc.h
new file mode 100644
index 0000000..ce92784
--- /dev/null
+++ b/arch/arm/include/asm/soc.h
@@ -0,0 +1,21 @@
+/*
+ *  linux/arch/arm/include/asm/soc.h
+ *
+ *  Copyright (C) 2011 ARM Ltd.
+ *  All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __ASM_ARM_SOC_H
+#define __ASM_ARM_SOC_H
+
+struct arm_soc_desc {
+	const char		*name;
+};
+
+extern const struct arm_soc_desc	*soc_desc;
+
+#endif	/* __ASM_ARM_SOC_H */
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index d399777..34ffb2e 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -45,6 +45,7 @@
 #include <asm/cachetype.h>
 #include <asm/tlbflush.h>
 #include <asm/system.h>
+#include <asm/soc.h>
 
 #include <asm/prom.h>
 #include <asm/mach/arch.h>
@@ -140,6 +141,8 @@ static const char *cpu_name;
 static const char *machine_name;
 static char __initdata cmd_line[COMMAND_LINE_SIZE];
 struct machine_desc *machine_desc __initdata;
+const struct arm_soc_desc *soc_desc;
+static struct arm_soc_desc __soc_desc __read_mostly;
 
 static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
 static union { char c[4]; unsigned long l; } endian_test __initdata = { { 'l', '?', '?', 'b' } };
@@ -913,6 +916,12 @@ void __init setup_arch(char **cmdline_p)
 		mdesc = setup_machine_tags(machine_arch_type);
 	machine_desc = mdesc;
 	machine_name = mdesc->name;
+	if (mdesc->soc) {
+		__soc_desc = *mdesc->soc;
+		soc_desc = &__soc_desc;
+		pr_info("SoC: %s\n", soc_desc->name);
+	} else
+		soc_desc = NULL;
 
 	if (mdesc->soft_reboot)
 		reboot_setup("s");
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v4 02/10] ARM: SoC: Add per SoC SMP and CPU hotplug operations
  2011-10-03 17:35 [PATCH v4 00/10] Per SoC descriptor Marc Zyngier
  2011-10-03 17:35 ` [PATCH v4 01/10] ARM: SoC: Introduce per " Marc Zyngier
@ 2011-10-03 17:35 ` Marc Zyngier
  2011-10-03 19:12   ` Nicolas Pitre
  2011-10-04 10:30   ` Kyungmin Park
  2011-10-03 17:35 ` [PATCH v4 03/10] ARM: SoC: convert VExpress/RealView to SoC descriptor Marc Zyngier
                   ` (7 subsequent siblings)
  9 siblings, 2 replies; 24+ messages in thread
From: Marc Zyngier @ 2011-10-03 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

Populate the SoC descriptor structure with the SMP and CPU hotplug
operations. To allow the kernel to continue building, the platform
hooks are defined as weak symbols which are overrided by the
platform code. Once all platforms are converted, the "weak" attribute
will be removed and the function made static.

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm/include/asm/soc.h |   48 ++++++++++++++++++++++++++++++++++++++++++-
 arch/arm/kernel/setup.c    |   29 ++++++++++++++++++++++---
 arch/arm/kernel/smp.c      |   47 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 118 insertions(+), 6 deletions(-)

diff --git a/arch/arm/include/asm/soc.h b/arch/arm/include/asm/soc.h
index ce92784..f1dd657 100644
--- a/arch/arm/include/asm/soc.h
+++ b/arch/arm/include/asm/soc.h
@@ -12,10 +12,54 @@
 #ifndef __ASM_ARM_SOC_H
 #define __ASM_ARM_SOC_H
 
+struct task_struct;
+
+struct arm_soc_smp_init_ops {
+	/*
+	 * Setup the set of possible CPUs (via set_cpu_possible)
+	 */
+	void (*smp_init_cpus)(void);
+	/*
+	 * Initialize cpu_possible map, and enable coherency
+	 */
+	void (*smp_prepare_cpus)(unsigned int max_cpus);
+};
+
+struct arm_soc_smp_ops {
+	/*
+	 * Perform platform specific initialisation of the specified CPU.
+	 */
+	void (*smp_secondary_init)(unsigned int cpu);
+	/*
+	 * Boot a secondary CPU, and assign it the specified idle task.
+	 * This also gives us the initial stack to use for this CPU.
+	 */
+	int  (*smp_boot_secondary)(unsigned int cpu, struct task_struct *idle);
+#ifdef CONFIG_HOTPLUG_CPU
+	int  (*cpu_kill)(unsigned int cpu);
+	void (*cpu_die)(unsigned int cpu);
+	int  (*cpu_disable)(unsigned int cpu);
+#endif
+};
+
 struct arm_soc_desc {
-	const char		*name;
+	const char			*name;
+#ifdef CONFIG_SMP
+	struct arm_soc_smp_init_ops	*smp_init_ops;
+	struct arm_soc_smp_ops		*smp_ops;
+#endif
 };
 
-extern const struct arm_soc_desc	*soc_desc;
+#ifdef CONFIG_SMP
+#define soc_smp_init_ops(ops)	.smp_init_ops = &(ops),
+#define soc_smp_ops(ops)	.smp_ops = &(ops),
+#else
+#define soc_smp_init_ops(ops)	/* empty */
+#define soc_smp_ops(ops)	/* empty */
+#endif
+
+extern const struct arm_soc_desc		*soc_desc;
+extern const struct arm_soc_smp_init_ops	*soc_smp_init_ops;
+extern const struct arm_soc_smp_ops		*soc_smp_ops;
 
 #endif	/* __ASM_ARM_SOC_H */
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 34ffb2e..351ae18 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -141,8 +141,12 @@ static const char *cpu_name;
 static const char *machine_name;
 static char __initdata cmd_line[COMMAND_LINE_SIZE];
 struct machine_desc *machine_desc __initdata;
-const struct arm_soc_desc *soc_desc;
-static struct arm_soc_desc __soc_desc __read_mostly;
+const struct arm_soc_desc *soc_desc __initdata;
+#ifdef CONFIG_SMP
+const struct arm_soc_smp_init_ops *soc_smp_init_ops  __initdata;
+const struct arm_soc_smp_ops *soc_smp_ops  __cpuinitdata;
+static struct arm_soc_smp_ops __soc_smp_ops __cpuinitdata;
+#endif
 
 static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
 static union { char c[4]; unsigned long l; } endian_test __initdata = { { 'l', '?', '?', 'b' } };
@@ -917,11 +921,28 @@ void __init setup_arch(char **cmdline_p)
 	machine_desc = mdesc;
 	machine_name = mdesc->name;
 	if (mdesc->soc) {
-		__soc_desc = *mdesc->soc;
-		soc_desc = &__soc_desc;
+		soc_desc = mdesc->soc;
 		pr_info("SoC: %s\n", soc_desc->name);
 	} else
 		soc_desc = NULL;
+#ifdef CONFIG_SMP
+	if (soc_desc && soc_desc->smp_init_ops)
+		soc_smp_init_ops = soc_desc->smp_init_ops;
+	else
+		soc_smp_ops = NULL;
+
+	/*
+	 * Warning: we're copying an __initdata structure into a
+	 * __cpuinitdata structure. We *know* it is valid because only
+	 * __cpuinit (or more persistant) functions should be pointed
+	 * to by soc_smp_ops. Still, this is borderline ugly.
+	 */
+	if (soc_desc && soc_desc->smp_ops) {
+		__soc_smp_ops = *soc_desc->smp_ops;
+		soc_smp_ops = &__soc_smp_ops;
+	} else
+		soc_smp_ops = NULL;
+#endif
 
 	if (mdesc->soft_reboot)
 		reboot_setup("s");
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 8bb30c2..e08d2e8 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -28,6 +28,7 @@
 #include <linux/completion.h>
 
 #include <linux/atomic.h>
+#include <asm/soc.h>
 #include <asm/cacheflush.h>
 #include <asm/cpu.h>
 #include <asm/cputype.h>
@@ -155,9 +156,55 @@ int __cpuinit __cpu_up(unsigned int cpu)
 	return ret;
 }
 
+/* SoC helpers */
+void __attribute__((weak)) __init smp_init_cpus(void)
+{
+	if (soc_smp_init_ops && soc_smp_init_ops->smp_init_cpus)
+		soc_smp_init_ops->smp_init_cpus();
+}
+
+void __attribute__((weak)) __init platform_smp_prepare_cpus(unsigned int max_cpus)
+{
+	if (soc_smp_ops && soc_smp_init_ops->smp_prepare_cpus)
+		soc_smp_init_ops->smp_prepare_cpus(max_cpus);
+}
+
+void __attribute__((weak)) __cpuinit platform_secondary_init(unsigned int cpu)
+{
+	if (soc_smp_ops && soc_smp_ops->smp_secondary_init)
+		soc_smp_ops->smp_secondary_init(cpu);
+}
+
+int __attribute__((weak)) __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
+{
+	if (soc_smp_ops && soc_smp_ops->smp_boot_secondary)
+		return soc_smp_ops->smp_boot_secondary(cpu, idle);
+	return -ENOSYS;
+}
+
 #ifdef CONFIG_HOTPLUG_CPU
 static void percpu_timer_stop(void);
 
+int __attribute__((weak)) __cpuinit platform_cpu_kill(unsigned int cpu)
+{
+	if (soc_smp_ops && soc_smp_ops->cpu_kill)
+		return soc_smp_ops->cpu_kill(cpu);
+	return 0;
+}
+
+void __attribute__((weak)) __cpuinit platform_cpu_die(unsigned int cpu)
+{
+	if (soc_smp_ops && soc_smp_ops->cpu_die)
+		soc_smp_ops->cpu_die(cpu);
+}
+
+int __attribute__((weak)) __cpuinit platform_cpu_disable(unsigned int cpu)
+{
+	if (soc_smp_ops && soc_smp_ops->cpu_disable)
+		return soc_smp_ops->cpu_disable(cpu);
+	return -EPERM;
+}
+
 /*
  * __cpu_disable runs on the processor to be shutdown.
  */
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v4 03/10] ARM: SoC: convert VExpress/RealView to SoC descriptor
  2011-10-03 17:35 [PATCH v4 00/10] Per SoC descriptor Marc Zyngier
  2011-10-03 17:35 ` [PATCH v4 01/10] ARM: SoC: Introduce per " Marc Zyngier
  2011-10-03 17:35 ` [PATCH v4 02/10] ARM: SoC: Add per SoC SMP and CPU hotplug operations Marc Zyngier
@ 2011-10-03 17:35 ` Marc Zyngier
  2011-10-03 17:35 ` [PATCH v4 04/10] ARM: SoC: convert OMAP4 " Marc Zyngier
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 24+ messages in thread
From: Marc Zyngier @ 2011-10-03 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

Convert both Realview and VExpress to use the SoC descriptor to
provide their SMP and CPU hotplug operation.

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm/mach-realview/core.c                  |    7 +++++++
 arch/arm/mach-realview/core.h                  |    9 +++++++++
 arch/arm/mach-realview/hotplug.c               |    6 +++---
 arch/arm/mach-realview/platsmp.c               |   24 ++++++++++++++++++++----
 arch/arm/mach-realview/realview_eb.c           |    1 +
 arch/arm/mach-realview/realview_pb1176.c       |    1 +
 arch/arm/mach-realview/realview_pb11mp.c       |    1 +
 arch/arm/mach-realview/realview_pba8.c         |    1 +
 arch/arm/mach-realview/realview_pbx.c          |    1 +
 arch/arm/mach-vexpress/core.h                  |   10 ++++++++++
 arch/arm/mach-vexpress/hotplug.c               |    6 +++---
 arch/arm/mach-vexpress/platsmp.c               |   24 ++++++++++++++++++++----
 arch/arm/mach-vexpress/v2m.c                   |    9 +++++++++
 arch/arm/plat-versatile/include/plat/platsmp.h |   14 ++++++++++++++
 arch/arm/plat-versatile/platsmp.c              |    4 ++--
 15 files changed, 102 insertions(+), 16 deletions(-)
 create mode 100644 arch/arm/plat-versatile/include/plat/platsmp.h

diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index d5ed5d4..e84e6b2 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -33,6 +33,7 @@
 #include <linux/clkdev.h>
 #include <linux/mtd/physmap.h>
 
+#include <asm/soc.h>
 #include <asm/system.h>
 #include <mach/hardware.h>
 #include <asm/irq.h>
@@ -533,3 +534,9 @@ void realview_fixup(struct tag *tags, char **from, struct meminfo *meminfo)
 	meminfo->nr_banks = 1;
 #endif
 }
+
+struct arm_soc_desc realview_soc_desc __initdata = {
+	.name		= "ARM RealView Platform",
+	soc_smp_init_ops(realview_soc_smp_init_ops)
+	soc_smp_ops(realview_soc_smp_ops)
+};
diff --git a/arch/arm/mach-realview/core.h b/arch/arm/mach-realview/core.h
index 47259c8..a262e4e 100644
--- a/arch/arm/mach-realview/core.h
+++ b/arch/arm/mach-realview/core.h
@@ -27,6 +27,7 @@
 
 #include <asm/setup.h>
 #include <asm/leds.h>
+#include <asm/soc.h>
 
 #define AMBA_DEVICE(name,busid,base,plat)			\
 static struct amba_device name##_device = {			\
@@ -67,4 +68,12 @@ extern void realview_fixup(struct tag *tags, char **from,
 			   struct meminfo *meminfo);
 extern void (*realview_reset)(char);
 
+extern struct arm_soc_desc		realview_soc_desc;
+extern struct arm_soc_smp_init_ops	realview_soc_smp_init_ops;
+extern struct arm_soc_smp_ops		realview_soc_smp_ops;
+
+extern int  realview_cpu_kill(unsigned int cpu);
+extern void realview_cpu_die(unsigned int cpu);
+extern int  realview_cpu_disable(unsigned int cpu);
+
 #endif
diff --git a/arch/arm/mach-realview/hotplug.c b/arch/arm/mach-realview/hotplug.c
index ac1aed2..c8adf5c 100644
--- a/arch/arm/mach-realview/hotplug.c
+++ b/arch/arm/mach-realview/hotplug.c
@@ -87,7 +87,7 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
 	}
 }
 
-int platform_cpu_kill(unsigned int cpu)
+int realview_cpu_kill(unsigned int cpu)
 {
 	return 1;
 }
@@ -97,7 +97,7 @@ int platform_cpu_kill(unsigned int cpu)
  *
  * Called with IRQs disabled
  */
-void platform_cpu_die(unsigned int cpu)
+void realview_cpu_die(unsigned int cpu)
 {
 	int spurious = 0;
 
@@ -117,7 +117,7 @@ void platform_cpu_die(unsigned int cpu)
 		pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious);
 }
 
-int platform_cpu_disable(unsigned int cpu)
+int realview_cpu_disable(unsigned int cpu)
 {
 	/*
 	 * we don't allow CPU 0 to be shutdown (it is still too special
diff --git a/arch/arm/mach-realview/platsmp.c b/arch/arm/mach-realview/platsmp.c
index 4ae943b..92be3eb 100644
--- a/arch/arm/mach-realview/platsmp.c
+++ b/arch/arm/mach-realview/platsmp.c
@@ -18,14 +18,15 @@
 #include <asm/mach-types.h>
 #include <asm/smp_scu.h>
 #include <asm/unified.h>
+#include <asm/soc.h>
 
 #include <mach/board-eb.h>
 #include <mach/board-pb11mp.h>
 #include <mach/board-pbx.h>
 
-#include "core.h"
+#include <plat/platsmp.h>
 
-extern void versatile_secondary_startup(void);
+#include "core.h"
 
 static void __iomem *scu_base_addr(void)
 {
@@ -44,7 +45,7 @@ static void __iomem *scu_base_addr(void)
  * Initialise the CPU possible map early - this describes the CPUs
  * which may be present or become present in the system.
  */
-void __init smp_init_cpus(void)
+static void __init realview_smp_init_cpus(void)
 {
 	void __iomem *scu_base = scu_base_addr();
 	unsigned int i, ncores;
@@ -66,7 +67,7 @@ void __init smp_init_cpus(void)
 	set_smp_cross_call(gic_raise_softirq);
 }
 
-void __init platform_smp_prepare_cpus(unsigned int max_cpus)
+static void __init realview_smp_prepare_cpus(unsigned int max_cpus)
 {
 
 	scu_enable(scu_base_addr());
@@ -80,3 +81,18 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
 	__raw_writel(BSYM(virt_to_phys(versatile_secondary_startup)),
 		     __io_address(REALVIEW_SYS_FLAGSSET));
 }
+
+struct arm_soc_smp_init_ops realview_soc_smp_init_ops __initdata = {
+	.smp_init_cpus		= realview_smp_init_cpus,
+	.smp_prepare_cpus	= realview_smp_prepare_cpus,
+};
+
+struct arm_soc_smp_ops realview_soc_smp_ops __initdata = {
+	.smp_secondary_init	= versatile_secondary_init,
+	.smp_boot_secondary	= versatile_boot_secondary,
+#ifdef CONFIG_HOTPLUG_CPU
+	.cpu_kill		= realview_cpu_kill,
+	.cpu_die		= realview_cpu_die,
+	.cpu_disable		= realview_cpu_disable,
+#endif
+};
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c
index 026c66a..427e44e 100644
--- a/arch/arm/mach-realview/realview_eb.c
+++ b/arch/arm/mach-realview/realview_eb.c
@@ -464,6 +464,7 @@ static void __init realview_eb_init(void)
 MACHINE_START(REALVIEW_EB, "ARM-RealView EB")
 	/* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
 	.atag_offset	= 0x100,
+	.soc		= &realview_soc_desc,
 	.fixup		= realview_fixup,
 	.map_io		= realview_eb_map_io,
 	.init_early	= realview_init_early,
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c
index 7ead14f..99ea1c0 100644
--- a/arch/arm/mach-realview/realview_pb1176.c
+++ b/arch/arm/mach-realview/realview_pb1176.c
@@ -358,6 +358,7 @@ static void __init realview_pb1176_init(void)
 MACHINE_START(REALVIEW_PB1176, "ARM-RealView PB1176")
 	/* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
 	.atag_offset	= 0x100,
+	.soc		= &realview_soc_desc,
 	.fixup		= realview_pb1176_fixup,
 	.map_io		= realview_pb1176_map_io,
 	.init_early	= realview_init_early,
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c
index 671ad6d..6cb8318 100644
--- a/arch/arm/mach-realview/realview_pb11mp.c
+++ b/arch/arm/mach-realview/realview_pb11mp.c
@@ -361,6 +361,7 @@ static void __init realview_pb11mp_init(void)
 MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore")
 	/* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
 	.atag_offset	= 0x100,
+	.soc		= &realview_soc_desc,
 	.fixup		= realview_fixup,
 	.map_io		= realview_pb11mp_map_io,
 	.init_early	= realview_init_early,
diff --git a/arch/arm/mach-realview/realview_pba8.c b/arch/arm/mach-realview/realview_pba8.c
index cbf22df..3db72c5 100644
--- a/arch/arm/mach-realview/realview_pba8.c
+++ b/arch/arm/mach-realview/realview_pba8.c
@@ -311,6 +311,7 @@ static void __init realview_pba8_init(void)
 MACHINE_START(REALVIEW_PBA8, "ARM-RealView PB-A8")
 	/* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
 	.atag_offset	= 0x100,
+	.soc		= &realview_soc_desc,
 	.fixup		= realview_fixup,
 	.map_io		= realview_pba8_map_io,
 	.init_early	= realview_init_early,
diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c
index 63c4114..bea4212 100644
--- a/arch/arm/mach-realview/realview_pbx.c
+++ b/arch/arm/mach-realview/realview_pbx.c
@@ -394,6 +394,7 @@ static void __init realview_pbx_init(void)
 MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX")
 	/* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
 	.atag_offset	= 0x100,
+	.soc		= &realview_soc_desc,
 	.fixup		= realview_pbx_fixup,
 	.map_io		= realview_pbx_map_io,
 	.init_early	= realview_init_early,
diff --git a/arch/arm/mach-vexpress/core.h b/arch/arm/mach-vexpress/core.h
index f439715..bd9065a 100644
--- a/arch/arm/mach-vexpress/core.h
+++ b/arch/arm/mach-vexpress/core.h
@@ -17,3 +17,13 @@ struct amba_device name##_device = {		\
 	.irq		= IRQ_##base,		\
 	/* .dma		= DMA_##base,*/		\
 }
+
+struct arm_soc_smp_init_ops;
+struct arm_soc_smp_ops;
+
+extern struct arm_soc_smp_init_ops	vexpress_soc_smp_init_ops;
+extern struct arm_soc_smp_ops		vexpress_soc_smp_ops;
+
+extern int  vexpress_cpu_kill(unsigned int cpu);
+extern void vexpress_cpu_die(unsigned int cpu);
+extern int  vexpress_cpu_disable(unsigned int cpu);
diff --git a/arch/arm/mach-vexpress/hotplug.c b/arch/arm/mach-vexpress/hotplug.c
index 813ee08..08e5e42 100644
--- a/arch/arm/mach-vexpress/hotplug.c
+++ b/arch/arm/mach-vexpress/hotplug.c
@@ -83,7 +83,7 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
 	}
 }
 
-int platform_cpu_kill(unsigned int cpu)
+int vexpress_cpu_kill(unsigned int cpu)
 {
 	return 1;
 }
@@ -93,7 +93,7 @@ int platform_cpu_kill(unsigned int cpu)
  *
  * Called with IRQs disabled
  */
-void platform_cpu_die(unsigned int cpu)
+void vexpress_cpu_die(unsigned int cpu)
 {
 	int spurious = 0;
 
@@ -113,7 +113,7 @@ void platform_cpu_die(unsigned int cpu)
 		pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious);
 }
 
-int platform_cpu_disable(unsigned int cpu)
+int vexpress_cpu_disable(unsigned int cpu)
 {
 	/*
 	 * we don't allow CPU 0 to be shutdown (it is still too special
diff --git a/arch/arm/mach-vexpress/platsmp.c b/arch/arm/mach-vexpress/platsmp.c
index 2b5f7ac..523d226 100644
--- a/arch/arm/mach-vexpress/platsmp.c
+++ b/arch/arm/mach-vexpress/platsmp.c
@@ -13,25 +13,26 @@
 #include <linux/smp.h>
 #include <linux/io.h>
 
+#include <asm/soc.h>
 #include <asm/unified.h>
 
 #include <mach/motherboard.h>
 #define V2M_PA_CS7 0x10000000
 
-#include "core.h"
+#include <plat/platsmp.h>
 
-extern void versatile_secondary_startup(void);
+#include "core.h"
 
 /*
  * Initialise the CPU possible map early - this describes the CPUs
  * which may be present or become present in the system.
  */
-void __init smp_init_cpus(void)
+static void __init vexpress_smp_init_cpus(void)
 {
 	ct_desc->init_cpu_map();
 }
 
-void __init platform_smp_prepare_cpus(unsigned int max_cpus)
+static void __init vexpress_smp_prepare_cpus(unsigned int max_cpus)
 {
 	/*
 	 * Initialise the present map, which describes the set of CPUs
@@ -49,3 +50,18 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
 	writel(BSYM(virt_to_phys(versatile_secondary_startup)),
 		MMIO_P2V(V2M_SYS_FLAGSSET));
 }
+
+struct arm_soc_smp_init_ops vexpress_soc_smp_init_ops __initdata = {
+	.smp_init_cpus		= vexpress_smp_init_cpus,
+	.smp_prepare_cpus	= vexpress_smp_prepare_cpus,
+};
+
+struct arm_soc_smp_ops vexpress_soc_smp_ops __initdata = {
+	.smp_secondary_init	= versatile_secondary_init,
+	.smp_boot_secondary	= versatile_boot_secondary,
+#ifdef CONFIG_HOTPLUG_CPU
+	.cpu_kill		= vexpress_cpu_kill,
+	.cpu_die		= vexpress_cpu_die,
+	.cpu_disable		= vexpress_cpu_disable,
+#endif
+};
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
index 1fafc32..47bca2a 100644
--- a/arch/arm/mach-vexpress/v2m.c
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -16,6 +16,7 @@
 #include <linux/mtd/physmap.h>
 
 #include <asm/mach-types.h>
+#include <asm/soc.h>
 #include <asm/sizes.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -28,6 +29,7 @@
 #include <mach/motherboard.h>
 
 #include <plat/sched_clock.h>
+#include <plat/platsmp.h>
 
 #include "core.h"
 
@@ -442,8 +444,15 @@ static void __init v2m_init(void)
 	ct_desc->init_tile();
 }
 
+static struct arm_soc_desc vexpress_soc_desc __initdata = {
+	.name		= "ARM VE Platform",
+	soc_smp_init_ops(vexpress_soc_smp_init_ops)
+	soc_smp_ops(vexpress_soc_smp_ops)
+};
+
 MACHINE_START(VEXPRESS, "ARM-Versatile Express")
 	.atag_offset	= 0x100,
+	.soc		= &vexpress_soc_desc,
 	.map_io		= v2m_map_io,
 	.init_early	= v2m_init_early,
 	.init_irq	= v2m_init_irq,
diff --git a/arch/arm/plat-versatile/include/plat/platsmp.h b/arch/arm/plat-versatile/include/plat/platsmp.h
new file mode 100644
index 0000000..50fb830
--- /dev/null
+++ b/arch/arm/plat-versatile/include/plat/platsmp.h
@@ -0,0 +1,14 @@
+/*
+ *  linux/arch/arm/plat-versatile/include/plat/platsmp.h
+ *
+ *  Copyright (C) 2011 ARM Ltd.
+ *  All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+extern void versatile_secondary_startup(void);
+extern void versatile_secondary_init(unsigned int cpu);
+extern int  versatile_boot_secondary(unsigned int cpu, struct task_struct *idle);
diff --git a/arch/arm/plat-versatile/platsmp.c b/arch/arm/plat-versatile/platsmp.c
index 92f18d3..d403022 100644
--- a/arch/arm/plat-versatile/platsmp.c
+++ b/arch/arm/plat-versatile/platsmp.c
@@ -39,7 +39,7 @@ static void __cpuinit write_pen_release(int val)
 
 static DEFINE_SPINLOCK(boot_lock);
 
-void __cpuinit platform_secondary_init(unsigned int cpu)
+void __cpuinit versatile_secondary_init(unsigned int cpu)
 {
 	/*
 	 * if any interrupts are already enabled for the primary
@@ -61,7 +61,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
 	spin_unlock(&boot_lock);
 }
 
-int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
+int __cpuinit versatile_boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
 	unsigned long timeout;
 
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v4 04/10] ARM: SoC: convert OMAP4 to SoC descriptor
  2011-10-03 17:35 [PATCH v4 00/10] Per SoC descriptor Marc Zyngier
                   ` (2 preceding siblings ...)
  2011-10-03 17:35 ` [PATCH v4 03/10] ARM: SoC: convert VExpress/RealView to SoC descriptor Marc Zyngier
@ 2011-10-03 17:35 ` Marc Zyngier
  2011-10-04  6:32   ` Shilimkar, Santosh
  2011-10-03 17:35 ` [PATCH v4 05/10] ARM: SoC: convert Tegra " Marc Zyngier
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 24+ messages in thread
From: Marc Zyngier @ 2011-10-03 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

Convert OMAP4 to use the SoC descriptor to provide its SMP
and CPU hotplug operations.

Tested on both Panda and IGEPv2 (MULTI_OMAP kernel)

Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm/mach-omap2/board-4430sdp.c             |    1 +
 arch/arm/mach-omap2/board-omap4panda.c          |    1 +
 arch/arm/mach-omap2/include/mach/omap4-common.h |   14 +++++++++++++
 arch/arm/mach-omap2/omap-hotplug.c              |    6 ++--
 arch/arm/mach-omap2/omap-smp.c                  |   24 +++++++++++++++++++---
 arch/arm/mach-omap2/omap4-common.c              |    7 ++++++
 6 files changed, 46 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 4d0c8b9..c404c5b 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -986,6 +986,7 @@ static void __init omap_4430sdp_map_io(void)
 MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
 	/* Maintainer: Santosh Shilimkar - Texas Instruments Inc */
 	.atag_offset	= 0x100,
+	.soc		= &omap4_soc_desc,
 	.reserve	= omap_reserve,
 	.map_io		= omap_4430sdp_map_io,
 	.init_early	= omap4430_init_early,
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index 201c0c2..42d6168 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -579,6 +579,7 @@ static void __init omap4_panda_map_io(void)
 MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board")
 	/* Maintainer: David Anders - Texas Instruments Inc */
 	.atag_offset	= 0x100,
+	.soc		= &omap4_soc_desc,
 	.reserve	= omap_reserve,
 	.map_io		= omap4_panda_map_io,
 	.init_early	= omap4430_init_early,
diff --git a/arch/arm/mach-omap2/include/mach/omap4-common.h b/arch/arm/mach-omap2/include/mach/omap4-common.h
index e4bd876..1db7941 100644
--- a/arch/arm/mach-omap2/include/mach/omap4-common.h
+++ b/arch/arm/mach-omap2/include/mach/omap4-common.h
@@ -39,5 +39,19 @@ extern void omap_secondary_startup(void);
 extern u32 omap_modify_auxcoreboot0(u32 set_mask, u32 clear_mask);
 extern void omap_auxcoreboot_addr(u32 cpu_addr);
 extern u32 omap_read_auxcoreboot0(void);
+
+extern int  omap4_cpu_kill(unsigned int cpu);
+extern void omap4_cpu_die(unsigned int cpu);
+extern int  omap4_cpu_disable(unsigned int cpu);
+
+struct arm_soc_smp_init_ops;
+struct arm_soc_smp_ops;
+
+extern struct arm_soc_smp_init_ops	omap4_soc_smp_init_ops;
+extern struct arm_soc_smp_ops		omap4_soc_smp_ops;
 #endif
+
+struct arm_soc_desc;
+extern struct arm_soc_desc		omap4_soc_desc;
+
 #endif
diff --git a/arch/arm/mach-omap2/omap-hotplug.c b/arch/arm/mach-omap2/omap-hotplug.c
index 4976b93..40982c6 100644
--- a/arch/arm/mach-omap2/omap-hotplug.c
+++ b/arch/arm/mach-omap2/omap-hotplug.c
@@ -21,7 +21,7 @@
 #include <asm/cacheflush.h>
 #include <mach/omap4-common.h>
 
-int platform_cpu_kill(unsigned int cpu)
+int omap4_cpu_kill(unsigned int cpu)
 {
 	return 1;
 }
@@ -30,7 +30,7 @@ int platform_cpu_kill(unsigned int cpu)
  * platform-specific code to shutdown a CPU
  * Called with IRQs disabled
  */
-void platform_cpu_die(unsigned int cpu)
+void omap4_cpu_die(unsigned int cpu)
 {
 	flush_cache_all();
 	dsb();
@@ -57,7 +57,7 @@ void platform_cpu_die(unsigned int cpu)
 	}
 }
 
-int platform_cpu_disable(unsigned int cpu)
+int omap4_cpu_disable(unsigned int cpu)
 {
 	/*
 	 * we don't allow CPU 0 to be shutdown (it is still too special
diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c
index ce65e93..061ed7f 100644
--- a/arch/arm/mach-omap2/omap-smp.c
+++ b/arch/arm/mach-omap2/omap-smp.c
@@ -23,6 +23,7 @@
 #include <asm/cacheflush.h>
 #include <asm/hardware/gic.h>
 #include <asm/smp_scu.h>
+#include <asm/soc.h>
 #include <mach/hardware.h>
 #include <mach/omap4-common.h>
 
@@ -31,7 +32,7 @@ static void __iomem *scu_base;
 
 static DEFINE_SPINLOCK(boot_lock);
 
-void __cpuinit platform_secondary_init(unsigned int cpu)
+static void __cpuinit omap4_secondary_init(unsigned int cpu)
 {
 	/*
 	 * If any interrupts are already enabled for the primary
@@ -47,7 +48,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
 	spin_unlock(&boot_lock);
 }
 
-int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
+static int __cpuinit omap4_boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
 	/*
 	 * Set synchronisation state between this boot processor
@@ -98,7 +99,7 @@ static void __init wakeup_secondary(void)
  * Initialise the CPU possible map early - this describes the CPUs
  * which may be present or become present in the system.
  */
-void __init smp_init_cpus(void)
+static void __init omap4_smp_init_cpus(void)
 {
 	unsigned int i, ncores;
 
@@ -123,7 +124,7 @@ void __init smp_init_cpus(void)
 	set_smp_cross_call(gic_raise_softirq);
 }
 
-void __init platform_smp_prepare_cpus(unsigned int max_cpus)
+static void __init omap4_smp_prepare_cpus(unsigned int max_cpus)
 {
 
 	/*
@@ -133,3 +134,18 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
 	scu_enable(scu_base);
 	wakeup_secondary();
 }
+
+struct arm_soc_smp_init_ops omap4_soc_smp_init_ops __initdata = {
+	.smp_init_cpus		= omap4_smp_init_cpus,
+	.smp_prepare_cpus	= omap4_smp_prepare_cpus,
+};
+
+struct arm_soc_smp_ops omap4_soc_smp_ops __initdata = {
+	.smp_secondary_init	= omap4_secondary_init,
+	.smp_boot_secondary	= omap4_boot_secondary,
+#ifdef CONFIG_HOTPLUG_CPU
+	.cpu_kill		= omap4_cpu_kill,
+	.cpu_die		= omap4_cpu_die,
+	.cpu_disable		= omap4_cpu_disable,
+#endif
+};
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
index 35ac3e5..de39fd4 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -16,6 +16,7 @@
 #include <linux/io.h>
 #include <linux/platform_device.h>
 
+#include <asm/soc.h>
 #include <asm/hardware/gic.h>
 #include <asm/hardware/cache-l2x0.h>
 
@@ -111,3 +112,9 @@ static int __init omap_l2_cache_init(void)
 }
 early_initcall(omap_l2_cache_init);
 #endif
+
+struct arm_soc_desc omap4_soc_desc __initdata = {
+	.name		= "TI OMAP4",
+	soc_smp_init_ops(omap4_soc_smp_init_ops)
+	soc_smp_ops(omap4_soc_smp_ops)
+};
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v4 05/10] ARM: SoC: convert Tegra to SoC descriptor
  2011-10-03 17:35 [PATCH v4 00/10] Per SoC descriptor Marc Zyngier
                   ` (3 preceding siblings ...)
  2011-10-03 17:35 ` [PATCH v4 04/10] ARM: SoC: convert OMAP4 " Marc Zyngier
@ 2011-10-03 17:35 ` Marc Zyngier
  2011-10-03 20:52   ` Stephen Warren
  2011-10-03 17:35 ` [PATCH v4 06/10] ARM: SoC: convert Exynos4 " Marc Zyngier
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 24+ messages in thread
From: Marc Zyngier @ 2011-10-03 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

Convert Tegra to use the SoC descriptor to provide its SMP
and CPU hotplug operations.

Tested on Harmony.

Cc: Colin Cross <ccross@android.com>
Cc: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm/mach-tegra/board-dt.c        |    2 ++
 arch/arm/mach-tegra/board-harmony.c   |    2 ++
 arch/arm/mach-tegra/board-paz00.c     |    2 ++
 arch/arm/mach-tegra/board-seaboard.c  |    4 ++++
 arch/arm/mach-tegra/board-trimslice.c |    2 ++
 arch/arm/mach-tegra/common.c          |    8 ++++++++
 arch/arm/mach-tegra/common.h          |   11 +++++++++++
 arch/arm/mach-tegra/hotplug.c         |    6 +++---
 arch/arm/mach-tegra/platsmp.c         |   26 ++++++++++++++++++++++----
 9 files changed, 56 insertions(+), 7 deletions(-)
 create mode 100644 arch/arm/mach-tegra/common.h

diff --git a/arch/arm/mach-tegra/board-dt.c b/arch/arm/mach-tegra/board-dt.c
index 9f47e04..0b3f937 100644
--- a/arch/arm/mach-tegra/board-dt.c
+++ b/arch/arm/mach-tegra/board-dt.c
@@ -44,6 +44,7 @@
 #include "board-harmony.h"
 #include "clock.h"
 #include "devices.h"
+#include "common.h"
 
 void harmony_pinmux_init(void);
 void seaboard_pinmux_init(void);
@@ -111,6 +112,7 @@ static const char * tegra_dt_board_compat[] = {
 
 DT_MACHINE_START(TEGRA_DT, "nVidia Tegra (Flattened Device Tree)")
 	.map_io		= tegra_map_common_io,
+	.soc		= &tegra_soc_desc,
 	.init_early	= tegra_init_early,
 	.init_irq	= tegra_init_irq,
 	.timer		= &tegra_timer,
diff --git a/arch/arm/mach-tegra/board-harmony.c b/arch/arm/mach-tegra/board-harmony.c
index f0bdc5e..f2ef94f 100644
--- a/arch/arm/mach-tegra/board-harmony.c
+++ b/arch/arm/mach-tegra/board-harmony.c
@@ -43,6 +43,7 @@
 #include "clock.h"
 #include "devices.h"
 #include "gpio-names.h"
+#include "common.h"
 
 static struct plat_serial8250_port debug_uart_platform_data[] = {
 	{
@@ -183,6 +184,7 @@ static void __init tegra_harmony_init(void)
 
 MACHINE_START(HARMONY, "harmony")
 	.atag_offset	= 0x100,
+	.soc		= &tegra_soc_desc,
 	.fixup		= tegra_harmony_fixup,
 	.map_io         = tegra_map_common_io,
 	.init_early	= tegra_init_early,
diff --git a/arch/arm/mach-tegra/board-paz00.c b/arch/arm/mach-tegra/board-paz00.c
index 602f8dd..63595f0 100644
--- a/arch/arm/mach-tegra/board-paz00.c
+++ b/arch/arm/mach-tegra/board-paz00.c
@@ -43,6 +43,7 @@
 #include "clock.h"
 #include "devices.h"
 #include "gpio-names.h"
+#include "common.h"
 
 static struct plat_serial8250_port debug_uart_platform_data[] = {
 	{
@@ -186,6 +187,7 @@ static void __init tegra_paz00_init(void)
 
 MACHINE_START(PAZ00, "Toshiba AC100 / Dynabook AZ")
 	.atag_offset	= 0x100,
+	.soc		= &tegra_soc_desc,
 	.fixup		= tegra_paz00_fixup,
 	.map_io         = tegra_map_common_io,
 	.init_early	= tegra_init_early,
diff --git a/arch/arm/mach-tegra/board-seaboard.c b/arch/arm/mach-tegra/board-seaboard.c
index bf13ea3..dfd9c95 100644
--- a/arch/arm/mach-tegra/board-seaboard.c
+++ b/arch/arm/mach-tegra/board-seaboard.c
@@ -40,6 +40,7 @@
 #include "clock.h"
 #include "devices.h"
 #include "gpio-names.h"
+#include "common.h"
 
 static struct plat_serial8250_port debug_uart_platform_data[] = {
 	{
@@ -281,6 +282,7 @@ static void __init tegra_wario_init(void)
 
 MACHINE_START(SEABOARD, "seaboard")
 	.atag_offset    = 0x100,
+	.soc		= &tegra_soc_desc,
 	.map_io         = tegra_map_common_io,
 	.init_early     = tegra_init_early,
 	.init_irq       = tegra_init_irq,
@@ -290,6 +292,7 @@ MACHINE_END
 
 MACHINE_START(KAEN, "kaen")
 	.atag_offset    = 0x100,
+	.soc		= &tegra_soc_desc,
 	.map_io         = tegra_map_common_io,
 	.init_early     = tegra_init_early,
 	.init_irq       = tegra_init_irq,
@@ -299,6 +302,7 @@ MACHINE_END
 
 MACHINE_START(WARIO, "wario")
 	.atag_offset    = 0x100,
+	.soc		= &tegra_soc_desc,
 	.map_io         = tegra_map_common_io,
 	.init_early     = tegra_init_early,
 	.init_irq       = tegra_init_irq,
diff --git a/arch/arm/mach-tegra/board-trimslice.c b/arch/arm/mach-tegra/board-trimslice.c
index e008c0e..16cfc39 100644
--- a/arch/arm/mach-tegra/board-trimslice.c
+++ b/arch/arm/mach-tegra/board-trimslice.c
@@ -38,6 +38,7 @@
 #include "clock.h"
 #include "devices.h"
 #include "gpio-names.h"
+#include "common.h"
 
 #include "board-trimslice.h"
 
@@ -173,6 +174,7 @@ static void __init tegra_trimslice_init(void)
 
 MACHINE_START(TRIMSLICE, "trimslice")
 	.atag_offset	= 0x100,
+	.soc		= &tegra_soc_desc,
 	.fixup		= tegra_trimslice_fixup,
 	.map_io         = tegra_map_common_io,
 	.init_early	= tegra_init_early,
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
index d5e3f89..e9c5f9c 100644
--- a/arch/arm/mach-tegra/common.c
+++ b/arch/arm/mach-tegra/common.c
@@ -22,6 +22,7 @@
 #include <linux/clk.h>
 #include <linux/delay.h>
 
+#include <asm/soc.h>
 #include <asm/hardware/cache-l2x0.h>
 
 #include <mach/iomap.h>
@@ -30,6 +31,7 @@
 #include "board.h"
 #include "clock.h"
 #include "fuse.h"
+#include "common.h"
 
 void (*arch_reset)(char mode, const char *cmd) = tegra_assert_system_reset;
 
@@ -81,3 +83,9 @@ void __init tegra_init_early(void)
 	tegra_clk_init_from_table(common_clk_init_table);
 	tegra_init_cache();
 }
+
+struct arm_soc_desc tegra_soc_desc __initdata = {
+	.name		= "nVIDIA Tegra",
+	soc_smp_init_ops(tegra_soc_smp_init_ops)
+	soc_smp_ops(tegra_soc_smp_ops)
+};
diff --git a/arch/arm/mach-tegra/common.h b/arch/arm/mach-tegra/common.h
new file mode 100644
index 0000000..e4c214d
--- /dev/null
+++ b/arch/arm/mach-tegra/common.h
@@ -0,0 +1,11 @@
+struct arm_soc_desc;
+extern struct arm_soc_desc tegra_soc_desc;
+
+struct arm_soc_smp_init_ops;
+struct arm_soc_smp_ops;
+extern struct arm_soc_smp_init_ops	tegra_soc_smp_init_ops;
+extern struct arm_soc_smp_ops		tegra_soc_smp_ops;
+
+extern int  tegra_cpu_kill(unsigned int cpu);
+extern void tegra_cpu_die(unsigned int cpu);
+extern int  tegra_cpu_disable(unsigned int cpu);
diff --git a/arch/arm/mach-tegra/hotplug.c b/arch/arm/mach-tegra/hotplug.c
index f329404..7319f5f 100644
--- a/arch/arm/mach-tegra/hotplug.c
+++ b/arch/arm/mach-tegra/hotplug.c
@@ -86,7 +86,7 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
 	}
 }
 
-int platform_cpu_kill(unsigned int cpu)
+int tegra_cpu_kill(unsigned int cpu)
 {
 	return 1;
 }
@@ -96,7 +96,7 @@ int platform_cpu_kill(unsigned int cpu)
  *
  * Called with IRQs disabled
  */
-void platform_cpu_die(unsigned int cpu)
+void tegra_cpu_die(unsigned int cpu)
 {
 	int spurious = 0;
 
@@ -116,7 +116,7 @@ void platform_cpu_die(unsigned int cpu)
 		pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious);
 }
 
-int platform_cpu_disable(unsigned int cpu)
+int tegra_cpu_disable(unsigned int cpu)
 {
 	/*
 	 * we don't allow CPU 0 to be shutdown (it is still too special
diff --git a/arch/arm/mach-tegra/platsmp.c b/arch/arm/mach-tegra/platsmp.c
index 0886cbc..f18b07d 100644
--- a/arch/arm/mach-tegra/platsmp.c
+++ b/arch/arm/mach-tegra/platsmp.c
@@ -23,9 +23,12 @@
 #include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 #include <asm/smp_scu.h>
+#include <asm/soc.h>
 
 #include <mach/iomap.h>
 
+#include "common.h"
+
 extern void tegra_secondary_startup(void);
 
 static DEFINE_SPINLOCK(boot_lock);
@@ -38,7 +41,7 @@ static void __iomem *scu_base = IO_ADDRESS(TEGRA_ARM_PERIF_BASE);
 #define CLK_RST_CONTROLLER_RST_CPU_CMPLX_CLR \
 	(IO_ADDRESS(TEGRA_CLK_RESET_BASE) + 0x344)
 
-void __cpuinit platform_secondary_init(unsigned int cpu)
+static void __cpuinit tegra_secondary_init(unsigned int cpu)
 {
 	/*
 	 * if any interrupts are already enabled for the primary
@@ -54,7 +57,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
 	spin_unlock(&boot_lock);
 }
 
-int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
+static int __cpuinit tegra_boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
 	unsigned long old_boot_vector;
 	unsigned long boot_vector;
@@ -110,7 +113,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
  * Initialise the CPU possible map early - this describes the CPUs
  * which may be present or become present in the system.
  */
-void __init smp_init_cpus(void)
+static void __init tegra_smp_init_cpus(void)
 {
 	unsigned int i, ncores = scu_get_core_count(scu_base);
 
@@ -126,8 +129,23 @@ void __init smp_init_cpus(void)
 	set_smp_cross_call(gic_raise_softirq);
 }
 
-void __init platform_smp_prepare_cpus(unsigned int max_cpus)
+static void __init tegra_smp_prepare_cpus(unsigned int max_cpus)
 {
 
 	scu_enable(scu_base);
 }
+
+struct arm_soc_smp_init_ops tegra_soc_smp_init_ops __initdata = {
+	.smp_init_cpus		= tegra_smp_init_cpus,
+	.smp_prepare_cpus	= tegra_smp_prepare_cpus,
+};
+
+struct arm_soc_smp_ops tegra_soc_smp_ops __initdata = {
+	.smp_secondary_init	= tegra_secondary_init,
+	.smp_boot_secondary	= tegra_boot_secondary,
+#ifdef CONFIG_HOTPLUG_CPU
+	.cpu_kill		= tegra_cpu_kill,
+	.cpu_die		= tegra_cpu_die,
+	.cpu_disable		= tegra_cpu_disable,
+#endif
+};
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v4 06/10] ARM: SoC: convert Exynos4 to SoC descriptor
  2011-10-03 17:35 [PATCH v4 00/10] Per SoC descriptor Marc Zyngier
                   ` (4 preceding siblings ...)
  2011-10-03 17:35 ` [PATCH v4 05/10] ARM: SoC: convert Tegra " Marc Zyngier
@ 2011-10-03 17:35 ` Marc Zyngier
  2011-10-04 11:01   ` Kyungmin Park
  2011-10-04 13:16   ` Kukjin Kim
  2011-10-03 17:35 ` [PATCH v4 07/10] ARM: SoC: convert MSM SMP " Marc Zyngier
                   ` (3 subsequent siblings)
  9 siblings, 2 replies; 24+ messages in thread
From: Marc Zyngier @ 2011-10-03 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

Convert Exynos4 to use the SoC descriptor to provide its SMP
and CPU hotplug operations.

Cc: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm/mach-exynos4/core.h                |    9 +++++++++
 arch/arm/mach-exynos4/cpu.c                 |    8 ++++++++
 arch/arm/mach-exynos4/hotplug.c             |    8 +++++---
 arch/arm/mach-exynos4/mach-armlex4210.c     |    3 +++
 arch/arm/mach-exynos4/mach-nuri.c           |    3 +++
 arch/arm/mach-exynos4/mach-origen.c         |    3 +++
 arch/arm/mach-exynos4/mach-smdk4212.c       |    3 +++
 arch/arm/mach-exynos4/mach-smdkv310.c       |    4 ++++
 arch/arm/mach-exynos4/mach-universal_c210.c |    3 +++
 arch/arm/mach-exynos4/platsmp.c             |   25 +++++++++++++++++++++----
 10 files changed, 62 insertions(+), 7 deletions(-)
 create mode 100644 arch/arm/mach-exynos4/core.h

diff --git a/arch/arm/mach-exynos4/core.h b/arch/arm/mach-exynos4/core.h
new file mode 100644
index 0000000..ba9fcc8
--- /dev/null
+++ b/arch/arm/mach-exynos4/core.h
@@ -0,0 +1,9 @@
+#include <asm/soc.h>
+
+extern struct arm_soc_smp_init_ops	exynos4_soc_smp_init_ops;
+extern struct arm_soc_smp_ops		exynos4_soc_smp_ops;
+extern struct arm_soc_desc		exynos4_soc_desc;
+
+extern int  exynos4_cpu_kill(unsigned int cpu);
+extern void exynos4_cpu_die(unsigned int cpu);
+extern int  exynos4_cpu_disable(unsigned int cpu);
diff --git a/arch/arm/mach-exynos4/cpu.c b/arch/arm/mach-exynos4/cpu.c
index 2aa3df0..a15dce8 100644
--- a/arch/arm/mach-exynos4/cpu.c
+++ b/arch/arm/mach-exynos4/cpu.c
@@ -33,6 +33,8 @@
 #include <mach/regs-irq.h>
 #include <mach/regs-pmu.h>
 
+#include "core.h"
+
 extern int combiner_init(unsigned int combiner_nr, void __iomem *base,
 			 unsigned int irq_start);
 extern void combiner_cascade_irq(unsigned int combiner_nr, unsigned int irq);
@@ -282,3 +284,9 @@ int __init exynos4_init(void)
 
 	return sysdev_register(&exynos4_sysdev);
 }
+
+struct arm_soc_desc exynos4_soc_desc __initdata = {
+	.name		= "Samsung Exynos4",
+	soc_smp_init_ops(exynos4_soc_smp_init_ops)
+	soc_smp_ops(exynos4_soc_smp_ops)
+};
diff --git a/arch/arm/mach-exynos4/hotplug.c b/arch/arm/mach-exynos4/hotplug.c
index da70e7e..15fe884 100644
--- a/arch/arm/mach-exynos4/hotplug.c
+++ b/arch/arm/mach-exynos4/hotplug.c
@@ -19,6 +19,8 @@
 
 #include <mach/regs-pmu.h>
 
+#include "core.h"
+
 extern volatile int pen_release;
 
 static inline void cpu_enter_lowpower(void)
@@ -93,7 +95,7 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
 	}
 }
 
-int platform_cpu_kill(unsigned int cpu)
+int exynos4_cpu_kill(unsigned int cpu)
 {
 	return 1;
 }
@@ -103,7 +105,7 @@ int platform_cpu_kill(unsigned int cpu)
  *
  * Called with IRQs disabled
  */
-void platform_cpu_die(unsigned int cpu)
+void exynos4_cpu_die(unsigned int cpu)
 {
 	int spurious = 0;
 
@@ -123,7 +125,7 @@ void platform_cpu_die(unsigned int cpu)
 		pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious);
 }
 
-int platform_cpu_disable(unsigned int cpu)
+int exynos4_cpu_disable(unsigned int cpu)
 {
 	/*
 	 * we don't allow CPU 0 to be shutdown (it is still too special
diff --git a/arch/arm/mach-exynos4/mach-armlex4210.c b/arch/arm/mach-exynos4/mach-armlex4210.c
index f0ca6c1..8c82c6b 100644
--- a/arch/arm/mach-exynos4/mach-armlex4210.c
+++ b/arch/arm/mach-exynos4/mach-armlex4210.c
@@ -28,6 +28,8 @@
 
 #include <mach/map.h>
 
+#include "core.h"
+
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define ARMLEX4210_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
 				 S3C2410_UCON_RXILEVEL |	\
@@ -208,6 +210,7 @@ static void __init armlex4210_machine_init(void)
 MACHINE_START(ARMLEX4210, "ARMLEX4210")
 	/* Maintainer: Alim Akhtar <alim.akhtar@samsung.com> */
 	.atag_offset	= 0x100,
+	.soc		= &exynos4_soc_desc,
 	.init_irq	= exynos4_init_irq,
 	.map_io		= armlex4210_map_io,
 	.init_machine	= armlex4210_machine_init,
diff --git a/arch/arm/mach-exynos4/mach-nuri.c b/arch/arm/mach-exynos4/mach-nuri.c
index 2204911..5780ee3 100644
--- a/arch/arm/mach-exynos4/mach-nuri.c
+++ b/arch/arm/mach-exynos4/mach-nuri.c
@@ -48,6 +48,8 @@
 
 #include <mach/map.h>
 
+#include <asm/soc.h>
+
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define NURI_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
 				 S3C2410_UCON_RXILEVEL |	\
@@ -1187,6 +1189,7 @@ static void __init nuri_machine_init(void)
 MACHINE_START(NURI, "NURI")
 	/* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */
 	.atag_offset	= 0x100,
+	.soc		= &exynos4_soc_desc,
 	.init_irq	= exynos4_init_irq,
 	.map_io		= nuri_map_io,
 	.init_machine	= nuri_machine_init,
diff --git a/arch/arm/mach-exynos4/mach-origen.c b/arch/arm/mach-exynos4/mach-origen.c
index 421294b..06250fc 100644
--- a/arch/arm/mach-exynos4/mach-origen.c
+++ b/arch/arm/mach-exynos4/mach-origen.c
@@ -33,6 +33,8 @@
 
 #include <mach/map.h>
 
+#include "core.h"
+
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define ORIGEN_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
 				 S3C2410_UCON_RXILEVEL |	\
@@ -210,6 +212,7 @@ static void __init origen_machine_init(void)
 MACHINE_START(ORIGEN, "ORIGEN")
 	/* Maintainer: JeongHyeon Kim <jhkim@insignal.co.kr> */
 	.atag_offset	= 0x100,
+	.soc		= &exynos4_soc_desc,
 	.init_irq	= exynos4_init_irq,
 	.map_io		= origen_map_io,
 	.init_machine	= origen_machine_init,
diff --git a/arch/arm/mach-exynos4/mach-smdk4212.c b/arch/arm/mach-exynos4/mach-smdk4212.c
index 8c41ae1..cf92514 100644
--- a/arch/arm/mach-exynos4/mach-smdk4212.c
+++ b/arch/arm/mach-exynos4/mach-smdk4212.c
@@ -36,6 +36,8 @@
 
 #include <mach/map.h>
 
+#include "core.h"
+
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define SMDK4212_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
 				 S3C2410_UCON_RXILEVEL |	\
@@ -285,6 +287,7 @@ static void __init smdk4212_machine_init(void)
 MACHINE_START(SMDK4212, "SMDK4212")
 	/* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
 	.atag_offset	= 0x100,
+	.soc		= &exynos4_soc_desc,
 	.init_irq	= exynos4_init_irq,
 	.map_io		= smdk4212_map_io,
 	.init_machine	= smdk4212_machine_init,
diff --git a/arch/arm/mach-exynos4/mach-smdkv310.c b/arch/arm/mach-exynos4/mach-smdkv310.c
index cec2afa..525b042 100644
--- a/arch/arm/mach-exynos4/mach-smdkv310.c
+++ b/arch/arm/mach-exynos4/mach-smdkv310.c
@@ -43,6 +43,8 @@
 
 #include <mach/map.h>
 
+#include "core.h"
+
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define SMDKV310_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
 				 S3C2410_UCON_RXILEVEL |	\
@@ -373,6 +375,7 @@ MACHINE_START(SMDKV310, "SMDKV310")
 	/* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
 	/* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */
 	.atag_offset	= 0x100,
+	.soc		= &exynos4_soc_desc,
 	.init_irq	= exynos4_init_irq,
 	.map_io		= smdkv310_map_io,
 	.init_machine	= smdkv310_machine_init,
@@ -383,6 +386,7 @@ MACHINE_END
 MACHINE_START(SMDKC210, "SMDKC210")
 	/* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
 	.atag_offset	= 0x100,
+	.soc		= &exynos4_soc_desc,
 	.init_irq	= exynos4_init_irq,
 	.map_io		= smdkv310_map_io,
 	.init_machine	= smdkv310_machine_init,
diff --git a/arch/arm/mach-exynos4/mach-universal_c210.c b/arch/arm/mach-exynos4/mach-universal_c210.c
index a023faa..0c94673 100644
--- a/arch/arm/mach-exynos4/mach-universal_c210.c
+++ b/arch/arm/mach-exynos4/mach-universal_c210.c
@@ -47,6 +47,8 @@
 #include <media/s5p_fimc.h>
 #include <media/m5mols.h>
 
+#include "core.h"
+
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define UNIVERSAL_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
 				 S3C2410_UCON_RXILEVEL |	\
@@ -1061,6 +1063,7 @@ static void __init universal_machine_init(void)
 MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
 	/* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */
 	.atag_offset	= 0x100,
+	.soc		= &exynos4_soc_desc,
 	.init_irq	= exynos4_init_irq,
 	.map_io		= universal_map_io,
 	.init_machine	= universal_machine_init,
diff --git a/arch/arm/mach-exynos4/platsmp.c b/arch/arm/mach-exynos4/platsmp.c
index 500453f..1f419fa 100644
--- a/arch/arm/mach-exynos4/platsmp.c
+++ b/arch/arm/mach-exynos4/platsmp.c
@@ -32,6 +32,8 @@
 
 #include <plat/cpu.h>
 
+#include "core.h"
+
 extern void exynos4_secondary_startup(void);
 
 #define CPU1_BOOT_REG		(samsung_rev() == EXYNOS4210_REV_1_1 ? \
@@ -89,7 +91,7 @@ static void __cpuinit exynos4_gic_secondary_init(void)
 	__raw_writel(1, cpu_base + GIC_CPU_CTRL);
 }
 
-void __cpuinit platform_secondary_init(unsigned int cpu)
+static void __cpuinit exynos4_secondary_init(unsigned int cpu)
 {
 	/*
 	 * if any interrupts are already enabled for the primary
@@ -113,7 +115,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
 	set_cpu_online(cpu, true);
 }
 
-int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
+static int __cpuinit exynos4_boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
 	unsigned long timeout;
 
@@ -188,7 +190,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
  * which may be present or become present in the system.
  */
 
-void __init smp_init_cpus(void)
+static void __init exynos4_smp_init_cpus(void)
 {
 	void __iomem *scu_base = scu_base_addr();
 	unsigned int i, ncores;
@@ -210,7 +212,7 @@ void __init smp_init_cpus(void)
 	set_smp_cross_call(gic_raise_softirq);
 }
 
-void __init platform_smp_prepare_cpus(unsigned int max_cpus)
+static void __init exynos4_smp_prepare_cpus(unsigned int max_cpus)
 {
 
 	scu_enable(scu_base_addr());
@@ -224,3 +226,18 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
 	__raw_writel(BSYM(virt_to_phys(exynos4_secondary_startup)),
 			CPU1_BOOT_REG);
 }
+
+struct arm_soc_smp_init_ops exynos4_soc_smp_init_ops __initdata = {
+	.smp_init_cpus		= exynos4_smp_init_cpus,
+	.smp_prepare_cpus	= exynos4_smp_prepare_cpus,
+};
+
+struct arm_soc_smp_ops exynos4_soc_smp_ops __initdata = {
+	.smp_secondary_init	= exynos4_secondary_init,
+	.smp_boot_secondary	= exynos4_boot_secondary,
+#ifdef CONFIG_HOTPLUG_CPU
+	.cpu_kill		= exynos4_cpu_kill,
+	.cpu_die		= exynos4_cpu_die,
+	.cpu_disable		= exynos4_cpu_disable,
+#endif
+};
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v4 07/10] ARM: SoC: convert MSM SMP to SoC descriptor
  2011-10-03 17:35 [PATCH v4 00/10] Per SoC descriptor Marc Zyngier
                   ` (5 preceding siblings ...)
  2011-10-03 17:35 ` [PATCH v4 06/10] ARM: SoC: convert Exynos4 " Marc Zyngier
@ 2011-10-03 17:35 ` Marc Zyngier
  2011-10-03 17:35 ` [PATCH v4 08/10] ARM: SoC: convert ux500 " Marc Zyngier
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 24+ messages in thread
From: Marc Zyngier @ 2011-10-03 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

Convert MSM SMP platforms to use the SoC descriptor to provide
their SMP and CPU hotplug operations.

Cc: David Brown <davidb@codeaurora.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm/mach-msm/Makefile        |    2 +-
 arch/arm/mach-msm/board-msm8960.c |    3 +++
 arch/arm/mach-msm/board-msm8x60.c |    7 +++++++
 arch/arm/mach-msm/core.c          |   17 +++++++++++++++++
 arch/arm/mach-msm/core.h          |    9 +++++++++
 arch/arm/mach-msm/hotplug.c       |    8 +++++---
 arch/arm/mach-msm/platsmp.c       |   24 ++++++++++++++++++++----
 7 files changed, 62 insertions(+), 8 deletions(-)
 create mode 100644 arch/arm/mach-msm/core.c
 create mode 100644 arch/arm/mach-msm/core.h

diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile
index 4ad3969..cba9355 100644
--- a/arch/arm/mach-msm/Makefile
+++ b/arch/arm/mach-msm/Makefile
@@ -1,5 +1,5 @@
 obj-y += io.o idle.o timer.o
-obj-y += clock.o
+obj-y += clock.o core.o
 obj-$(CONFIG_DEBUG_FS) += clock-debug.o
 
 obj-$(CONFIG_MSM_VIC) += irq-vic.o
diff --git a/arch/arm/mach-msm/board-msm8960.c b/arch/arm/mach-msm/board-msm8960.c
index b04468e..c811e29 100644
--- a/arch/arm/mach-msm/board-msm8960.c
+++ b/arch/arm/mach-msm/board-msm8960.c
@@ -30,6 +30,7 @@
 #include <mach/board.h>
 #include <mach/msm_iomap.h>
 
+#include "core.h"
 #include "devices.h"
 
 static void __init msm8960_fixup(struct machine_desc *desc, struct tag *tag,
@@ -94,6 +95,7 @@ static void __init msm8960_rumi3_init(void)
 }
 
 MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR")
+	.soc = &msm_soc_desc,
 	.fixup = msm8960_fixup,
 	.reserve = msm8960_reserve,
 	.map_io = msm8960_map_io,
@@ -103,6 +105,7 @@ MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR")
 MACHINE_END
 
 MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3")
+	.soc = &msm_soc_desc,
 	.fixup = msm8960_fixup,
 	.reserve = msm8960_reserve,
 	.map_io = msm8960_map_io,
diff --git a/arch/arm/mach-msm/board-msm8x60.c b/arch/arm/mach-msm/board-msm8x60.c
index 4ad2afb..a4bd858 100644
--- a/arch/arm/mach-msm/board-msm8x60.c
+++ b/arch/arm/mach-msm/board-msm8x60.c
@@ -28,6 +28,8 @@
 #include <mach/board.h>
 #include <mach/msm_iomap.h>
 
+#include "core.h"
+
 static void __init msm8x60_fixup(struct machine_desc *desc, struct tag *tag,
 			 char **cmdline, struct meminfo *mi)
 {
@@ -115,6 +117,7 @@ static const char *msm8x60_fluid_match[] __initdata = {
 #endif /* CONFIG_OF */
 
 MACHINE_START(MSM8X60_RUMI3, "QCT MSM8X60 RUMI3")
+	.soc = &msm_soc_desc,
 	.fixup = msm8x60_fixup,
 	.reserve = msm8x60_reserve,
 	.map_io = msm8x60_map_io,
@@ -124,6 +127,7 @@ MACHINE_START(MSM8X60_RUMI3, "QCT MSM8X60 RUMI3")
 MACHINE_END
 
 MACHINE_START(MSM8X60_SURF, "QCT MSM8X60 SURF")
+	.soc = &msm_soc_desc,
 	.fixup = msm8x60_fixup,
 	.reserve = msm8x60_reserve,
 	.map_io = msm8x60_map_io,
@@ -133,6 +137,7 @@ MACHINE_START(MSM8X60_SURF, "QCT MSM8X60 SURF")
 MACHINE_END
 
 MACHINE_START(MSM8X60_SIM, "QCT MSM8X60 SIMULATOR")
+	.soc = &msm_soc_desc,
 	.fixup = msm8x60_fixup,
 	.reserve = msm8x60_reserve,
 	.map_io = msm8x60_map_io,
@@ -142,6 +147,7 @@ MACHINE_START(MSM8X60_SIM, "QCT MSM8X60 SIMULATOR")
 MACHINE_END
 
 MACHINE_START(MSM8X60_FFA, "QCT MSM8X60 FFA")
+	.soc = &msm_soc_desc,
 	.fixup = msm8x60_fixup,
 	.reserve = msm8x60_reserve,
 	.map_io = msm8x60_map_io,
@@ -153,6 +159,7 @@ MACHINE_END
 #ifdef CONFIG_OF
 /* TODO: General device tree support for all MSM. */
 DT_MACHINE_START(MSM_DT, "Qualcomm MSM (Flattened Device Tree)")
+	.soc = &msm_soc_desc,
 	.fixup = msm8x60_fixup,
 	.reserve = msm8x60_reserve,
 	.map_io = msm8x60_map_io,
diff --git a/arch/arm/mach-msm/core.c b/arch/arm/mach-msm/core.c
new file mode 100644
index 0000000..390cde7
--- /dev/null
+++ b/arch/arm/mach-msm/core.c
@@ -0,0 +1,17 @@
+/*
+ *  Copyright (C) 2011 ARM Ltd.
+ *  All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/init.h>
+#include "core.h"
+
+struct arm_soc_desc msm_soc_desc __initdata = {
+	.name		= "Qualcomm MSM",
+	soc_smp_init_ops(msm_soc_smp_init_ops)
+	soc_smp_ops(msm_soc_smp_ops)
+};
diff --git a/arch/arm/mach-msm/core.h b/arch/arm/mach-msm/core.h
new file mode 100644
index 0000000..e8394dd
--- /dev/null
+++ b/arch/arm/mach-msm/core.h
@@ -0,0 +1,9 @@
+#include <asm/soc.h>
+
+extern struct arm_soc_smp_init_ops	msm_soc_smp_init_ops;
+extern struct arm_soc_smp_ops		msm_soc_smp_ops;
+extern struct arm_soc_desc		msm_soc_desc;
+
+extern int  msm_cpu_kill(unsigned int cpu);
+extern void msm_cpu_die(unsigned int cpu);
+extern int  msm_cpu_disable(unsigned int cpu);
diff --git a/arch/arm/mach-msm/hotplug.c b/arch/arm/mach-msm/hotplug.c
index 41c252d..eef1b30 100644
--- a/arch/arm/mach-msm/hotplug.c
+++ b/arch/arm/mach-msm/hotplug.c
@@ -12,6 +12,8 @@
 
 #include <asm/cacheflush.h>
 
+#include "core.h"
+
 extern volatile int pen_release;
 
 static inline void cpu_enter_lowpower(void)
@@ -56,7 +58,7 @@ static inline void platform_do_lowpower(unsigned int cpu)
 	}
 }
 
-int platform_cpu_kill(unsigned int cpu)
+int msm_cpu_kill(unsigned int cpu)
 {
 	return 1;
 }
@@ -66,7 +68,7 @@ int platform_cpu_kill(unsigned int cpu)
  *
  * Called with IRQs disabled
  */
-void platform_cpu_die(unsigned int cpu)
+void msm_cpu_die(unsigned int cpu)
 {
 	/*
 	 * we're ready for shutdown now, so do it
@@ -81,7 +83,7 @@ void platform_cpu_die(unsigned int cpu)
 	cpu_leave_lowpower();
 }
 
-int platform_cpu_disable(unsigned int cpu)
+int msm_cpu_disable(unsigned int cpu)
 {
 	/*
 	 * we don't allow CPU 0 to be shutdown (it is still too special
diff --git a/arch/arm/mach-msm/platsmp.c b/arch/arm/mach-msm/platsmp.c
index e3375ee..4902c16 100644
--- a/arch/arm/mach-msm/platsmp.c
+++ b/arch/arm/mach-msm/platsmp.c
@@ -24,6 +24,7 @@
 #include <mach/msm_iomap.h>
 
 #include "scm-boot.h"
+#include "core.h"
 
 #define VDD_SC1_ARRAY_CLAMP_GFS_CTL 0x15A0
 #define SCSS_CPU1CORE_RESET 0xD80
@@ -47,7 +48,7 @@ static inline int get_core_count(void)
 	return ((read_cpuid_id() >> 4) & 3) + 1;
 }
 
-void __cpuinit platform_secondary_init(unsigned int cpu)
+static void __cpuinit msm_secondary_init(unsigned int cpu)
 {
 	/* Configure edge-triggered PPIs */
 	writel(GIC_PPI_EDGE_MASK, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4);
@@ -92,7 +93,7 @@ static __cpuinit void prepare_cold_cpu(unsigned int cpu)
 				  "address\n");
 }
 
-int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
+static int __cpuinit msm_boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
 	unsigned long timeout;
 	static int cold_boot_done;
@@ -152,7 +153,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
  * does not support the ARM SCU, so just set the possible cpu mask to
  * NR_CPUS.
  */
-void __init smp_init_cpus(void)
+static void __init msm_smp_init_cpus(void)
 {
 	unsigned int i, ncores = get_core_count();
 
@@ -162,6 +163,21 @@ void __init smp_init_cpus(void)
         set_smp_cross_call(gic_raise_softirq);
 }
 
-void __init platform_smp_prepare_cpus(unsigned int max_cpus)
+static void __init msm_smp_prepare_cpus(unsigned int max_cpus)
 {
 }
+
+struct arm_soc_smp_init_ops msm_soc_smp_init_ops __initdata = {
+	.smp_init_cpus		= msm_smp_init_cpus,
+	.smp_prepare_cpus	= msm_smp_prepare_cpus,
+};
+
+struct arm_soc_smp_ops msm_soc_smp_ops __initdata = {
+	.smp_secondary_init	= msm_secondary_init,
+	.smp_boot_secondary	= msm_boot_secondary,
+#ifdef CONFIG_HOTPLUG_CPU
+	.cpu_kill		= msm_cpu_kill,
+	.cpu_die		= msm_cpu_die,
+	.cpu_disable		= msm_cpu_disable,
+#endif
+};
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v4 08/10] ARM: SoC: convert ux500 to SoC descriptor
  2011-10-03 17:35 [PATCH v4 00/10] Per SoC descriptor Marc Zyngier
                   ` (6 preceding siblings ...)
  2011-10-03 17:35 ` [PATCH v4 07/10] ARM: SoC: convert MSM SMP " Marc Zyngier
@ 2011-10-03 17:35 ` Marc Zyngier
  2011-10-03 17:35 ` [PATCH v4 09/10] ARM: SoC: convert shmobile sh73a0 " Marc Zyngier
  2011-10-03 17:35 ` [PATCH v4 10/10] ARM: smp: Make SoC descriptor mandatory for SMP platforms Marc Zyngier
  9 siblings, 0 replies; 24+ messages in thread
From: Marc Zyngier @ 2011-10-03 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

Convert ux500 platforms to use the SoC descriptor to provide
their SMP and CPU hotplug operations.

Cc: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm/mach-ux500/board-mop500.c       |    3 +++
 arch/arm/mach-ux500/board-u5500.c        |    1 +
 arch/arm/mach-ux500/hotplug.c            |    8 +++++---
 arch/arm/mach-ux500/include/mach/setup.h |    9 +++++++++
 arch/arm/mach-ux500/platsmp.c            |   23 +++++++++++++++++++----
 5 files changed, 37 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index bdd7b80..f0b1a00 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -691,6 +691,7 @@ static void __init hrefv60_init_machine(void)
 MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
 	/* Maintainer: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> */
 	.atag_offset	= 0x100,
+	.soc		= &ux500_soc_desc,
 	.map_io		= u8500_map_io,
 	.init_irq	= ux500_init_irq,
 	/* we re-use nomadik timer here */
@@ -700,6 +701,7 @@ MACHINE_END
 
 MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
 	.atag_offset	= 0x100,
+	.soc		= &ux500_soc_desc,
 	.map_io		= u8500_map_io,
 	.init_irq	= ux500_init_irq,
 	.timer		= &ux500_timer,
@@ -708,6 +710,7 @@ MACHINE_END
 
 MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
 	.atag_offset	= 0x100,
+	.soc		= &ux500_soc_desc,
 	.map_io		= u8500_map_io,
 	.init_irq	= ux500_init_irq,
 	/* we re-use nomadik timer here */
diff --git a/arch/arm/mach-ux500/board-u5500.c b/arch/arm/mach-ux500/board-u5500.c
index 82025ba..aeb125a 100644
--- a/arch/arm/mach-ux500/board-u5500.c
+++ b/arch/arm/mach-ux500/board-u5500.c
@@ -146,6 +146,7 @@ static void __init u5500_init_machine(void)
 
 MACHINE_START(U5500, "ST-Ericsson U5500 Platform")
 	.atag_offset	= 0x100,
+	.soc		= &ux500_soc_desc,
 	.map_io		= u5500_map_io,
 	.init_irq	= ux500_init_irq,
 	.timer		= &ux500_timer,
diff --git a/arch/arm/mach-ux500/hotplug.c b/arch/arm/mach-ux500/hotplug.c
index 572015e..03424ab 100644
--- a/arch/arm/mach-ux500/hotplug.c
+++ b/arch/arm/mach-ux500/hotplug.c
@@ -14,6 +14,8 @@
 
 #include <asm/cacheflush.h>
 
+#include <mach/setup.h>
+
 extern volatile int pen_release;
 
 static inline void platform_do_lowpower(unsigned int cpu)
@@ -33,7 +35,7 @@ static inline void platform_do_lowpower(unsigned int cpu)
 	}
 }
 
-int platform_cpu_kill(unsigned int cpu)
+int ux500_cpu_kill(unsigned int cpu)
 {
 	return 1;
 }
@@ -43,13 +45,13 @@ int platform_cpu_kill(unsigned int cpu)
  *
  * Called with IRQs disabled
  */
-void platform_cpu_die(unsigned int cpu)
+void ux500_cpu_die(unsigned int cpu)
 {
 	/* directly enter low power state, skipping secure registers */
 	platform_do_lowpower(cpu);
 }
 
-int platform_cpu_disable(unsigned int cpu)
+int ux500_cpu_disable(unsigned int cpu)
 {
 	/*
 	 * we don't allow CPU 0 to be shutdown (it is still too special
diff --git a/arch/arm/mach-ux500/include/mach/setup.h b/arch/arm/mach-ux500/include/mach/setup.h
index a7d363f..e764530 100644
--- a/arch/arm/mach-ux500/include/mach/setup.h
+++ b/arch/arm/mach-ux500/include/mach/setup.h
@@ -11,6 +11,7 @@
 #ifndef __ASM_ARCH_SETUP_H
 #define __ASM_ARCH_SETUP_H
 
+#include <asm/soc.h>
 #include <asm/mach/time.h>
 #include <linux/init.h>
 
@@ -50,4 +51,12 @@ extern struct sys_timer ux500_timer;
 	.type		= MT_MEMORY,		\
 }
 
+extern struct arm_soc_smp_init_ops ux500_soc_smp_init_ops;
+extern struct arm_soc_smp_ops ux500_soc_smp_ops;
+extern struct arm_soc_desc ux500_soc_desc;
+
+extern int  ux500_cpu_kill(unsigned int cpu);
+extern void ux500_cpu_die(unsigned int cpu);
+extern int  ux500_cpu_disable(unsigned int cpu);
+
 #endif /*  __ASM_ARCH_SETUP_H */
diff --git a/arch/arm/mach-ux500/platsmp.c b/arch/arm/mach-ux500/platsmp.c
index 27e5281..9e9254c 100644
--- a/arch/arm/mach-ux500/platsmp.c
+++ b/arch/arm/mach-ux500/platsmp.c
@@ -59,7 +59,7 @@ static void __iomem *scu_base_addr(void)
 
 static DEFINE_SPINLOCK(boot_lock);
 
-void __cpuinit platform_secondary_init(unsigned int cpu)
+static void __cpuinit ux500_secondary_init(unsigned int cpu)
 {
 	/*
 	 * if any interrupts are already enabled for the primary
@@ -81,7 +81,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
 	spin_unlock(&boot_lock);
 }
 
-int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
+static int __cpuinit ux500_boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
 	unsigned long timeout;
 
@@ -148,7 +148,7 @@ static void __init wakeup_secondary(void)
  * Initialise the CPU possible map early - this describes the CPUs
  * which may be present or become present in the system.
  */
-void __init smp_init_cpus(void)
+static void __init ux500_smp_init_cpus(void)
 {
 	void __iomem *scu_base = scu_base_addr();
 	unsigned int i, ncores;
@@ -170,9 +170,24 @@ void __init smp_init_cpus(void)
 	set_smp_cross_call(gic_raise_softirq);
 }
 
-void __init platform_smp_prepare_cpus(unsigned int max_cpus)
+static void __init ux500_smp_prepare_cpus(unsigned int max_cpus)
 {
 
 	scu_enable(scu_base_addr());
 	wakeup_secondary();
 }
+
+struct arm_soc_smp_init_ops ux500_soc_smp_init_ops __initdata = {
+	.smp_init_cpus		= ux500_smp_init_cpus,
+	.smp_prepare_cpus	= ux500_smp_prepare_cpus,
+};
+
+struct arm_soc_smp_ops ux500_soc_smp_ops __initdata = {
+	.smp_secondary_init	= ux500_secondary_init,
+	.smp_boot_secondary	= ux500_boot_secondary,
+#ifdef CONFIG_HOTPLUG_CPU
+	.cpu_kill		= ux500_cpu_kill,
+	.cpu_die		= ux500_cpu_die,
+	.cpu_disable		= ux500_cpu_disable,
+#endif
+};
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v4 09/10] ARM: SoC: convert shmobile sh73a0 to SoC descriptor
  2011-10-03 17:35 [PATCH v4 00/10] Per SoC descriptor Marc Zyngier
                   ` (7 preceding siblings ...)
  2011-10-03 17:35 ` [PATCH v4 08/10] ARM: SoC: convert ux500 " Marc Zyngier
@ 2011-10-03 17:35 ` Marc Zyngier
  2011-10-03 17:35 ` [PATCH v4 10/10] ARM: smp: Make SoC descriptor mandatory for SMP platforms Marc Zyngier
  9 siblings, 0 replies; 24+ messages in thread
From: Marc Zyngier @ 2011-10-03 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

Convert shmobile SMP platform to use the SoC descriptor to provide
its SMP and CPU hotplug operations.

Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm/mach-shmobile/Makefile              |    2 +-
 arch/arm/mach-shmobile/board-ag5evm.c        |    1 +
 arch/arm/mach-shmobile/hotplug.c             |    8 ++-
 arch/arm/mach-shmobile/include/mach/common.h |    7 +--
 arch/arm/mach-shmobile/include/mach/sh73a0.h |    6 ++
 arch/arm/mach-shmobile/platsmp.c             |   68 --------------------------
 arch/arm/mach-shmobile/setup-sh73a0.c        |    6 ++
 arch/arm/mach-shmobile/smp-sh73a0.c          |   35 ++++++++++++--
 8 files changed, 53 insertions(+), 80 deletions(-)
 delete mode 100644 arch/arm/mach-shmobile/platsmp.c

diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index 612b270..43754f3 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -12,7 +12,7 @@ obj-$(CONFIG_ARCH_SH7372)	+= setup-sh7372.o clock-sh7372.o intc-sh7372.o
 obj-$(CONFIG_ARCH_SH73A0)	+= setup-sh73a0.o clock-sh73a0.o intc-sh73a0.o
 
 # SMP objects
-smp-y				:= platsmp.o headsmp.o
+smp-y				:= headsmp.o
 smp-$(CONFIG_HOTPLUG_CPU)	+= hotplug.o
 smp-$(CONFIG_LOCAL_TIMERS)	+= localtimer.o
 smp-$(CONFIG_ARCH_SH73A0)	+= smp-sh73a0.o
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
index 475342b..448f51a 100644
--- a/arch/arm/mach-shmobile/board-ag5evm.c
+++ b/arch/arm/mach-shmobile/board-ag5evm.c
@@ -601,6 +601,7 @@ struct sys_timer ag5evm_timer = {
 
 MACHINE_START(AG5EVM, "ag5evm")
 	.map_io		= ag5evm_map_io,
+	.soc		= &sh73a0_soc_desc,
 	.init_irq	= ag5evm_init_irq,
 	.handle_irq	= shmobile_handle_irq_gic,
 	.init_machine	= ag5evm_init,
diff --git a/arch/arm/mach-shmobile/hotplug.c b/arch/arm/mach-shmobile/hotplug.c
index 238a0d9..687c8c2 100644
--- a/arch/arm/mach-shmobile/hotplug.c
+++ b/arch/arm/mach-shmobile/hotplug.c
@@ -13,12 +13,14 @@
 #include <linux/errno.h>
 #include <linux/smp.h>
 
-int platform_cpu_kill(unsigned int cpu)
+#include <mach/common.h>
+
+int shmobile_cpu_kill(unsigned int cpu)
 {
 	return 1;
 }
 
-void platform_cpu_die(unsigned int cpu)
+void shmobile_cpu_die(unsigned int cpu)
 {
 	while (1) {
 		/*
@@ -31,7 +33,7 @@ void platform_cpu_die(unsigned int cpu)
 	}
 }
 
-int platform_cpu_disable(unsigned int cpu)
+int shmobile_cpu_disable(unsigned int cpu)
 {
 	/*
 	 * we don't allow CPU 0 to be shutdown (it is still too special
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
index c0cdbf9..2283521 100644
--- a/arch/arm/mach-shmobile/include/mach/common.h
+++ b/arch/arm/mach-shmobile/include/mach/common.h
@@ -48,9 +48,8 @@ extern void sh73a0_pinmux_init(void);
 extern struct clk sh73a0_extal1_clk;
 extern struct clk sh73a0_extal2_clk;
 
-extern unsigned int sh73a0_get_core_count(void);
-extern void sh73a0_secondary_init(unsigned int cpu);
-extern int sh73a0_boot_secondary(unsigned int cpu);
-extern void sh73a0_smp_prepare_cpus(void);
+extern int shmobile_cpu_kill(unsigned int cpu);
+extern void shmobile_cpu_die(unsigned int cpu);
+extern int shmobile_cpu_disable(unsigned int cpu);
 
 #endif /* __ARCH_MACH_COMMON_H */
diff --git a/arch/arm/mach-shmobile/include/mach/sh73a0.h b/arch/arm/mach-shmobile/include/mach/sh73a0.h
index b385e97..d22a1a5 100644
--- a/arch/arm/mach-shmobile/include/mach/sh73a0.h
+++ b/arch/arm/mach-shmobile/include/mach/sh73a0.h
@@ -507,4 +507,10 @@ enum {
 	SHDMA_SLAVE_MMCIF_RX,
 };
 
+#include <asm/soc.h>
+
+extern struct arm_soc_smp_init_ops sh73a0_soc_smp_init_ops;
+extern struct arm_soc_smp_ops sh73a0_soc_smp_ops;
+extern struct arm_soc_desc sh73a0_soc_desc;
+
 #endif /* __ASM_SH73A0_H__ */
diff --git a/arch/arm/mach-shmobile/platsmp.c b/arch/arm/mach-shmobile/platsmp.c
deleted file mode 100644
index 66f9806..0000000
--- a/arch/arm/mach-shmobile/platsmp.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * SMP support for R-Mobile / SH-Mobile
- *
- * Copyright (C) 2010  Magnus Damm
- * Copyright (C) 2011  Paul Mundt
- *
- * Based on vexpress, Copyright (C) 2002 ARM Ltd, All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or modify
- * 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>
-#include <linux/device.h>
-#include <linux/smp.h>
-#include <linux/io.h>
-#include <asm/hardware/gic.h>
-#include <asm/localtimer.h>
-#include <asm/mach-types.h>
-#include <mach/common.h>
-
-static unsigned int __init shmobile_smp_get_core_count(void)
-{
-	if (machine_is_ag5evm())
-		return sh73a0_get_core_count();
-
-	return 1;
-}
-
-static void __init shmobile_smp_prepare_cpus(void)
-{
-	if (machine_is_ag5evm())
-		sh73a0_smp_prepare_cpus();
-}
-
-void __cpuinit platform_secondary_init(unsigned int cpu)
-{
-	trace_hardirqs_off();
-
-	if (machine_is_ag5evm())
-		sh73a0_secondary_init(cpu);
-}
-
-int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
-{
-	if (machine_is_ag5evm())
-		return sh73a0_boot_secondary(cpu);
-
-	return -ENOSYS;
-}
-
-void __init smp_init_cpus(void)
-{
-	unsigned int ncores = shmobile_smp_get_core_count();
-	unsigned int i;
-
-	for (i = 0; i < ncores; i++)
-		set_cpu_possible(i, true);
-
-	set_smp_cross_call(gic_raise_softirq);
-}
-
-void __init platform_smp_prepare_cpus(unsigned int max_cpus)
-{
-	shmobile_smp_prepare_cpus();
-}
diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c
index e46821c..85ab3e1 100644
--- a/arch/arm/mach-shmobile/setup-sh73a0.c
+++ b/arch/arm/mach-shmobile/setup-sh73a0.c
@@ -672,3 +672,9 @@ void __init sh73a0_add_early_devices(void)
 	early_platform_add_devices(sh73a0_early_devices,
 				   ARRAY_SIZE(sh73a0_early_devices));
 }
+
+struct arm_soc_desc sh73a0_soc_desc __initdata = {
+	.name		= "Renesas sh73a0",
+	soc_smp_init_ops(sh73a0_soc_smp_init_ops)
+	soc_smp_ops(sh73a0_soc_smp_ops)
+};
diff --git a/arch/arm/mach-shmobile/smp-sh73a0.c b/arch/arm/mach-shmobile/smp-sh73a0.c
index be1ade7..274b9c5 100644
--- a/arch/arm/mach-shmobile/smp-sh73a0.c
+++ b/arch/arm/mach-shmobile/smp-sh73a0.c
@@ -23,6 +23,7 @@
 #include <linux/spinlock.h>
 #include <linux/io.h>
 #include <mach/common.h>
+#include <mach/sh73a0.h>
 #include <asm/smp_scu.h>
 #include <asm/smp_twd.h>
 #include <asm/hardware/gic.h>
@@ -55,7 +56,7 @@ static void modify_scu_cpu_psr(unsigned long set, unsigned long clr)
 	__raw_writel(tmp, scu_base + 8);
 }
 
-unsigned int __init sh73a0_get_core_count(void)
+static unsigned int __init sh73a0_get_core_count(void)
 {
 	void __iomem *scu_base = scu_base_addr();
 
@@ -67,12 +68,12 @@ unsigned int __init sh73a0_get_core_count(void)
 	return scu_get_core_count(scu_base);
 }
 
-void __cpuinit sh73a0_secondary_init(unsigned int cpu)
+static void __cpuinit sh73a0_secondary_init(unsigned int cpu)
 {
 	gic_secondary_init(0);
 }
 
-int __cpuinit sh73a0_boot_secondary(unsigned int cpu)
+static int __cpuinit sh73a0_boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
 	cpu = cpu_logical_map(cpu);
 
@@ -87,7 +88,7 @@ int __cpuinit sh73a0_boot_secondary(unsigned int cpu)
 	return 0;
 }
 
-void __init sh73a0_smp_prepare_cpus(void)
+static void __init sh73a0_smp_prepare_cpus(unsigned int max_cpus)
 {
 	int cpu = cpu_logical_map(0);
 
@@ -100,3 +101,29 @@ void __init sh73a0_smp_prepare_cpus(void)
 	/* enable cache coherency on CPU0 */
 	modify_scu_cpu_psr(0, 3 << (cpu * 8));
 }
+
+static void __init sh73a0_smp_init_cpus(void)
+{
+	unsigned int ncores = sh73a0_get_core_count();
+	unsigned int i;
+
+	for (i = 0; i < ncores; i++)
+		set_cpu_possible(i, true);
+
+	set_smp_cross_call(gic_raise_softirq);
+}
+
+struct arm_soc_smp_init_ops sh73a0_soc_smp_init_ops __initdata = {
+	.smp_init_cpus		= sh73a0_smp_init_cpus,
+	.smp_prepare_cpus	= sh73a0_smp_prepare_cpus,
+};
+
+struct arm_soc_smp_ops sh73a0_soc_smp_ops __initdata = {
+	.smp_secondary_init	= sh73a0_secondary_init,
+	.smp_boot_secondary	= sh73a0_boot_secondary,
+#ifdef CONFIG_HOTPLUG_CPU
+	.cpu_kill		= shmobile_cpu_kill,
+	.cpu_die		= shmobile_cpu_die,
+	.cpu_disable		= shmobile_cpu_disable,
+#endif
+};
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v4 10/10] ARM: smp: Make SoC descriptor mandatory for SMP platforms
  2011-10-03 17:35 [PATCH v4 00/10] Per SoC descriptor Marc Zyngier
                   ` (8 preceding siblings ...)
  2011-10-03 17:35 ` [PATCH v4 09/10] ARM: SoC: convert shmobile sh73a0 " Marc Zyngier
@ 2011-10-03 17:35 ` Marc Zyngier
  9 siblings, 0 replies; 24+ messages in thread
From: Marc Zyngier @ 2011-10-03 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

Now that all SMP platforms have been converted to the SOC descriptor
and its SMP operations, remove the "weak" attribute from the hooks
in smp.c, and make the functions static wherever possible.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm/include/asm/smp.h |   15 ---------------
 arch/arm/kernel/smp.c      |   18 +++++++++---------
 2 files changed, 9 insertions(+), 24 deletions(-)

diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h
index 674ebcd..bf25484 100644
--- a/arch/arm/include/asm/smp.h
+++ b/arch/arm/include/asm/smp.h
@@ -56,16 +56,6 @@ extern int boot_secondary(unsigned int cpu, struct task_struct *);
 asmlinkage void secondary_start_kernel(void);
 
 /*
- * Perform platform specific initialisation of the specified CPU.
- */
-extern void platform_secondary_init(unsigned int cpu);
-
-/*
- * Initialize cpu_possible map, and enable coherency
- */
-extern void platform_smp_prepare_cpus(unsigned int);
-
-/*
  * Logical CPU mapping.
  */
 extern int __cpu_logical_map[NR_CPUS];
@@ -82,15 +72,10 @@ struct secondary_data {
 extern struct secondary_data secondary_data;
 
 extern int __cpu_disable(void);
-extern int platform_cpu_disable(unsigned int cpu);
 
 extern void __cpu_die(unsigned int cpu);
 extern void cpu_die(void);
 
-extern void platform_cpu_die(unsigned int cpu);
-extern int platform_cpu_kill(unsigned int cpu);
-extern void platform_cpu_enable(unsigned int cpu);
-
 extern void arch_send_call_function_single_ipi(int cpu);
 extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
 
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index e08d2e8..c594ed2 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -157,25 +157,25 @@ int __cpuinit __cpu_up(unsigned int cpu)
 }
 
 /* SoC helpers */
-void __attribute__((weak)) __init smp_init_cpus(void)
+void __init smp_init_cpus(void)
 {
 	if (soc_smp_init_ops && soc_smp_init_ops->smp_init_cpus)
 		soc_smp_init_ops->smp_init_cpus();
 }
 
-void __attribute__((weak)) __init platform_smp_prepare_cpus(unsigned int max_cpus)
+static void __init platform_smp_prepare_cpus(unsigned int max_cpus)
 {
 	if (soc_smp_ops && soc_smp_init_ops->smp_prepare_cpus)
 		soc_smp_init_ops->smp_prepare_cpus(max_cpus);
 }
 
-void __attribute__((weak)) __cpuinit platform_secondary_init(unsigned int cpu)
+static void __cpuinit platform_secondary_init(unsigned int cpu)
 {
 	if (soc_smp_ops && soc_smp_ops->smp_secondary_init)
 		soc_smp_ops->smp_secondary_init(cpu);
 }
 
-int __attribute__((weak)) __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
+int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
 	if (soc_smp_ops && soc_smp_ops->smp_boot_secondary)
 		return soc_smp_ops->smp_boot_secondary(cpu, idle);
@@ -185,20 +185,20 @@ int __attribute__((weak)) __cpuinit boot_secondary(unsigned int cpu, struct task
 #ifdef CONFIG_HOTPLUG_CPU
 static void percpu_timer_stop(void);
 
-int __attribute__((weak)) __cpuinit platform_cpu_kill(unsigned int cpu)
+static int __cpuinit platform_cpu_kill(unsigned int cpu)
 {
 	if (soc_smp_ops && soc_smp_ops->cpu_kill)
 		return soc_smp_ops->cpu_kill(cpu);
 	return 0;
 }
 
-void __attribute__((weak)) __cpuinit platform_cpu_die(unsigned int cpu)
+static void __cpuinit platform_cpu_die(unsigned int cpu)
 {
 	if (soc_smp_ops && soc_smp_ops->cpu_die)
 		soc_smp_ops->cpu_die(cpu);
 }
 
-int __attribute__((weak)) __cpuinit platform_cpu_disable(unsigned int cpu)
+static int __cpuinit platform_cpu_disable(unsigned int cpu)
 {
 	if (soc_smp_ops && soc_smp_ops->cpu_disable)
 		return soc_smp_ops->cpu_disable(cpu);
@@ -208,7 +208,7 @@ int __attribute__((weak)) __cpuinit platform_cpu_disable(unsigned int cpu)
 /*
  * __cpu_disable runs on the processor to be shutdown.
  */
-int __cpu_disable(void)
+int __cpuinit __cpu_disable(void)
 {
 	unsigned int cpu = smp_processor_id();
 	struct task_struct *p;
@@ -257,7 +257,7 @@ static DECLARE_COMPLETION(cpu_died);
  * called on the thread which is asking for a CPU to be shutdown -
  * waits until shutdown has completed, or it is timed out.
  */
-void __cpu_die(unsigned int cpu)
+void __cpuinit __cpu_die(unsigned int cpu)
 {
 	if (!wait_for_completion_timeout(&cpu_died, msecs_to_jiffies(5000))) {
 		pr_err("CPU%u: cpu didn't die\n", cpu);
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v4 02/10] ARM: SoC: Add per SoC SMP and CPU hotplug operations
  2011-10-03 17:35 ` [PATCH v4 02/10] ARM: SoC: Add per SoC SMP and CPU hotplug operations Marc Zyngier
@ 2011-10-03 19:12   ` Nicolas Pitre
  2011-10-04  9:44     ` Marc Zyngier
  2011-10-04 10:30   ` Kyungmin Park
  1 sibling, 1 reply; 24+ messages in thread
From: Nicolas Pitre @ 2011-10-03 19:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 3 Oct 2011, Marc Zyngier wrote:

> Populate the SoC descriptor structure with the SMP and CPU hotplug
> operations. To allow the kernel to continue building, the platform
> hooks are defined as weak symbols which are overrided by the
> platform code. Once all platforms are converted, the "weak" attribute
> will be removed and the function made static.
> 
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Nicolas Pitre <nico@fluxnic.net>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
[...]
> --- a/arch/arm/kernel/setup.c
> +++ b/arch/arm/kernel/setup.c
> @@ -141,8 +141,12 @@ static const char *cpu_name;
>  static const char *machine_name;
>  static char __initdata cmd_line[COMMAND_LINE_SIZE];
>  struct machine_desc *machine_desc __initdata;
> -const struct arm_soc_desc *soc_desc;
> -static struct arm_soc_desc __soc_desc __read_mostly;
> +const struct arm_soc_desc *soc_desc __initdata;

Does the above belong in this patch?

> +#ifdef CONFIG_SMP
> +const struct arm_soc_smp_init_ops *soc_smp_init_ops  __initdata;
> +const struct arm_soc_smp_ops *soc_smp_ops  __cpuinitdata;
> +static struct arm_soc_smp_ops __soc_smp_ops __cpuinitdata;
> +#endif

Maybe those could be moved in smp.c instead.


Nicolas

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH v4 05/10] ARM: SoC: convert Tegra to SoC descriptor
  2011-10-03 17:35 ` [PATCH v4 05/10] ARM: SoC: convert Tegra " Marc Zyngier
@ 2011-10-03 20:52   ` Stephen Warren
  2011-10-04  9:47     ` Marc Zyngier
  0 siblings, 1 reply; 24+ messages in thread
From: Stephen Warren @ 2011-10-03 20:52 UTC (permalink / raw)
  To: linux-arm-kernel

Marc Zyngier wrote at Monday, October 03, 2011 11:36 AM:
> Convert Tegra to use the SoC descriptor to provide its SMP
> and CPU hotplug operations.

> diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
...
> +struct arm_soc_desc tegra_soc_desc __initdata = {
> +	.name		= "nVIDIA Tegra",

Technically, we're supposed to say "NVIDIA" not "nVIDIA", but no need to
respin just for that! So,

Acked-by: Stephen Warren <swarren@nvidia.com>

-- 
nvpublic

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH v4 04/10] ARM: SoC: convert OMAP4 to SoC descriptor
  2011-10-03 17:35 ` [PATCH v4 04/10] ARM: SoC: convert OMAP4 " Marc Zyngier
@ 2011-10-04  6:32   ` Shilimkar, Santosh
  2011-10-04  9:44     ` Marc Zyngier
  0 siblings, 1 reply; 24+ messages in thread
From: Shilimkar, Santosh @ 2011-10-04  6:32 UTC (permalink / raw)
  To: linux-arm-kernel

Marc,

On Mon, Oct 3, 2011 at 11:05 PM, Marc Zyngier <marc.zyngier@arm.com> wrote:
> Convert OMAP4 to use the SoC descriptor to provide its SMP
> and CPU hotplug operations.
>
> Tested on both Panda and IGEPv2 (MULTI_OMAP kernel)
>
> Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
The changes very trivial and they look fine to me.
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>

Regards
Santosh

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH v4 02/10] ARM: SoC: Add per SoC SMP and CPU hotplug operations
  2011-10-03 19:12   ` Nicolas Pitre
@ 2011-10-04  9:44     ` Marc Zyngier
  0 siblings, 0 replies; 24+ messages in thread
From: Marc Zyngier @ 2011-10-04  9:44 UTC (permalink / raw)
  To: linux-arm-kernel

On 03/10/11 20:12, Nicolas Pitre wrote:
> On Mon, 3 Oct 2011, Marc Zyngier wrote:
> 
>> Populate the SoC descriptor structure with the SMP and CPU hotplug
>> operations. To allow the kernel to continue building, the platform
>> hooks are defined as weak symbols which are overrided by the
>> platform code. Once all platforms are converted, the "weak" attribute
>> will be removed and the function made static.
>>
>> Cc: Arnd Bergmann <arnd@arndb.de>
>> Cc: Nicolas Pitre <nico@fluxnic.net>
>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>> ---
> [...]
>> --- a/arch/arm/kernel/setup.c
>> +++ b/arch/arm/kernel/setup.c
>> @@ -141,8 +141,12 @@ static const char *cpu_name;
>>  static const char *machine_name;
>>  static char __initdata cmd_line[COMMAND_LINE_SIZE];
>>  struct machine_desc *machine_desc __initdata;
>> -const struct arm_soc_desc *soc_desc;
>> -static struct arm_soc_desc __soc_desc __read_mostly;
>> +const struct arm_soc_desc *soc_desc __initdata;
> 
> Does the above belong in this patch?

Looks like a leftover from a previous rework. Will fix.

>> +#ifdef CONFIG_SMP
>> +const struct arm_soc_smp_init_ops *soc_smp_init_ops  __initdata;
>> +const struct arm_soc_smp_ops *soc_smp_ops  __cpuinitdata;
>> +static struct arm_soc_smp_ops __soc_smp_ops __cpuinitdata;
>> +#endif
> 
> Maybe those could be moved in smp.c instead.

Good point, this actually makes a nice cleanup (the assignment of these
variables can also move to smp.c, making them static).

I'll repost the 3 affected patches shortly.

Thanks for reviewing,

	M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH v4 04/10] ARM: SoC: convert OMAP4 to SoC descriptor
  2011-10-04  6:32   ` Shilimkar, Santosh
@ 2011-10-04  9:44     ` Marc Zyngier
  0 siblings, 0 replies; 24+ messages in thread
From: Marc Zyngier @ 2011-10-04  9:44 UTC (permalink / raw)
  To: linux-arm-kernel

On 04/10/11 07:32, Shilimkar, Santosh wrote:
> Marc,
> 
> On Mon, Oct 3, 2011 at 11:05 PM, Marc Zyngier <marc.zyngier@arm.com> wrote:
>> Convert OMAP4 to use the SoC descriptor to provide its SMP
>> and CPU hotplug operations.
>>
>> Tested on both Panda and IGEPv2 (MULTI_OMAP kernel)
>>
>> Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>> ---
> The changes very trivial and they look fine to me.
> Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>

Thanks Santosh.

	M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH v4 05/10] ARM: SoC: convert Tegra to SoC descriptor
  2011-10-03 20:52   ` Stephen Warren
@ 2011-10-04  9:47     ` Marc Zyngier
  0 siblings, 0 replies; 24+ messages in thread
From: Marc Zyngier @ 2011-10-04  9:47 UTC (permalink / raw)
  To: linux-arm-kernel

On 03/10/11 21:52, Stephen Warren wrote:
> Marc Zyngier wrote at Monday, October 03, 2011 11:36 AM:
>> Convert Tegra to use the SoC descriptor to provide its SMP
>> and CPU hotplug operations.
> 
>> diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
> ...
>> +struct arm_soc_desc tegra_soc_desc __initdata = {
>> +	.name		= "nVIDIA Tegra",
> 
> Technically, we're supposed to say "NVIDIA" not "nVIDIA", but no need to
> respin just for that! So,

Ah! I'll fix that in my tree. There's a pending respin anyway...

> Acked-by: Stephen Warren <swarren@nvidia.com>

Thanks Stephen.

	M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH v4 02/10] ARM: SoC: Add per SoC SMP and CPU hotplug operations
  2011-10-03 17:35 ` [PATCH v4 02/10] ARM: SoC: Add per SoC SMP and CPU hotplug operations Marc Zyngier
  2011-10-03 19:12   ` Nicolas Pitre
@ 2011-10-04 10:30   ` Kyungmin Park
  2011-10-04 10:35     ` Kyungmin Park
  1 sibling, 1 reply; 24+ messages in thread
From: Kyungmin Park @ 2011-10-04 10:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Oct 4, 2011 at 2:35 AM, Marc Zyngier <marc.zyngier@arm.com> wrote:
> Populate the SoC descriptor structure with the SMP and CPU hotplug
> operations. To allow the kernel to continue building, the platform
> hooks are defined as weak symbols which are overrided by the
> platform code. Once all platforms are converted, the "weak" attribute
> will be removed and the function made static.
>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Nicolas Pitre <nico@fluxnic.net>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
> ?arch/arm/include/asm/soc.h | ? 48 ++++++++++++++++++++++++++++++++++++++++++-
> ?arch/arm/kernel/setup.c ? ?| ? 29 ++++++++++++++++++++++---
> ?arch/arm/kernel/smp.c ? ? ?| ? 47 +++++++++++++++++++++++++++++++++++++++++++
> ?3 files changed, 118 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/include/asm/soc.h b/arch/arm/include/asm/soc.h
> index ce92784..f1dd657 100644
> --- a/arch/arm/include/asm/soc.h
> +++ b/arch/arm/include/asm/soc.h
> @@ -12,10 +12,54 @@
> ?#ifndef __ASM_ARM_SOC_H
> ?#define __ASM_ARM_SOC_H
>
> +struct task_struct;
> +
> +struct arm_soc_smp_init_ops {
> + ? ? ? /*
> + ? ? ? ?* Setup the set of possible CPUs (via set_cpu_possible)
> + ? ? ? ?*/
> + ? ? ? void (*smp_init_cpus)(void);
> + ? ? ? /*
> + ? ? ? ?* Initialize cpu_possible map, and enable coherency
> + ? ? ? ?*/
> + ? ? ? void (*smp_prepare_cpus)(unsigned int max_cpus);
> +};
> +
> +struct arm_soc_smp_ops {
> + ? ? ? /*
> + ? ? ? ?* Perform platform specific initialisation of the specified CPU.
> + ? ? ? ?*/
> + ? ? ? void (*smp_secondary_init)(unsigned int cpu);
> + ? ? ? /*
> + ? ? ? ?* Boot a secondary CPU, and assign it the specified idle task.
> + ? ? ? ?* This also gives us the initial stack to use for this CPU.
> + ? ? ? ?*/
> + ? ? ? int ?(*smp_boot_secondary)(unsigned int cpu, struct task_struct *idle);
> +#ifdef CONFIG_HOTPLUG_CPU
> + ? ? ? int ?(*cpu_kill)(unsigned int cpu);
> + ? ? ? void (*cpu_die)(unsigned int cpu);
> + ? ? ? int ?(*cpu_disable)(unsigned int cpu);
> +#endif
> +};
> +
> ?struct arm_soc_desc {
> - ? ? ? const char ? ? ? ? ? ? ?*name;
> + ? ? ? const char ? ? ? ? ? ? ? ? ? ? ?*name;
> +#ifdef CONFIG_SMP
> + ? ? ? struct arm_soc_smp_init_ops ? ? *smp_init_ops;
> + ? ? ? struct arm_soc_smp_ops ? ? ? ? ?*smp_ops;
> +#endif
> ?};
>
> -extern const struct arm_soc_desc ? ? ? *soc_desc;
> +#ifdef CONFIG_SMP
> +#define soc_smp_init_ops(ops) ?.smp_init_ops = &(ops),
> +#define soc_smp_ops(ops) ? ? ? .smp_ops = &(ops),
> +#else
> +#define soc_smp_init_ops(ops) ?/* empty */
> +#define soc_smp_ops(ops) ? ? ? /* empty */
> +#endif
> +
> +extern const struct arm_soc_desc ? ? ? ? ? ? ? *soc_desc;
> +extern const struct arm_soc_smp_init_ops ? ? ? *soc_smp_init_ops;
> +extern const struct arm_soc_smp_ops ? ? ? ? ? ?*soc_smp_ops;
>
> ?#endif /* __ASM_ARM_SOC_H */
> diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
> index 34ffb2e..351ae18 100644
> --- a/arch/arm/kernel/setup.c
> +++ b/arch/arm/kernel/setup.c
> @@ -141,8 +141,12 @@ static const char *cpu_name;
> ?static const char *machine_name;
> ?static char __initdata cmd_line[COMMAND_LINE_SIZE];
> ?struct machine_desc *machine_desc __initdata;
> -const struct arm_soc_desc *soc_desc;
> -static struct arm_soc_desc __soc_desc __read_mostly;
> +const struct arm_soc_desc *soc_desc __initdata;
> +#ifdef CONFIG_SMP
> +const struct arm_soc_smp_init_ops *soc_smp_init_ops ?__initdata;
> +const struct arm_soc_smp_ops *soc_smp_ops ?__cpuinitdata;
> +static struct arm_soc_smp_ops __soc_smp_ops __cpuinitdata;
> +#endif
>
> ?static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
> ?static union { char c[4]; unsigned long l; } endian_test __initdata = { { 'l', '?', '?', 'b' } };
> @@ -917,11 +921,28 @@ void __init setup_arch(char **cmdline_p)
> ? ? ? ?machine_desc = mdesc;
> ? ? ? ?machine_name = mdesc->name;
> ? ? ? ?if (mdesc->soc) {
> - ? ? ? ? ? ? ? __soc_desc = *mdesc->soc;
> - ? ? ? ? ? ? ? soc_desc = &__soc_desc;
> + ? ? ? ? ? ? ? soc_desc = mdesc->soc;
> ? ? ? ? ? ? ? ?pr_info("SoC: %s\n", soc_desc->name);
> ? ? ? ?} else
> ? ? ? ? ? ? ? ?soc_desc = NULL;
> +#ifdef CONFIG_SMP
> + ? ? ? if (soc_desc && soc_desc->smp_init_ops)
> + ? ? ? ? ? ? ? soc_smp_init_ops = soc_desc->smp_init_ops;
> + ? ? ? else
> + ? ? ? ? ? ? ? soc_smp_ops = NULL;
It should be "soc_smp_init_ops = NULL;"

Thank you,
Kyungmin Park
> +
> + ? ? ? /*
> + ? ? ? ?* Warning: we're copying an __initdata structure into a
> + ? ? ? ?* __cpuinitdata structure. We *know* it is valid because only
> + ? ? ? ?* __cpuinit (or more persistant) functions should be pointed
> + ? ? ? ?* to by soc_smp_ops. Still, this is borderline ugly.
> + ? ? ? ?*/
> + ? ? ? if (soc_desc && soc_desc->smp_ops) {
> + ? ? ? ? ? ? ? __soc_smp_ops = *soc_desc->smp_ops;
> + ? ? ? ? ? ? ? soc_smp_ops = &__soc_smp_ops;
> + ? ? ? } else
> + ? ? ? ? ? ? ? soc_smp_ops = NULL;
> +#endif
>
> ? ? ? ?if (mdesc->soft_reboot)
> ? ? ? ? ? ? ? ?reboot_setup("s");
> diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
> index 8bb30c2..e08d2e8 100644
> --- a/arch/arm/kernel/smp.c
> +++ b/arch/arm/kernel/smp.c
> @@ -28,6 +28,7 @@
> ?#include <linux/completion.h>
>
> ?#include <linux/atomic.h>
> +#include <asm/soc.h>
> ?#include <asm/cacheflush.h>
> ?#include <asm/cpu.h>
> ?#include <asm/cputype.h>
> @@ -155,9 +156,55 @@ int __cpuinit __cpu_up(unsigned int cpu)
> ? ? ? ?return ret;
> ?}
>
> +/* SoC helpers */
> +void __attribute__((weak)) __init smp_init_cpus(void)
> +{
> + ? ? ? if (soc_smp_init_ops && soc_smp_init_ops->smp_init_cpus)
> + ? ? ? ? ? ? ? soc_smp_init_ops->smp_init_cpus();
> +}
> +
> +void __attribute__((weak)) __init platform_smp_prepare_cpus(unsigned int max_cpus)
> +{
> + ? ? ? if (soc_smp_ops && soc_smp_init_ops->smp_prepare_cpus)
> + ? ? ? ? ? ? ? soc_smp_init_ops->smp_prepare_cpus(max_cpus);
> +}
> +
> +void __attribute__((weak)) __cpuinit platform_secondary_init(unsigned int cpu)
> +{
> + ? ? ? if (soc_smp_ops && soc_smp_ops->smp_secondary_init)
> + ? ? ? ? ? ? ? soc_smp_ops->smp_secondary_init(cpu);
> +}
> +
> +int __attribute__((weak)) __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
> +{
> + ? ? ? if (soc_smp_ops && soc_smp_ops->smp_boot_secondary)
> + ? ? ? ? ? ? ? return soc_smp_ops->smp_boot_secondary(cpu, idle);
> + ? ? ? return -ENOSYS;
> +}
> +
> ?#ifdef CONFIG_HOTPLUG_CPU
> ?static void percpu_timer_stop(void);
>
> +int __attribute__((weak)) __cpuinit platform_cpu_kill(unsigned int cpu)
> +{
> + ? ? ? if (soc_smp_ops && soc_smp_ops->cpu_kill)
> + ? ? ? ? ? ? ? return soc_smp_ops->cpu_kill(cpu);
> + ? ? ? return 0;
> +}
> +
> +void __attribute__((weak)) __cpuinit platform_cpu_die(unsigned int cpu)
> +{
> + ? ? ? if (soc_smp_ops && soc_smp_ops->cpu_die)
> + ? ? ? ? ? ? ? soc_smp_ops->cpu_die(cpu);
> +}
> +
> +int __attribute__((weak)) __cpuinit platform_cpu_disable(unsigned int cpu)
> +{
> + ? ? ? if (soc_smp_ops && soc_smp_ops->cpu_disable)
> + ? ? ? ? ? ? ? return soc_smp_ops->cpu_disable(cpu);
> + ? ? ? return -EPERM;
> +}
> +
> ?/*
> ?* __cpu_disable runs on the processor to be shutdown.
> ?*/
> --
> 1.7.0.4
>
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH v4 02/10] ARM: SoC: Add per SoC SMP and CPU hotplug operations
  2011-10-04 10:30   ` Kyungmin Park
@ 2011-10-04 10:35     ` Kyungmin Park
  0 siblings, 0 replies; 24+ messages in thread
From: Kyungmin Park @ 2011-10-04 10:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Oct 4, 2011 at 7:30 PM, Kyungmin Park <kmpark@infradead.org> wrote:
> On Tue, Oct 4, 2011 at 2:35 AM, Marc Zyngier <marc.zyngier@arm.com> wrote:
>> Populate the SoC descriptor structure with the SMP and CPU hotplug
>> operations. To allow the kernel to continue building, the platform
>> hooks are defined as weak symbols which are overrided by the
>> platform code. Once all platforms are converted, the "weak" attribute
>> will be removed and the function made static.
>>
>> Cc: Arnd Bergmann <arnd@arndb.de>
>> Cc: Nicolas Pitre <nico@fluxnic.net>
>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>> ---
>> ?arch/arm/include/asm/soc.h | ? 48 ++++++++++++++++++++++++++++++++++++++++++-
>> ?arch/arm/kernel/setup.c ? ?| ? 29 ++++++++++++++++++++++---
>> ?arch/arm/kernel/smp.c ? ? ?| ? 47 +++++++++++++++++++++++++++++++++++++++++++
>> ?3 files changed, 118 insertions(+), 6 deletions(-)
>>
>> diff --git a/arch/arm/include/asm/soc.h b/arch/arm/include/asm/soc.h
>> index ce92784..f1dd657 100644
>> --- a/arch/arm/include/asm/soc.h
>> +++ b/arch/arm/include/asm/soc.h
>> @@ -12,10 +12,54 @@
>> ?#ifndef __ASM_ARM_SOC_H
>> ?#define __ASM_ARM_SOC_H
>>
>> +struct task_struct;
>> +
>> +struct arm_soc_smp_init_ops {
>> + ? ? ? /*
>> + ? ? ? ?* Setup the set of possible CPUs (via set_cpu_possible)
>> + ? ? ? ?*/
>> + ? ? ? void (*smp_init_cpus)(void);
>> + ? ? ? /*
>> + ? ? ? ?* Initialize cpu_possible map, and enable coherency
>> + ? ? ? ?*/
>> + ? ? ? void (*smp_prepare_cpus)(unsigned int max_cpus);
>> +};
>> +
>> +struct arm_soc_smp_ops {
>> + ? ? ? /*
>> + ? ? ? ?* Perform platform specific initialisation of the specified CPU.
>> + ? ? ? ?*/
>> + ? ? ? void (*smp_secondary_init)(unsigned int cpu);
>> + ? ? ? /*
>> + ? ? ? ?* Boot a secondary CPU, and assign it the specified idle task.
>> + ? ? ? ?* This also gives us the initial stack to use for this CPU.
>> + ? ? ? ?*/
>> + ? ? ? int ?(*smp_boot_secondary)(unsigned int cpu, struct task_struct *idle);
>> +#ifdef CONFIG_HOTPLUG_CPU
>> + ? ? ? int ?(*cpu_kill)(unsigned int cpu);
>> + ? ? ? void (*cpu_die)(unsigned int cpu);
>> + ? ? ? int ?(*cpu_disable)(unsigned int cpu);
>> +#endif
>> +};
>> +
>> ?struct arm_soc_desc {
>> - ? ? ? const char ? ? ? ? ? ? ?*name;
>> + ? ? ? const char ? ? ? ? ? ? ? ? ? ? ?*name;
>> +#ifdef CONFIG_SMP
>> + ? ? ? struct arm_soc_smp_init_ops ? ? *smp_init_ops;
>> + ? ? ? struct arm_soc_smp_ops ? ? ? ? ?*smp_ops;
>> +#endif
>> ?};
>>
>> -extern const struct arm_soc_desc ? ? ? *soc_desc;
>> +#ifdef CONFIG_SMP
>> +#define soc_smp_init_ops(ops) ?.smp_init_ops = &(ops),
>> +#define soc_smp_ops(ops) ? ? ? .smp_ops = &(ops),
>> +#else
>> +#define soc_smp_init_ops(ops) ?/* empty */
>> +#define soc_smp_ops(ops) ? ? ? /* empty */
>> +#endif
>> +
>> +extern const struct arm_soc_desc ? ? ? ? ? ? ? *soc_desc;
>> +extern const struct arm_soc_smp_init_ops ? ? ? *soc_smp_init_ops;
>> +extern const struct arm_soc_smp_ops ? ? ? ? ? ?*soc_smp_ops;
>>
>> ?#endif /* __ASM_ARM_SOC_H */
>> diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
>> index 34ffb2e..351ae18 100644
>> --- a/arch/arm/kernel/setup.c
>> +++ b/arch/arm/kernel/setup.c
>> @@ -141,8 +141,12 @@ static const char *cpu_name;
>> ?static const char *machine_name;
>> ?static char __initdata cmd_line[COMMAND_LINE_SIZE];
>> ?struct machine_desc *machine_desc __initdata;
>> -const struct arm_soc_desc *soc_desc;
>> -static struct arm_soc_desc __soc_desc __read_mostly;
>> +const struct arm_soc_desc *soc_desc __initdata;
>> +#ifdef CONFIG_SMP
>> +const struct arm_soc_smp_init_ops *soc_smp_init_ops ?__initdata;
>> +const struct arm_soc_smp_ops *soc_smp_ops ?__cpuinitdata;
>> +static struct arm_soc_smp_ops __soc_smp_ops __cpuinitdata;
>> +#endif
>>
>> ?static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
>> ?static union { char c[4]; unsigned long l; } endian_test __initdata = { { 'l', '?', '?', 'b' } };
>> @@ -917,11 +921,28 @@ void __init setup_arch(char **cmdline_p)
>> ? ? ? ?machine_desc = mdesc;
>> ? ? ? ?machine_name = mdesc->name;
>> ? ? ? ?if (mdesc->soc) {
>> - ? ? ? ? ? ? ? __soc_desc = *mdesc->soc;
>> - ? ? ? ? ? ? ? soc_desc = &__soc_desc;
>> + ? ? ? ? ? ? ? soc_desc = mdesc->soc;
>> ? ? ? ? ? ? ? ?pr_info("SoC: %s\n", soc_desc->name);
>> ? ? ? ?} else
>> ? ? ? ? ? ? ? ?soc_desc = NULL;
>> +#ifdef CONFIG_SMP
>> + ? ? ? if (soc_desc && soc_desc->smp_init_ops)
>> + ? ? ? ? ? ? ? soc_smp_init_ops = soc_desc->smp_init_ops;
>> + ? ? ? else
>> + ? ? ? ? ? ? ? soc_smp_ops = NULL;
> It should be "soc_smp_init_ops = NULL;"
>
> Thank you,
> Kyungmin Park
>> +
>> + ? ? ? /*
>> + ? ? ? ?* Warning: we're copying an __initdata structure into a
>> + ? ? ? ?* __cpuinitdata structure. We *know* it is valid because only
>> + ? ? ? ?* __cpuinit (or more persistant) functions should be pointed
>> + ? ? ? ?* to by soc_smp_ops. Still, this is borderline ugly.
>> + ? ? ? ?*/
>> + ? ? ? if (soc_desc && soc_desc->smp_ops) {
>> + ? ? ? ? ? ? ? __soc_smp_ops = *soc_desc->smp_ops;
>> + ? ? ? ? ? ? ? soc_smp_ops = &__soc_smp_ops;
>> + ? ? ? } else
>> + ? ? ? ? ? ? ? soc_smp_ops = NULL;
>> +#endif
>>
>> ? ? ? ?if (mdesc->soft_reboot)
>> ? ? ? ? ? ? ? ?reboot_setup("s");
>> diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
>> index 8bb30c2..e08d2e8 100644
>> --- a/arch/arm/kernel/smp.c
>> +++ b/arch/arm/kernel/smp.c
>> @@ -28,6 +28,7 @@
>> ?#include <linux/completion.h>
>>
>> ?#include <linux/atomic.h>
>> +#include <asm/soc.h>
>> ?#include <asm/cacheflush.h>
>> ?#include <asm/cpu.h>
>> ?#include <asm/cputype.h>
>> @@ -155,9 +156,55 @@ int __cpuinit __cpu_up(unsigned int cpu)
>> ? ? ? ?return ret;
>> ?}
>>
>> +/* SoC helpers */
>> +void __attribute__((weak)) __init smp_init_cpus(void)
>> +{
>> + ? ? ? if (soc_smp_init_ops && soc_smp_init_ops->smp_init_cpus)
>> + ? ? ? ? ? ? ? soc_smp_init_ops->smp_init_cpus();
>> +}
>> +
>> +void __attribute__((weak)) __init platform_smp_prepare_cpus(unsigned int max_cpus)
>> +{
>> + ? ? ? if (soc_smp_ops && soc_smp_init_ops->smp_prepare_cpus)
>> + ? ? ? ? ? ? ? soc_smp_init_ops->smp_prepare_cpus(max_cpus);
>> +}
One more, if (soc_smp_init_ops && ...)
>> +
>> +void __attribute__((weak)) __cpuinit platform_secondary_init(unsigned int cpu)
>> +{
>> + ? ? ? if (soc_smp_ops && soc_smp_ops->smp_secondary_init)
>> + ? ? ? ? ? ? ? soc_smp_ops->smp_secondary_init(cpu);
>> +}
>> +
>> +int __attribute__((weak)) __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
>> +{
>> + ? ? ? if (soc_smp_ops && soc_smp_ops->smp_boot_secondary)
>> + ? ? ? ? ? ? ? return soc_smp_ops->smp_boot_secondary(cpu, idle);
>> + ? ? ? return -ENOSYS;
>> +}
>> +
>> ?#ifdef CONFIG_HOTPLUG_CPU
>> ?static void percpu_timer_stop(void);
>>
>> +int __attribute__((weak)) __cpuinit platform_cpu_kill(unsigned int cpu)
>> +{
>> + ? ? ? if (soc_smp_ops && soc_smp_ops->cpu_kill)
>> + ? ? ? ? ? ? ? return soc_smp_ops->cpu_kill(cpu);
>> + ? ? ? return 0;
>> +}
>> +
>> +void __attribute__((weak)) __cpuinit platform_cpu_die(unsigned int cpu)
>> +{
>> + ? ? ? if (soc_smp_ops && soc_smp_ops->cpu_die)
>> + ? ? ? ? ? ? ? soc_smp_ops->cpu_die(cpu);
>> +}
>> +
>> +int __attribute__((weak)) __cpuinit platform_cpu_disable(unsigned int cpu)
>> +{
>> + ? ? ? if (soc_smp_ops && soc_smp_ops->cpu_disable)
>> + ? ? ? ? ? ? ? return soc_smp_ops->cpu_disable(cpu);
>> + ? ? ? return -EPERM;
>> +}
>> +
>> ?/*
>> ?* __cpu_disable runs on the processor to be shutdown.
>> ?*/
>> --
>> 1.7.0.4
>>
>>
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>>
>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH v4 06/10] ARM: SoC: convert Exynos4 to SoC descriptor
  2011-10-03 17:35 ` [PATCH v4 06/10] ARM: SoC: convert Exynos4 " Marc Zyngier
@ 2011-10-04 11:01   ` Kyungmin Park
  2011-10-04 12:33     ` Marc Zyngier
  2011-10-04 13:16   ` Kukjin Kim
  1 sibling, 1 reply; 24+ messages in thread
From: Kyungmin Park @ 2011-10-04 11:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Oct 4, 2011 at 2:35 AM, Marc Zyngier <marc.zyngier@arm.com> wrote:
> Convert Exynos4 to use the SoC descriptor to provide its SMP
> and CPU hotplug operations.
>
> Cc: Kukjin Kim <kgene.kim@samsung.com>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
> ?arch/arm/mach-exynos4/core.h ? ? ? ? ? ? ? ?| ? ?9 +++++++++
> ?arch/arm/mach-exynos4/cpu.c ? ? ? ? ? ? ? ? | ? ?8 ++++++++
> ?arch/arm/mach-exynos4/hotplug.c ? ? ? ? ? ? | ? ?8 +++++---
> ?arch/arm/mach-exynos4/mach-armlex4210.c ? ? | ? ?3 +++
> ?arch/arm/mach-exynos4/mach-nuri.c ? ? ? ? ? | ? ?3 +++
> ?arch/arm/mach-exynos4/mach-origen.c ? ? ? ? | ? ?3 +++
> ?arch/arm/mach-exynos4/mach-smdk4212.c ? ? ? | ? ?3 +++
> ?arch/arm/mach-exynos4/mach-smdkv310.c ? ? ? | ? ?4 ++++
> ?arch/arm/mach-exynos4/mach-universal_c210.c | ? ?3 +++
> ?arch/arm/mach-exynos4/platsmp.c ? ? ? ? ? ? | ? 25 +++++++++++++++++++++----
> ?10 files changed, 62 insertions(+), 7 deletions(-)
> ?create mode 100644 arch/arm/mach-exynos4/core.h
>
> diff --git a/arch/arm/mach-exynos4/core.h b/arch/arm/mach-exynos4/core.h
> new file mode 100644
> index 0000000..ba9fcc8
> --- /dev/null
> +++ b/arch/arm/mach-exynos4/core.h
> @@ -0,0 +1,9 @@

It's helpful to add header guard

#ifndef __EXYNOS4_CORE_H
#define __EXYNOS4_CORE_H
> +#include <asm/soc.h>
> +
> +extern struct arm_soc_smp_init_ops ? ? exynos4_soc_smp_init_ops;
> +extern struct arm_soc_smp_ops ? ? ? ? ?exynos4_soc_smp_ops;
> +extern struct arm_soc_desc ? ? ? ? ? ? exynos4_soc_desc;
> +
> +extern int ?exynos4_cpu_kill(unsigned int cpu);
> +extern void exynos4_cpu_die(unsigned int cpu);
> +extern int ?exynos4_cpu_disable(unsigned int cpu);
#endif

Tested-by: Kyungmin Park <kyungmin.park@samsung.com>

> diff --git a/arch/arm/mach-exynos4/cpu.c b/arch/arm/mach-exynos4/cpu.c
> index 2aa3df0..a15dce8 100644
> --- a/arch/arm/mach-exynos4/cpu.c
> +++ b/arch/arm/mach-exynos4/cpu.c
> @@ -33,6 +33,8 @@
> ?#include <mach/regs-irq.h>
> ?#include <mach/regs-pmu.h>
>
> +#include "core.h"
> +
> ?extern int combiner_init(unsigned int combiner_nr, void __iomem *base,
> ? ? ? ? ? ? ? ? ? ? ? ? unsigned int irq_start);
> ?extern void combiner_cascade_irq(unsigned int combiner_nr, unsigned int irq);
> @@ -282,3 +284,9 @@ int __init exynos4_init(void)
>
> ? ? ? ?return sysdev_register(&exynos4_sysdev);
> ?}
> +
> +struct arm_soc_desc exynos4_soc_desc __initdata = {
> + ? ? ? .name ? ? ? ? ? = "Samsung Exynos4",
> + ? ? ? soc_smp_init_ops(exynos4_soc_smp_init_ops)
> + ? ? ? soc_smp_ops(exynos4_soc_smp_ops)
> +};
> diff --git a/arch/arm/mach-exynos4/hotplug.c b/arch/arm/mach-exynos4/hotplug.c
> index da70e7e..15fe884 100644
> --- a/arch/arm/mach-exynos4/hotplug.c
> +++ b/arch/arm/mach-exynos4/hotplug.c
> @@ -19,6 +19,8 @@
>
> ?#include <mach/regs-pmu.h>
>
> +#include "core.h"
> +
> ?extern volatile int pen_release;
>
> ?static inline void cpu_enter_lowpower(void)
> @@ -93,7 +95,7 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
> ? ? ? ?}
> ?}
>
> -int platform_cpu_kill(unsigned int cpu)
> +int exynos4_cpu_kill(unsigned int cpu)
> ?{
> ? ? ? ?return 1;
> ?}
> @@ -103,7 +105,7 @@ int platform_cpu_kill(unsigned int cpu)
> ?*
> ?* Called with IRQs disabled
> ?*/
> -void platform_cpu_die(unsigned int cpu)
> +void exynos4_cpu_die(unsigned int cpu)
> ?{
> ? ? ? ?int spurious = 0;
>
> @@ -123,7 +125,7 @@ void platform_cpu_die(unsigned int cpu)
> ? ? ? ? ? ? ? ?pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious);
> ?}
>
> -int platform_cpu_disable(unsigned int cpu)
> +int exynos4_cpu_disable(unsigned int cpu)
> ?{
> ? ? ? ?/*
> ? ? ? ? * we don't allow CPU 0 to be shutdown (it is still too special
> diff --git a/arch/arm/mach-exynos4/mach-armlex4210.c b/arch/arm/mach-exynos4/mach-armlex4210.c
> index f0ca6c1..8c82c6b 100644
> --- a/arch/arm/mach-exynos4/mach-armlex4210.c
> +++ b/arch/arm/mach-exynos4/mach-armlex4210.c
> @@ -28,6 +28,8 @@
>
> ?#include <mach/map.h>
>
> +#include "core.h"
> +
> ?/* Following are default values for UCON, ULCON and UFCON UART registers */
> ?#define ARMLEX4210_UCON_DEFAULT ? ? ? ?(S3C2410_UCON_TXILEVEL | ? ? ? ?\
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? S3C2410_UCON_RXILEVEL | ? ? ? ?\
> @@ -208,6 +210,7 @@ static void __init armlex4210_machine_init(void)
> ?MACHINE_START(ARMLEX4210, "ARMLEX4210")
> ? ? ? ?/* Maintainer: Alim Akhtar <alim.akhtar@samsung.com> */
> ? ? ? ?.atag_offset ? ?= 0x100,
> + ? ? ? .soc ? ? ? ? ? ?= &exynos4_soc_desc,
> ? ? ? ?.init_irq ? ? ? = exynos4_init_irq,
> ? ? ? ?.map_io ? ? ? ? = armlex4210_map_io,
> ? ? ? ?.init_machine ? = armlex4210_machine_init,
> diff --git a/arch/arm/mach-exynos4/mach-nuri.c b/arch/arm/mach-exynos4/mach-nuri.c
> index 2204911..5780ee3 100644
> --- a/arch/arm/mach-exynos4/mach-nuri.c
> +++ b/arch/arm/mach-exynos4/mach-nuri.c
> @@ -48,6 +48,8 @@
>
> ?#include <mach/map.h>
>
> +#include <asm/soc.h>
> +
> ?/* Following are default values for UCON, ULCON and UFCON UART registers */
> ?#define NURI_UCON_DEFAULT ? ? ?(S3C2410_UCON_TXILEVEL | ? ? ? ?\
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? S3C2410_UCON_RXILEVEL | ? ? ? ?\
> @@ -1187,6 +1189,7 @@ static void __init nuri_machine_init(void)
> ?MACHINE_START(NURI, "NURI")
> ? ? ? ?/* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */
> ? ? ? ?.atag_offset ? ?= 0x100,
> + ? ? ? .soc ? ? ? ? ? ?= &exynos4_soc_desc,
> ? ? ? ?.init_irq ? ? ? = exynos4_init_irq,
> ? ? ? ?.map_io ? ? ? ? = nuri_map_io,
> ? ? ? ?.init_machine ? = nuri_machine_init,
> diff --git a/arch/arm/mach-exynos4/mach-origen.c b/arch/arm/mach-exynos4/mach-origen.c
> index 421294b..06250fc 100644
> --- a/arch/arm/mach-exynos4/mach-origen.c
> +++ b/arch/arm/mach-exynos4/mach-origen.c
> @@ -33,6 +33,8 @@
>
> ?#include <mach/map.h>
>
> +#include "core.h"
> +
> ?/* Following are default values for UCON, ULCON and UFCON UART registers */
> ?#define ORIGEN_UCON_DEFAULT ? ?(S3C2410_UCON_TXILEVEL | ? ? ? ?\
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? S3C2410_UCON_RXILEVEL | ? ? ? ?\
> @@ -210,6 +212,7 @@ static void __init origen_machine_init(void)
> ?MACHINE_START(ORIGEN, "ORIGEN")
> ? ? ? ?/* Maintainer: JeongHyeon Kim <jhkim@insignal.co.kr> */
> ? ? ? ?.atag_offset ? ?= 0x100,
> + ? ? ? .soc ? ? ? ? ? ?= &exynos4_soc_desc,
> ? ? ? ?.init_irq ? ? ? = exynos4_init_irq,
> ? ? ? ?.map_io ? ? ? ? = origen_map_io,
> ? ? ? ?.init_machine ? = origen_machine_init,
> diff --git a/arch/arm/mach-exynos4/mach-smdk4212.c b/arch/arm/mach-exynos4/mach-smdk4212.c
> index 8c41ae1..cf92514 100644
> --- a/arch/arm/mach-exynos4/mach-smdk4212.c
> +++ b/arch/arm/mach-exynos4/mach-smdk4212.c
> @@ -36,6 +36,8 @@
>
> ?#include <mach/map.h>
>
> +#include "core.h"
> +
> ?/* Following are default values for UCON, ULCON and UFCON UART registers */
> ?#define SMDK4212_UCON_DEFAULT ?(S3C2410_UCON_TXILEVEL | ? ? ? ?\
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? S3C2410_UCON_RXILEVEL | ? ? ? ?\
> @@ -285,6 +287,7 @@ static void __init smdk4212_machine_init(void)
> ?MACHINE_START(SMDK4212, "SMDK4212")
> ? ? ? ?/* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
> ? ? ? ?.atag_offset ? ?= 0x100,
> + ? ? ? .soc ? ? ? ? ? ?= &exynos4_soc_desc,
> ? ? ? ?.init_irq ? ? ? = exynos4_init_irq,
> ? ? ? ?.map_io ? ? ? ? = smdk4212_map_io,
> ? ? ? ?.init_machine ? = smdk4212_machine_init,
> diff --git a/arch/arm/mach-exynos4/mach-smdkv310.c b/arch/arm/mach-exynos4/mach-smdkv310.c
> index cec2afa..525b042 100644
> --- a/arch/arm/mach-exynos4/mach-smdkv310.c
> +++ b/arch/arm/mach-exynos4/mach-smdkv310.c
> @@ -43,6 +43,8 @@
>
> ?#include <mach/map.h>
>
> +#include "core.h"
> +
> ?/* Following are default values for UCON, ULCON and UFCON UART registers */
> ?#define SMDKV310_UCON_DEFAULT ?(S3C2410_UCON_TXILEVEL | ? ? ? ?\
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? S3C2410_UCON_RXILEVEL | ? ? ? ?\
> @@ -373,6 +375,7 @@ MACHINE_START(SMDKV310, "SMDKV310")
> ? ? ? ?/* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
> ? ? ? ?/* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */
> ? ? ? ?.atag_offset ? ?= 0x100,
> + ? ? ? .soc ? ? ? ? ? ?= &exynos4_soc_desc,
> ? ? ? ?.init_irq ? ? ? = exynos4_init_irq,
> ? ? ? ?.map_io ? ? ? ? = smdkv310_map_io,
> ? ? ? ?.init_machine ? = smdkv310_machine_init,
> @@ -383,6 +386,7 @@ MACHINE_END
> ?MACHINE_START(SMDKC210, "SMDKC210")
> ? ? ? ?/* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
> ? ? ? ?.atag_offset ? ?= 0x100,
> + ? ? ? .soc ? ? ? ? ? ?= &exynos4_soc_desc,
> ? ? ? ?.init_irq ? ? ? = exynos4_init_irq,
> ? ? ? ?.map_io ? ? ? ? = smdkv310_map_io,
> ? ? ? ?.init_machine ? = smdkv310_machine_init,
> diff --git a/arch/arm/mach-exynos4/mach-universal_c210.c b/arch/arm/mach-exynos4/mach-universal_c210.c
> index a023faa..0c94673 100644
> --- a/arch/arm/mach-exynos4/mach-universal_c210.c
> +++ b/arch/arm/mach-exynos4/mach-universal_c210.c
> @@ -47,6 +47,8 @@
> ?#include <media/s5p_fimc.h>
> ?#include <media/m5mols.h>
>
> +#include "core.h"
> +
> ?/* Following are default values for UCON, ULCON and UFCON UART registers */
> ?#define UNIVERSAL_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | ? ? ? ?\
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? S3C2410_UCON_RXILEVEL | ? ? ? ?\
> @@ -1061,6 +1063,7 @@ static void __init universal_machine_init(void)
> ?MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
> ? ? ? ?/* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */
> ? ? ? ?.atag_offset ? ?= 0x100,
> + ? ? ? .soc ? ? ? ? ? ?= &exynos4_soc_desc,
> ? ? ? ?.init_irq ? ? ? = exynos4_init_irq,
> ? ? ? ?.map_io ? ? ? ? = universal_map_io,
> ? ? ? ?.init_machine ? = universal_machine_init,
> diff --git a/arch/arm/mach-exynos4/platsmp.c b/arch/arm/mach-exynos4/platsmp.c
> index 500453f..1f419fa 100644
> --- a/arch/arm/mach-exynos4/platsmp.c
> +++ b/arch/arm/mach-exynos4/platsmp.c
> @@ -32,6 +32,8 @@
>
> ?#include <plat/cpu.h>
>
> +#include "core.h"
> +
> ?extern void exynos4_secondary_startup(void);
>
> ?#define CPU1_BOOT_REG ? ? ? ? ?(samsung_rev() == EXYNOS4210_REV_1_1 ? \
> @@ -89,7 +91,7 @@ static void __cpuinit exynos4_gic_secondary_init(void)
> ? ? ? ?__raw_writel(1, cpu_base + GIC_CPU_CTRL);
> ?}
>
> -void __cpuinit platform_secondary_init(unsigned int cpu)
> +static void __cpuinit exynos4_secondary_init(unsigned int cpu)
> ?{
> ? ? ? ?/*
> ? ? ? ? * if any interrupts are already enabled for the primary
> @@ -113,7 +115,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
> ? ? ? ?set_cpu_online(cpu, true);
> ?}
>
> -int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
> +static int __cpuinit exynos4_boot_secondary(unsigned int cpu, struct task_struct *idle)
> ?{
> ? ? ? ?unsigned long timeout;
>
> @@ -188,7 +190,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
> ?* which may be present or become present in the system.
> ?*/
>
> -void __init smp_init_cpus(void)
> +static void __init exynos4_smp_init_cpus(void)
> ?{
> ? ? ? ?void __iomem *scu_base = scu_base_addr();
> ? ? ? ?unsigned int i, ncores;
> @@ -210,7 +212,7 @@ void __init smp_init_cpus(void)
> ? ? ? ?set_smp_cross_call(gic_raise_softirq);
> ?}
>
> -void __init platform_smp_prepare_cpus(unsigned int max_cpus)
> +static void __init exynos4_smp_prepare_cpus(unsigned int max_cpus)
> ?{
>
> ? ? ? ?scu_enable(scu_base_addr());
> @@ -224,3 +226,18 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
> ? ? ? ?__raw_writel(BSYM(virt_to_phys(exynos4_secondary_startup)),
> ? ? ? ? ? ? ? ? ? ? ? ?CPU1_BOOT_REG);
> ?}
> +
> +struct arm_soc_smp_init_ops exynos4_soc_smp_init_ops __initdata = {
> + ? ? ? .smp_init_cpus ? ? ? ? ?= exynos4_smp_init_cpus,
> + ? ? ? .smp_prepare_cpus ? ? ? = exynos4_smp_prepare_cpus,
> +};
> +
> +struct arm_soc_smp_ops exynos4_soc_smp_ops __initdata = {
> + ? ? ? .smp_secondary_init ? ? = exynos4_secondary_init,
> + ? ? ? .smp_boot_secondary ? ? = exynos4_boot_secondary,
> +#ifdef CONFIG_HOTPLUG_CPU
> + ? ? ? .cpu_kill ? ? ? ? ? ? ? = exynos4_cpu_kill,
> + ? ? ? .cpu_die ? ? ? ? ? ? ? ?= exynos4_cpu_die,
> + ? ? ? .cpu_disable ? ? ? ? ? ?= exynos4_cpu_disable,
> +#endif
> +};
> --
> 1.7.0.4
>
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH v4 06/10] ARM: SoC: convert Exynos4 to SoC descriptor
  2011-10-04 11:01   ` Kyungmin Park
@ 2011-10-04 12:33     ` Marc Zyngier
  0 siblings, 0 replies; 24+ messages in thread
From: Marc Zyngier @ 2011-10-04 12:33 UTC (permalink / raw)
  To: linux-arm-kernel

On 04/10/11 12:01, Kyungmin Park wrote:
> On Tue, Oct 4, 2011 at 2:35 AM, Marc Zyngier <marc.zyngier@arm.com> wrote:
>> Convert Exynos4 to use the SoC descriptor to provide its SMP
>> and CPU hotplug operations.
>>
>> Cc: Kukjin Kim <kgene.kim@samsung.com>
>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>> ---
>>  arch/arm/mach-exynos4/core.h                |    9 +++++++++
>>  arch/arm/mach-exynos4/cpu.c                 |    8 ++++++++
>>  arch/arm/mach-exynos4/hotplug.c             |    8 +++++---
>>  arch/arm/mach-exynos4/mach-armlex4210.c     |    3 +++
>>  arch/arm/mach-exynos4/mach-nuri.c           |    3 +++
>>  arch/arm/mach-exynos4/mach-origen.c         |    3 +++
>>  arch/arm/mach-exynos4/mach-smdk4212.c       |    3 +++
>>  arch/arm/mach-exynos4/mach-smdkv310.c       |    4 ++++
>>  arch/arm/mach-exynos4/mach-universal_c210.c |    3 +++
>>  arch/arm/mach-exynos4/platsmp.c             |   25 +++++++++++++++++++++----
>>  10 files changed, 62 insertions(+), 7 deletions(-)
>>  create mode 100644 arch/arm/mach-exynos4/core.h
>>
>> diff --git a/arch/arm/mach-exynos4/core.h b/arch/arm/mach-exynos4/core.h
>> new file mode 100644
>> index 0000000..ba9fcc8
>> --- /dev/null
>> +++ b/arch/arm/mach-exynos4/core.h
>> @@ -0,0 +1,9 @@
> 
> It's helpful to add header guard
> 
> #ifndef __EXYNOS4_CORE_H
> #define __EXYNOS4_CORE_H

Yep, will add.

>> +#include <asm/soc.h>
>> +
>> +extern struct arm_soc_smp_init_ops     exynos4_soc_smp_init_ops;
>> +extern struct arm_soc_smp_ops          exynos4_soc_smp_ops;
>> +extern struct arm_soc_desc             exynos4_soc_desc;
>> +
>> +extern int  exynos4_cpu_kill(unsigned int cpu);
>> +extern void exynos4_cpu_die(unsigned int cpu);
>> +extern int  exynos4_cpu_disable(unsigned int cpu);
> #endif
> 
> Tested-by: Kyungmin Park <kyungmin.park@samsung.com>

Thanks for testing.

	M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH v4 06/10] ARM: SoC: convert Exynos4 to SoC descriptor
  2011-10-03 17:35 ` [PATCH v4 06/10] ARM: SoC: convert Exynos4 " Marc Zyngier
  2011-10-04 11:01   ` Kyungmin Park
@ 2011-10-04 13:16   ` Kukjin Kim
  2011-10-04 13:48     ` Marc Zyngier
  1 sibling, 1 reply; 24+ messages in thread
From: Kukjin Kim @ 2011-10-04 13:16 UTC (permalink / raw)
  To: linux-arm-kernel

Marc Zyngier wrote:
> 
> Convert Exynos4 to use the SoC descriptor to provide its SMP
> and CPU hotplug operations.
> 
> Cc: Kukjin Kim <kgene.kim@samsung.com>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
>  arch/arm/mach-exynos4/core.h                |    9 +++++++++
>  arch/arm/mach-exynos4/cpu.c                 |    8 ++++++++
>  arch/arm/mach-exynos4/hotplug.c             |    8 +++++---
>  arch/arm/mach-exynos4/mach-armlex4210.c     |    3 +++
>  arch/arm/mach-exynos4/mach-nuri.c           |    3 +++
>  arch/arm/mach-exynos4/mach-origen.c         |    3 +++
>  arch/arm/mach-exynos4/mach-smdk4212.c       |    3 +++
>  arch/arm/mach-exynos4/mach-smdkv310.c       |    4 ++++
>  arch/arm/mach-exynos4/mach-universal_c210.c |    3 +++
>  arch/arm/mach-exynos4/platsmp.c             |   25
> +++++++++++++++++++++----
>  10 files changed, 62 insertions(+), 7 deletions(-)
>  create mode 100644 arch/arm/mach-exynos4/core.h
> 
> diff --git a/arch/arm/mach-exynos4/core.h b/arch/arm/mach-exynos4/core.h
> new file mode 100644
> index 0000000..ba9fcc8
> --- /dev/null
> +++ b/arch/arm/mach-exynos4/core.h

Is there any reason to add core.h in mach-exynos4 not
mach-exynos4/include/mach?

> @@ -0,0 +1,9 @@
> +#include <asm/soc.h>
> +
> +extern struct arm_soc_smp_init_ops	exynos4_soc_smp_init_ops;
> +extern struct arm_soc_smp_ops		exynos4_soc_smp_ops;
> +extern struct arm_soc_desc		exynos4_soc_desc;
> +
> +extern int  exynos4_cpu_kill(unsigned int cpu);
> +extern void exynos4_cpu_die(unsigned int cpu);
> +extern int  exynos4_cpu_disable(unsigned int cpu);
> diff --git a/arch/arm/mach-exynos4/cpu.c b/arch/arm/mach-exynos4/cpu.c
> index 2aa3df0..a15dce8 100644
> --- a/arch/arm/mach-exynos4/cpu.c
> +++ b/arch/arm/mach-exynos4/cpu.c
> @@ -33,6 +33,8 @@
>  #include <mach/regs-irq.h>
>  #include <mach/regs-pmu.h>
> 
> +#include "core.h"
> +
>  extern int combiner_init(unsigned int combiner_nr, void __iomem *base,
>  			 unsigned int irq_start);
>  extern void combiner_cascade_irq(unsigned int combiner_nr, unsigned int
irq);
> @@ -282,3 +284,9 @@ int __init exynos4_init(void)
> 
>  	return sysdev_register(&exynos4_sysdev);
>  }
> +
> +struct arm_soc_desc exynos4_soc_desc __initdata = {
> +	.name		= "Samsung Exynos4",

If you're ok, I preferred 'Samsung EXYNOS4'

> +	soc_smp_init_ops(exynos4_soc_smp_init_ops)
> +	soc_smp_ops(exynos4_soc_smp_ops)
> +};
> diff --git a/arch/arm/mach-exynos4/hotplug.c
b/arch/arm/mach-exynos4/hotplug.c
> index da70e7e..15fe884 100644
> --- a/arch/arm/mach-exynos4/hotplug.c
> +++ b/arch/arm/mach-exynos4/hotplug.c
> @@ -19,6 +19,8 @@
> 
>  #include <mach/regs-pmu.h>
> 
> +#include "core.h"
> +
>  extern volatile int pen_release;
> 
>  static inline void cpu_enter_lowpower(void)
> @@ -93,7 +95,7 @@ static inline void platform_do_lowpower(unsigned int
cpu, int
> *spurious)
>  	}
>  }
> 
> -int platform_cpu_kill(unsigned int cpu)
> +int exynos4_cpu_kill(unsigned int cpu)
>  {
>  	return 1;
>  }
> @@ -103,7 +105,7 @@ int platform_cpu_kill(unsigned int cpu)
>   *
>   * Called with IRQs disabled
>   */
> -void platform_cpu_die(unsigned int cpu)
> +void exynos4_cpu_die(unsigned int cpu)
>  {
>  	int spurious = 0;
> 
> @@ -123,7 +125,7 @@ void platform_cpu_die(unsigned int cpu)
>  		pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious);
>  }
> 
> -int platform_cpu_disable(unsigned int cpu)
> +int exynos4_cpu_disable(unsigned int cpu)
>  {
>  	/*
>  	 * we don't allow CPU 0 to be shutdown (it is still too special
> diff --git a/arch/arm/mach-exynos4/mach-armlex4210.c b/arch/arm/mach-
> exynos4/mach-armlex4210.c
> index f0ca6c1..8c82c6b 100644
> --- a/arch/arm/mach-exynos4/mach-armlex4210.c
> +++ b/arch/arm/mach-exynos4/mach-armlex4210.c
> @@ -28,6 +28,8 @@
> 
>  #include <mach/map.h>
> 
> +#include "core.h"
> +
>  /* Following are default values for UCON, ULCON and UFCON UART registers
*/
>  #define ARMLEX4210_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
>  				 S3C2410_UCON_RXILEVEL |	\
> @@ -208,6 +210,7 @@ static void __init armlex4210_machine_init(void)
>  MACHINE_START(ARMLEX4210, "ARMLEX4210")
>  	/* Maintainer: Alim Akhtar <alim.akhtar@samsung.com> */
>  	.atag_offset	= 0x100,
> +	.soc		= &exynos4_soc_desc,
>  	.init_irq	= exynos4_init_irq,
>  	.map_io		= armlex4210_map_io,
>  	.init_machine	= armlex4210_machine_init,
> diff --git a/arch/arm/mach-exynos4/mach-nuri.c
b/arch/arm/mach-exynos4/mach-
> nuri.c
> index 2204911..5780ee3 100644
> --- a/arch/arm/mach-exynos4/mach-nuri.c
> +++ b/arch/arm/mach-exynos4/mach-nuri.c
> @@ -48,6 +48,8 @@
> 
>  #include <mach/map.h>
> 
> +#include <asm/soc.h>
> +
>  /* Following are default values for UCON, ULCON and UFCON UART registers
*/
>  #define NURI_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
>  				 S3C2410_UCON_RXILEVEL |	\
> @@ -1187,6 +1189,7 @@ static void __init nuri_machine_init(void)
>  MACHINE_START(NURI, "NURI")
>  	/* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */
>  	.atag_offset	= 0x100,
> +	.soc		= &exynos4_soc_desc,
>  	.init_irq	= exynos4_init_irq,
>  	.map_io		= nuri_map_io,
>  	.init_machine	= nuri_machine_init,
> diff --git a/arch/arm/mach-exynos4/mach-origen.c
b/arch/arm/mach-exynos4/mach-
> origen.c
> index 421294b..06250fc 100644
> --- a/arch/arm/mach-exynos4/mach-origen.c
> +++ b/arch/arm/mach-exynos4/mach-origen.c
> @@ -33,6 +33,8 @@
> 
>  #include <mach/map.h>
> 
> +#include "core.h"
> +
>  /* Following are default values for UCON, ULCON and UFCON UART registers
*/
>  #define ORIGEN_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
>  				 S3C2410_UCON_RXILEVEL |	\
> @@ -210,6 +212,7 @@ static void __init origen_machine_init(void)
>  MACHINE_START(ORIGEN, "ORIGEN")
>  	/* Maintainer: JeongHyeon Kim <jhkim@insignal.co.kr> */
>  	.atag_offset	= 0x100,
> +	.soc		= &exynos4_soc_desc,
>  	.init_irq	= exynos4_init_irq,
>  	.map_io		= origen_map_io,
>  	.init_machine	= origen_machine_init,
> diff --git a/arch/arm/mach-exynos4/mach-smdk4212.c b/arch/arm/mach-
> exynos4/mach-smdk4212.c
> index 8c41ae1..cf92514 100644
> --- a/arch/arm/mach-exynos4/mach-smdk4212.c
> +++ b/arch/arm/mach-exynos4/mach-smdk4212.c
> @@ -36,6 +36,8 @@
> 
>  #include <mach/map.h>
> 
> +#include "core.h"
> +
>  /* Following are default values for UCON, ULCON and UFCON UART registers
*/
>  #define SMDK4212_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
>  				 S3C2410_UCON_RXILEVEL |	\
> @@ -285,6 +287,7 @@ static void __init smdk4212_machine_init(void)
>  MACHINE_START(SMDK4212, "SMDK4212")
>  	/* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
>  	.atag_offset	= 0x100,
> +	.soc		= &exynos4_soc_desc,
>  	.init_irq	= exynos4_init_irq,
>  	.map_io		= smdk4212_map_io,
>  	.init_machine	= smdk4212_machine_init,
> diff --git a/arch/arm/mach-exynos4/mach-smdkv310.c b/arch/arm/mach-
> exynos4/mach-smdkv310.c
> index cec2afa..525b042 100644
> --- a/arch/arm/mach-exynos4/mach-smdkv310.c
> +++ b/arch/arm/mach-exynos4/mach-smdkv310.c
> @@ -43,6 +43,8 @@
> 
>  #include <mach/map.h>
> 
> +#include "core.h"
> +
>  /* Following are default values for UCON, ULCON and UFCON UART registers
*/
>  #define SMDKV310_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
>  				 S3C2410_UCON_RXILEVEL |	\
> @@ -373,6 +375,7 @@ MACHINE_START(SMDKV310, "SMDKV310")
>  	/* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
>  	/* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */
>  	.atag_offset	= 0x100,
> +	.soc		= &exynos4_soc_desc,
>  	.init_irq	= exynos4_init_irq,
>  	.map_io		= smdkv310_map_io,
>  	.init_machine	= smdkv310_machine_init,
> @@ -383,6 +386,7 @@ MACHINE_END
>  MACHINE_START(SMDKC210, "SMDKC210")
>  	/* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
>  	.atag_offset	= 0x100,
> +	.soc		= &exynos4_soc_desc,
>  	.init_irq	= exynos4_init_irq,
>  	.map_io		= smdkv310_map_io,
>  	.init_machine	= smdkv310_machine_init,
> diff --git a/arch/arm/mach-exynos4/mach-universal_c210.c b/arch/arm/mach-
> exynos4/mach-universal_c210.c
> index a023faa..0c94673 100644
> --- a/arch/arm/mach-exynos4/mach-universal_c210.c
> +++ b/arch/arm/mach-exynos4/mach-universal_c210.c
> @@ -47,6 +47,8 @@
>  #include <media/s5p_fimc.h>
>  #include <media/m5mols.h>
> 
> +#include "core.h"
> +
>  /* Following are default values for UCON, ULCON and UFCON UART registers
*/
>  #define UNIVERSAL_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
>  				 S3C2410_UCON_RXILEVEL |	\
> @@ -1061,6 +1063,7 @@ static void __init universal_machine_init(void)
>  MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
>  	/* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */
>  	.atag_offset	= 0x100,
> +	.soc		= &exynos4_soc_desc,
>  	.init_irq	= exynos4_init_irq,
>  	.map_io		= universal_map_io,
>  	.init_machine	= universal_machine_init,
> diff --git a/arch/arm/mach-exynos4/platsmp.c
b/arch/arm/mach-exynos4/platsmp.c
> index 500453f..1f419fa 100644
> --- a/arch/arm/mach-exynos4/platsmp.c
> +++ b/arch/arm/mach-exynos4/platsmp.c
> @@ -32,6 +32,8 @@
> 
>  #include <plat/cpu.h>
> 
> +#include "core.h"
> +
>  extern void exynos4_secondary_startup(void);
> 
>  #define CPU1_BOOT_REG		(samsung_rev() ==
> EXYNOS4210_REV_1_1 ? \
> @@ -89,7 +91,7 @@ static void __cpuinit exynos4_gic_secondary_init(void)
>  	__raw_writel(1, cpu_base + GIC_CPU_CTRL);
>  }
> 
> -void __cpuinit platform_secondary_init(unsigned int cpu)
> +static void __cpuinit exynos4_secondary_init(unsigned int cpu)
>  {
>  	/*
>  	 * if any interrupts are already enabled for the primary
> @@ -113,7 +115,7 @@ void __cpuinit platform_secondary_init(unsigned int
cpu)
>  	set_cpu_online(cpu, true);
>  }
> 
> -int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
> +static int __cpuinit exynos4_boot_secondary(unsigned int cpu, struct
task_struct
> *idle)
>  {
>  	unsigned long timeout;
> 
> @@ -188,7 +190,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct
> task_struct *idle)
>   * which may be present or become present in the system.
>   */
> 
> -void __init smp_init_cpus(void)
> +static void __init exynos4_smp_init_cpus(void)
>  {
>  	void __iomem *scu_base = scu_base_addr();
>  	unsigned int i, ncores;
> @@ -210,7 +212,7 @@ void __init smp_init_cpus(void)
>  	set_smp_cross_call(gic_raise_softirq);
>  }
> 
> -void __init platform_smp_prepare_cpus(unsigned int max_cpus)
> +static void __init exynos4_smp_prepare_cpus(unsigned int max_cpus)
>  {
> 
>  	scu_enable(scu_base_addr());
> @@ -224,3 +226,18 @@ void __init platform_smp_prepare_cpus(unsigned int
> max_cpus)
>  	__raw_writel(BSYM(virt_to_phys(exynos4_secondary_startup)),
>  			CPU1_BOOT_REG);
>  }
> +
> +struct arm_soc_smp_init_ops exynos4_soc_smp_init_ops __initdata = {
> +	.smp_init_cpus		= exynos4_smp_init_cpus,
> +	.smp_prepare_cpus	= exynos4_smp_prepare_cpus,
> +};
> +
> +struct arm_soc_smp_ops exynos4_soc_smp_ops __initdata = {
> +	.smp_secondary_init	= exynos4_secondary_init,
> +	.smp_boot_secondary	= exynos4_boot_secondary,
> +#ifdef CONFIG_HOTPLUG_CPU
> +	.cpu_kill		= exynos4_cpu_kill,
> +	.cpu_die		= exynos4_cpu_die,
> +	.cpu_disable		= exynos4_cpu_disable,
> +#endif
> +};
> --
> 1.7.0.4

And could you please re-work this based on latest my for-next because there
are updated board file.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH v4 06/10] ARM: SoC: convert Exynos4 to SoC descriptor
  2011-10-04 13:16   ` Kukjin Kim
@ 2011-10-04 13:48     ` Marc Zyngier
  2011-10-05  1:22       ` Kukjin Kim
  0 siblings, 1 reply; 24+ messages in thread
From: Marc Zyngier @ 2011-10-04 13:48 UTC (permalink / raw)
  To: linux-arm-kernel

On 04/10/11 14:16, Kukjin Kim wrote:
> Marc Zyngier wrote:
>>
>> Convert Exynos4 to use the SoC descriptor to provide its SMP
>> and CPU hotplug operations.
>>
>> Cc: Kukjin Kim <kgene.kim@samsung.com>
>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>> ---
>>  arch/arm/mach-exynos4/core.h                |    9 +++++++++
>>  arch/arm/mach-exynos4/cpu.c                 |    8 ++++++++
>>  arch/arm/mach-exynos4/hotplug.c             |    8 +++++---
>>  arch/arm/mach-exynos4/mach-armlex4210.c     |    3 +++
>>  arch/arm/mach-exynos4/mach-nuri.c           |    3 +++
>>  arch/arm/mach-exynos4/mach-origen.c         |    3 +++
>>  arch/arm/mach-exynos4/mach-smdk4212.c       |    3 +++
>>  arch/arm/mach-exynos4/mach-smdkv310.c       |    4 ++++
>>  arch/arm/mach-exynos4/mach-universal_c210.c |    3 +++
>>  arch/arm/mach-exynos4/platsmp.c             |   25
>> +++++++++++++++++++++----
>>  10 files changed, 62 insertions(+), 7 deletions(-)
>>  create mode 100644 arch/arm/mach-exynos4/core.h
>>
>> diff --git a/arch/arm/mach-exynos4/core.h b/arch/arm/mach-exynos4/core.h
>> new file mode 100644
>> index 0000000..ba9fcc8
>> --- /dev/null
>> +++ b/arch/arm/mach-exynos4/core.h
> 
> Is there any reason to add core.h in mach-exynos4 not
> mach-exynos4/include/mach?

No particular reason. If you prefer having that file in include/mach,
I'll move it, though I don't think it makes much more sense.

>> +
>> +struct arm_soc_desc exynos4_soc_desc __initdata = {
>> +	.name		= "Samsung Exynos4",
> 
> If you're ok, I preferred 'Samsung EXYNOS4'

No problem.

> And could you please re-work this based on latest my for-next because there
> are updated board file.

Where is your for-next branch located these days? When it gets picked up
by linux-next, I'll update the board files. As of next-20111004, I seem
to cover them all.

Cheers,

	M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH v4 06/10] ARM: SoC: convert Exynos4 to SoC descriptor
  2011-10-04 13:48     ` Marc Zyngier
@ 2011-10-05  1:22       ` Kukjin Kim
  0 siblings, 0 replies; 24+ messages in thread
From: Kukjin Kim @ 2011-10-05  1:22 UTC (permalink / raw)
  To: linux-arm-kernel

Marc Zyngier wrote:
> 
> On 04/10/11 14:16, Kukjin Kim wrote:
> > Marc Zyngier wrote:
> >>
> >> Convert Exynos4 to use the SoC descriptor to provide its SMP
> >> and CPU hotplug operations.
> >>
> >> Cc: Kukjin Kim <kgene.kim@samsung.com>
> >> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> >> ---
> >>  arch/arm/mach-exynos4/core.h                |    9 +++++++++
> >>  arch/arm/mach-exynos4/cpu.c                 |    8 ++++++++
> >>  arch/arm/mach-exynos4/hotplug.c             |    8 +++++---
> >>  arch/arm/mach-exynos4/mach-armlex4210.c     |    3 +++
> >>  arch/arm/mach-exynos4/mach-nuri.c           |    3 +++
> >>  arch/arm/mach-exynos4/mach-origen.c         |    3 +++
> >>  arch/arm/mach-exynos4/mach-smdk4212.c       |    3 +++
> >>  arch/arm/mach-exynos4/mach-smdkv310.c       |    4 ++++
> >>  arch/arm/mach-exynos4/mach-universal_c210.c |    3 +++
> >>  arch/arm/mach-exynos4/platsmp.c             |   25
> >> +++++++++++++++++++++----
> >>  10 files changed, 62 insertions(+), 7 deletions(-)
> >>  create mode 100644 arch/arm/mach-exynos4/core.h
> >>
> >> diff --git a/arch/arm/mach-exynos4/core.h
b/arch/arm/mach-exynos4/core.h
> >> new file mode 100644
> >> index 0000000..ba9fcc8
> >> --- /dev/null
> >> +++ b/arch/arm/mach-exynos4/core.h
> >
> > Is there any reason to add core.h in mach-exynos4 not
> > mach-exynos4/include/mach?
> 
> No particular reason. If you prefer having that file in include/mach,
> I'll move it, though I don't think it makes much more sense.
> 
I was just wondering, and I'd like to keep same format with other platforms.

> >> +
> >> +struct arm_soc_desc exynos4_soc_desc __initdata = {
> >> +	.name		= "Samsung Exynos4",
> >
> > If you're ok, I preferred 'Samsung EXYNOS4'
> 
> No problem.
> 
Thanks.

> > And could you please re-work this based on latest my for-next because
there
> > are updated board file.
> 
> Where is your for-next branch located these days? When it gets picked up
> by linux-next, I'll update the board files. As of next-20111004, I seem
> to cover them all.
> 
Now it is 'git://github.com/kgene/linux-samsung.git' and it will be moved
'git.kernel.org' soon. And as you said since linux-next is maybe having all
-next trees, if you pick it up it is ok to me too :)

If this series get the acks from regarding maintainers, is it possible to
send this EXYNOS stuff via Samsung tree to avoid conflicts? And you know it
can be tested with others by linux-next even though separate merging.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2011-10-05  1:22 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-03 17:35 [PATCH v4 00/10] Per SoC descriptor Marc Zyngier
2011-10-03 17:35 ` [PATCH v4 01/10] ARM: SoC: Introduce per " Marc Zyngier
2011-10-03 17:35 ` [PATCH v4 02/10] ARM: SoC: Add per SoC SMP and CPU hotplug operations Marc Zyngier
2011-10-03 19:12   ` Nicolas Pitre
2011-10-04  9:44     ` Marc Zyngier
2011-10-04 10:30   ` Kyungmin Park
2011-10-04 10:35     ` Kyungmin Park
2011-10-03 17:35 ` [PATCH v4 03/10] ARM: SoC: convert VExpress/RealView to SoC descriptor Marc Zyngier
2011-10-03 17:35 ` [PATCH v4 04/10] ARM: SoC: convert OMAP4 " Marc Zyngier
2011-10-04  6:32   ` Shilimkar, Santosh
2011-10-04  9:44     ` Marc Zyngier
2011-10-03 17:35 ` [PATCH v4 05/10] ARM: SoC: convert Tegra " Marc Zyngier
2011-10-03 20:52   ` Stephen Warren
2011-10-04  9:47     ` Marc Zyngier
2011-10-03 17:35 ` [PATCH v4 06/10] ARM: SoC: convert Exynos4 " Marc Zyngier
2011-10-04 11:01   ` Kyungmin Park
2011-10-04 12:33     ` Marc Zyngier
2011-10-04 13:16   ` Kukjin Kim
2011-10-04 13:48     ` Marc Zyngier
2011-10-05  1:22       ` Kukjin Kim
2011-10-03 17:35 ` [PATCH v4 07/10] ARM: SoC: convert MSM SMP " Marc Zyngier
2011-10-03 17:35 ` [PATCH v4 08/10] ARM: SoC: convert ux500 " Marc Zyngier
2011-10-03 17:35 ` [PATCH v4 09/10] ARM: SoC: convert shmobile sh73a0 " Marc Zyngier
2011-10-03 17:35 ` [PATCH v4 10/10] ARM: smp: Make SoC descriptor mandatory for SMP platforms Marc Zyngier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.