]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-realview/platsmp.c
[ARM] 4818/1: RealView: Add core-tile detection
[linux-2.6-omap-h63xx.git] / arch / arm / mach-realview / platsmp.c
index a8fbd76d8be5855e97eea74502f949cde0abf828..de2b7159557dd56c56eb5f673124cc263f0bfa6d 100644 (file)
@@ -18,6 +18,7 @@
 #include <asm/hardware/arm_scu.h>
 #include <asm/hardware.h>
 #include <asm/io.h>
+#include <asm/mach-types.h>
 
 extern void realview_secondary_startup(void);
 
@@ -31,9 +32,13 @@ static unsigned int __init get_core_count(void)
 {
        unsigned int ncores;
 
-       ncores = __raw_readl(__io_address(REALVIEW_MPCORE_SCU_BASE) + SCU_CONFIG);
+       if (machine_is_realview_eb() && core_tile_eb11mp()) {
+               ncores = __raw_readl(__io_address(REALVIEW_EB11MP_SCU_BASE) + SCU_CONFIG);
+               ncores = (ncores & 0x03) + 1;
+       } else
+               ncores = 1;
 
-       return (ncores & 0x03) + 1;
+       return ncores;
 }
 
 static DEFINE_SPINLOCK(boot_lock);
@@ -52,13 +57,14 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
         * core (e.g. timer irq), then they will not have been enabled
         * for us: do so
         */
-       gic_cpu_init(__io_address(REALVIEW_GIC_CPU_BASE));
+       gic_cpu_init(0, __io_address(REALVIEW_EB11MP_GIC_CPU_BASE));
 
        /*
         * let the primary processor know we're out of the
         * pen, then head off into the C entry point
         */
        pen_release = -1;
+       smp_wmb();
 
        /*
         * Synchronise with the boot thread.
@@ -102,6 +108,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
 
        timeout = jiffies + (1 * HZ);
        while (time_before(jiffies, timeout)) {
+               smp_rmb();
                if (pen_release == -1)
                        break;
 
@@ -143,6 +150,18 @@ static void __init poke_milo(void)
        mb();
 }
 
+/*
+ * 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)
+{
+       unsigned int i, ncores = get_core_count();
+
+       for (i = 0; i < ncores; i++)
+               cpu_set(i, cpu_possible_map);
+}
+
 void __init smp_prepare_cpus(unsigned int max_cpus)
 {
        unsigned int ncores = get_core_count();
@@ -173,20 +192,22 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
        if (max_cpus > ncores)
                max_cpus = ncores;
 
+#ifdef CONFIG_LOCAL_TIMERS
        /*
-        * Enable the local timer for primary CPU
+        * Enable the local timer for primary CPU. If the device is
+        * dummy (!CONFIG_LOCAL_TIMERS), it was already registers in
+        * realview_timer_init
         */
-       local_timer_setup(cpu);
+       if (machine_is_realview_eb() && core_tile_eb11mp())
+               local_timer_setup(cpu);
+#endif
 
        /*
-        * Initialise the possible/present maps.
-        * cpu_possible_map describes the set of CPUs which may be present
-        * cpu_present_map describes the set of CPUs populated
+        * Initialise the present map, which describes the set of CPUs
+        * actually populated at the present time.
         */
-       for (i = 0; i < max_cpus; i++) {
-               cpu_set(i, cpu_possible_map);
+       for (i = 0; i < max_cpus; i++)
                cpu_set(i, cpu_present_map);
-       }
 
        /*
         * Do we need any more CPUs? If so, then let them know where