aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-vexpress/ct-ca9x4.c
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2011-02-28 11:01:04 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-03-20 05:32:21 -0400
commit80b5efbd43f0a21e9fc6db87823be32fcfe3e7ce (patch)
tree12a213968fa7c0bac41ff539f82ba64f0e979c4c /arch/arm/mach-vexpress/ct-ca9x4.c
parent196f020fbbb83d246960548e73a40fd08f3e7866 (diff)
ARM: 6771/1: vexpress: add support for multiple core tiles
The current Versatile Express BSP defines the MACHINE_START macro in the core tile code. This patch moves this into the generic board code and introduces a method for determining the current tile at runtime, allowing the Kernel to have support for multiple tiles compiled in. Tile-specific functions are executed via a descriptor struct containing the correct implementations for the current tile. Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-vexpress/ct-ca9x4.c')
-rw-r--r--arch/arm/mach-vexpress/ct-ca9x4.c45
1 files changed, 30 insertions, 15 deletions
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c
index 30d5a5b0ac21..ebc22e759325 100644
--- a/arch/arm/mach-vexpress/ct-ca9x4.c
+++ b/arch/arm/mach-vexpress/ct-ca9x4.c
@@ -10,19 +10,17 @@
10#include <linux/amba/clcd.h> 10#include <linux/amba/clcd.h>
11#include <linux/clkdev.h> 11#include <linux/clkdev.h>
12 12
13#include <asm/pgtable.h>
14#include <asm/hardware/arm_timer.h> 13#include <asm/hardware/arm_timer.h>
15#include <asm/hardware/cache-l2x0.h> 14#include <asm/hardware/cache-l2x0.h>
16#include <asm/hardware/gic.h> 15#include <asm/hardware/gic.h>
17#include <asm/mach-types.h>
18#include <asm/pmu.h> 16#include <asm/pmu.h>
17#include <asm/smp_scu.h>
19#include <asm/smp_twd.h> 18#include <asm/smp_twd.h>
20 19
21#include <mach/ct-ca9x4.h> 20#include <mach/ct-ca9x4.h>
22 21
23#include <asm/hardware/timer-sp.h> 22#include <asm/hardware/timer-sp.h>
24 23
25#include <asm/mach/arch.h>
26#include <asm/mach/map.h> 24#include <asm/mach/map.h>
27#include <asm/mach/time.h> 25#include <asm/mach/time.h>
28 26
@@ -58,7 +56,7 @@ static void __init ct_ca9x4_map_io(void)
58#ifdef CONFIG_LOCAL_TIMERS 56#ifdef CONFIG_LOCAL_TIMERS
59 twd_base = MMIO_P2V(A9_MPCORE_TWD); 57 twd_base = MMIO_P2V(A9_MPCORE_TWD);
60#endif 58#endif
61 v2m_map_io(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc)); 59 iotable_init(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc));
62} 60}
63 61
64static void __init ct_ca9x4_init_irq(void) 62static void __init ct_ca9x4_init_irq(void)
@@ -183,8 +181,6 @@ static struct platform_device pmu_device = {
183static void __init ct_ca9x4_init_early(void) 181static void __init ct_ca9x4_init_early(void)
184{ 182{
185 clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 183 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
186
187 v2m_init_early();
188} 184}
189 185
190static void __init ct_ca9x4_init(void) 186static void __init ct_ca9x4_init(void)
@@ -207,15 +203,34 @@ static void __init ct_ca9x4_init(void)
207 platform_device_register(&pmu_device); 203 platform_device_register(&pmu_device);
208} 204}
209 205
210MACHINE_START(VEXPRESS, "ARM-Versatile Express CA9x4") 206#ifdef CONFIG_SMP
211 .boot_params = PLAT_PHYS_OFFSET + 0x00000100, 207static void ct_ca9x4_init_cpu_map(void)
208{
209 int i, ncores = scu_get_core_count(MMIO_P2V(A9_MPCORE_SCU));
210
211 for (i = 0; i < ncores; ++i)
212 set_cpu_possible(i, true);
213}
214
215static void ct_ca9x4_smp_enable(unsigned int max_cpus)
216{
217 int i;
218 for (i = 0; i < max_cpus; i++)
219 set_cpu_present(i, true);
220
221 scu_enable(MMIO_P2V(A9_MPCORE_SCU));
222}
223#endif
224
225struct ct_desc ct_ca9x4_desc __initdata = {
226 .id = V2M_CT_ID_CA9,
227 .name = "CA9x4",
212 .map_io = ct_ca9x4_map_io, 228 .map_io = ct_ca9x4_map_io,
213 .init_irq = ct_ca9x4_init_irq,
214 .init_early = ct_ca9x4_init_early, 229 .init_early = ct_ca9x4_init_early,
215#if 0 230 .init_irq = ct_ca9x4_init_irq,
216 .timer = &ct_ca9x4_timer, 231 .init_tile = ct_ca9x4_init,
217#else 232#ifdef CONFIG_SMP
218 .timer = &v2m_timer, 233 .init_cpu_map = ct_ca9x4_init_cpu_map,
234 .smp_enable = ct_ca9x4_smp_enable,
219#endif 235#endif
220 .init_machine = ct_ca9x4_init, 236};
221MACHINE_END