Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git] / arch / parisc / kernel / processor.c
index 5b05759..99d7fca 100644 (file)
  *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
  */
-#include <linux/config.h>
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/seq_file.h>
 #include <linux/slab.h>
+#include <linux/cpu.h>
 
 #include <asm/cache.h>
 #include <asm/hardware.h>      /* for register_parisc_driver() stuff */
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/pdc.h>
+#include <asm/pdcpat.h>
 #include <asm/irq.h>           /* for struct irq_region */
 #include <asm/parisc-device.h>
 
-struct system_cpuinfo_parisc boot_cpu_data;
+struct system_cpuinfo_parisc boot_cpu_data __read_mostly;
 EXPORT_SYMBOL(boot_cpu_data);
 
-struct cpuinfo_parisc cpu_data[NR_CPUS];
+struct cpuinfo_parisc cpu_data[NR_CPUS] __read_mostly;
 
 /*
 **     PARISC CPU driver - claim "device" and initialize CPU data structures.
@@ -90,7 +91,7 @@ static int __init processor_probe(struct parisc_device *dev)
         * May get overwritten by PAT code.
         */
        cpuid = boot_cpu_data.cpu_count;
-       txn_addr = dev->hpa;    /* for legacy PDC */
+       txn_addr = dev->hpa.start;      /* for legacy PDC */
 
 #ifdef __LP64__
        if (is_pdc_pat()) {
@@ -120,7 +121,7 @@ static int __init processor_probe(struct parisc_device *dev)
  * boot time (ie shutdown a CPU from an OS perspective).
  */
                /* get the cpu number */
-               status = pdc_pat_cpu_get_number(&cpu_info, dev->hpa);
+               status = pdc_pat_cpu_get_number(&cpu_info, dev->hpa.start);
 
                BUG_ON(PDC_OK != status);
 
@@ -128,7 +129,7 @@ static int __init processor_probe(struct parisc_device *dev)
                        printk(KERN_WARNING "IGNORING CPU at 0x%x,"
                                " cpu_slot_id > NR_CPUS"
                                " (%ld > %d)\n",
-                               dev->hpa, cpu_info.cpu_num, NR_CPUS);
+                               dev->hpa.start, cpu_info.cpu_num, NR_CPUS);
                        /* Ignore CPU since it will only crash */
                        boot_cpu_data.cpu_count--;
                        return 1;
@@ -147,11 +148,11 @@ static int __init processor_probe(struct parisc_device *dev)
 
        p->loops_per_jiffy = loops_per_jiffy;
        p->dev = dev;           /* Save IODC data in case we need it */
-       p->hpa = dev->hpa;      /* save CPU hpa */
+       p->hpa = dev->hpa.start;        /* save CPU hpa */
        p->cpuid = cpuid;       /* save CPU id */
        p->txn_addr = txn_addr; /* save CPU IRQ address */
 #ifdef CONFIG_SMP
-       p->lock = SPIN_LOCK_UNLOCKED;
+       spin_lock_init(&p->lock);
 
        /*
        ** FIXME: review if any other initialization is clobbered
@@ -187,6 +188,17 @@ static int __init processor_probe(struct parisc_device *dev)
                cpu_irq_actions[cpuid] = actions;
        }
 #endif
+
+       /* 
+        * Bring this CPU up now! (ignore bootstrap cpuid == 0)
+        */
+#ifdef CONFIG_SMP
+       if (cpuid) {
+               cpu_set(cpuid, cpu_present_map);
+               cpu_up(cpuid);
+       }
+#endif
+
        return 0;
 }
 
@@ -231,9 +243,7 @@ void __init collect_boot_cpu_data(void)
        boot_cpu_data.hversion =  boot_cpu_data.pdc.model.hversion;
        boot_cpu_data.sversion =  boot_cpu_data.pdc.model.sversion;
 
-       boot_cpu_data.cpu_type =
-                       parisc_get_cpu_type(boot_cpu_data.hversion);
-
+       boot_cpu_data.cpu_type = parisc_get_cpu_type(boot_cpu_data.hversion);
        boot_cpu_data.cpu_name = cpu_name_version[boot_cpu_data.cpu_type][0];
        boot_cpu_data.family_name = cpu_name_version[boot_cpu_data.cpu_type][1];
 }
@@ -276,6 +286,7 @@ int __init init_per_cpu(int cpunum)
        int ret;
        struct pdc_coproc_cfg coproc_cfg;
 
+       set_firmware_width();
        ret = pdc_coproc_cfg(&coproc_cfg);
 
        if(ret >= 0 && coproc_cfg.ccr_functional) {
@@ -366,12 +377,12 @@ show_cpuinfo (struct seq_file *m, void *v)
        return 0;
 }
 
-static struct parisc_device_id processor_tbl[] = {
+static struct parisc_device_id processor_tbl[] __read_mostly = {
        { HPHW_NPROC, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, SVERSION_ANY_ID },
        { 0, }
 };
 
-static struct parisc_driver cpu_driver = {
+static struct parisc_driver cpu_driver __read_mostly = {
        .name           = "CPU",
        .id_table       = processor_tbl,
        .probe          = processor_probe