]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/platforms/powermac/smp.c
Merge branch 'linus' into core/urgent
[linux-2.6-omap-h63xx.git] / arch / powerpc / platforms / powermac / smp.c
index 6f32c4eca6e5f48c78eda6f00fd3c98087290537..40f72c2a4699f101dbe90f17abbb2e0d31ab54fd 100644 (file)
@@ -24,7 +24,6 @@
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/smp.h>
-#include <linux/smp_lock.h>
 #include <linux/interrupt.h>
 #include <linux/kernel_stat.h>
 #include <linux/delay.h>
@@ -37,6 +36,7 @@
 
 #include <asm/ptrace.h>
 #include <asm/atomic.h>
+#include <asm/code-patching.h>
 #include <asm/irq.h>
 #include <asm/page.h>
 #include <asm/pgtable.h>
@@ -318,7 +318,6 @@ static int __init smp_psurge_probe(void)
                ncpus = NR_CPUS;
        for (i = 1; i < ncpus ; ++i) {
                cpu_set(i, cpu_present_map);
-               cpu_set(i, cpu_possible_map);
                set_hard_smp_processor_id(i, i);
        }
 
@@ -562,7 +561,7 @@ static void __init smp_core99_setup_i2c_hwsync(int ncpus)
        /* Look for the clock chip */
        while ((cc = of_find_node_by_name(cc, "i2c-hwclock")) != NULL) {
                p = of_get_parent(cc);
-               ok = p && device_is_compatible(p, "uni-n-i2c");
+               ok = p && of_device_is_compatible(p, "uni-n-i2c");
                of_node_put(p);
                if (!ok)
                        continue;
@@ -575,11 +574,11 @@ static void __init smp_core99_setup_i2c_hwsync(int ncpus)
                        continue;
                switch (*reg) {
                case 0xd2:
-                       if (device_is_compatible(cc,"pulsar-legacy-slewing")) {
+                       if (of_device_is_compatible(cc,"pulsar-legacy-slewing")) {
                                pmac_tb_freeze = smp_core99_pulsar_tb_freeze;
                                pmac_tb_pulsar_addr = 0xd2;
                                name = "Pulsar";
-                       } else if (device_is_compatible(cc, "cy28508")) {
+                       } else if (of_device_is_compatible(cc, "cy28508")) {
                                pmac_tb_freeze = smp_core99_cypress_tb_freeze;
                                name = "Cypress";
                        }
@@ -788,8 +787,7 @@ static void __devinit smp_core99_kick_cpu(int nr)
 {
        unsigned int save_vector;
        unsigned long target, flags;
-       volatile unsigned int *vector
-                = ((volatile unsigned int *)(KERNELBASE+0x100));
+       unsigned int *vector = (unsigned int *)(PAGE_OFFSET+0x100);
 
        if (nr < 0 || nr > 3)
                return;
@@ -803,10 +801,10 @@ static void __devinit smp_core99_kick_cpu(int nr)
        save_vector = *vector;
 
        /* Setup fake reset vector that does
-        *   b __secondary_start_pmac_0 + nr*8 - KERNELBASE
+        *   b __secondary_start_pmac_0 + nr*8
         */
        target = (unsigned long) __secondary_start_pmac_0 + nr * 8;
-       create_branch((unsigned long)vector, target, BRANCH_SET_LINK);
+       patch_branch(vector, target, BRANCH_SET_LINK);
 
        /* Put some life in our friend */
        pmac_call_feature(PMAC_FTR_RESET_CPU, NULL, nr, 0);
@@ -900,7 +898,7 @@ void smp_core99_cpu_die(unsigned int cpu)
        cpu_dead[cpu] = 0;
 }
 
-#endif
+#endif /* CONFIG_HOTPLUG_CPU && CONFIG_PP32 */
 
 /* Core99 Macs (dual G4s and G5s) */
 struct smp_ops_t core99_smp_ops = {
@@ -910,8 +908,16 @@ struct smp_ops_t core99_smp_ops = {
        .setup_cpu      = smp_core99_setup_cpu,
        .give_timebase  = smp_core99_give_timebase,
        .take_timebase  = smp_core99_take_timebase,
-#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC32)
+#if defined(CONFIG_HOTPLUG_CPU)
+# if defined(CONFIG_PPC32)
        .cpu_disable    = smp_core99_cpu_disable,
        .cpu_die        = smp_core99_cpu_die,
+# endif
+# if defined(CONFIG_PPC64)
+       .cpu_disable    = generic_cpu_disable,
+       .cpu_die        = generic_cpu_die,
+       /* intentionally do *NOT* assign cpu_enable,
+        * the generic code will use kick_cpu then! */
+# endif
 #endif
 };