diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2011-09-08 08:15:22 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-09-13 09:35:49 -0400 |
commit | a17257322f5e6ca376c15908b55423369274fcad (patch) | |
tree | eda0026c1ba985db6e9029d0d79d5f4ea5d86a9e /arch/arm/mach-tegra/platsmp.c | |
parent | 06915321e7935d2eb778f0a7f333b2603c1404df (diff) |
ARM: SoC: convert Tegra to SMP operations
Convert Tegra to use struct smp_operations to provide its SMP
and CPU hotplug operations.
Tested on Harmony.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Olof Johansson <olof@lixom.net>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-tegra/platsmp.c')
-rw-r--r-- | arch/arm/mach-tegra/platsmp.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/arch/arm/mach-tegra/platsmp.c b/arch/arm/mach-tegra/platsmp.c index 1a208dbf682f..24bfb6534c21 100644 --- a/arch/arm/mach-tegra/platsmp.c +++ b/arch/arm/mach-tegra/platsmp.c | |||
@@ -32,6 +32,8 @@ | |||
32 | #include "flowctrl.h" | 32 | #include "flowctrl.h" |
33 | #include "reset.h" | 33 | #include "reset.h" |
34 | 34 | ||
35 | #include "common.h" | ||
36 | |||
35 | extern void tegra_secondary_startup(void); | 37 | extern void tegra_secondary_startup(void); |
36 | 38 | ||
37 | static void __iomem *scu_base = IO_ADDRESS(TEGRA_ARM_PERIF_BASE); | 39 | static void __iomem *scu_base = IO_ADDRESS(TEGRA_ARM_PERIF_BASE); |
@@ -50,7 +52,7 @@ static void __iomem *scu_base = IO_ADDRESS(TEGRA_ARM_PERIF_BASE); | |||
50 | #define CPU_CLOCK(cpu) (0x1<<(8+cpu)) | 52 | #define CPU_CLOCK(cpu) (0x1<<(8+cpu)) |
51 | #define CPU_RESET(cpu) (0x1111ul<<(cpu)) | 53 | #define CPU_RESET(cpu) (0x1111ul<<(cpu)) |
52 | 54 | ||
53 | void __cpuinit platform_secondary_init(unsigned int cpu) | 55 | static void __cpuinit tegra_secondary_init(unsigned int cpu) |
54 | { | 56 | { |
55 | /* | 57 | /* |
56 | * if any interrupts are already enabled for the primary | 58 | * if any interrupts are already enabled for the primary |
@@ -117,7 +119,7 @@ static int tegra30_power_up_cpu(unsigned int cpu) | |||
117 | return 0; | 119 | return 0; |
118 | } | 120 | } |
119 | 121 | ||
120 | int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | 122 | static int __cpuinit tegra_boot_secondary(unsigned int cpu, struct task_struct *idle) |
121 | { | 123 | { |
122 | int status; | 124 | int status; |
123 | 125 | ||
@@ -165,7 +167,7 @@ done: | |||
165 | * Initialise the CPU possible map early - this describes the CPUs | 167 | * Initialise the CPU possible map early - this describes the CPUs |
166 | * which may be present or become present in the system. | 168 | * which may be present or become present in the system. |
167 | */ | 169 | */ |
168 | void __init smp_init_cpus(void) | 170 | static void __init tegra_smp_init_cpus(void) |
169 | { | 171 | { |
170 | unsigned int i, ncores = scu_get_core_count(scu_base); | 172 | unsigned int i, ncores = scu_get_core_count(scu_base); |
171 | 173 | ||
@@ -181,8 +183,18 @@ void __init smp_init_cpus(void) | |||
181 | set_smp_cross_call(gic_raise_softirq); | 183 | set_smp_cross_call(gic_raise_softirq); |
182 | } | 184 | } |
183 | 185 | ||
184 | void __init platform_smp_prepare_cpus(unsigned int max_cpus) | 186 | static void __init tegra_smp_prepare_cpus(unsigned int max_cpus) |
185 | { | 187 | { |
186 | tegra_cpu_reset_handler_init(); | 188 | tegra_cpu_reset_handler_init(); |
187 | scu_enable(scu_base); | 189 | scu_enable(scu_base); |
188 | } | 190 | } |
191 | |||
192 | struct smp_operations tegra_smp_ops __initdata = { | ||
193 | .smp_init_cpus = tegra_smp_init_cpus, | ||
194 | .smp_prepare_cpus = tegra_smp_prepare_cpus, | ||
195 | .smp_secondary_init = tegra_secondary_init, | ||
196 | .smp_boot_secondary = tegra_boot_secondary, | ||
197 | #ifdef CONFIG_HOTPLUG_CPU | ||
198 | .cpu_die = tegra_cpu_die, | ||
199 | #endif | ||
200 | }; | ||