Merge branch 'exec_rm_compat' of git://git.kernel.org/pub/scm/linux/kernel/git/oleg...
[pandora-kernel.git] / arch / powerpc / kernel / setup-common.c
index b7e6c7e..79fca26 100644 (file)
@@ -94,6 +94,12 @@ struct screen_info screen_info = {
        .orig_video_points = 16
 };
 
+/* Variables required to store legacy IO irq routing */
+int of_i8042_kbd_irq;
+EXPORT_SYMBOL_GPL(of_i8042_kbd_irq);
+int of_i8042_aux_irq;
+EXPORT_SYMBOL_GPL(of_i8042_aux_irq);
+
 #ifdef __DO_IRQ_CANON
 /* XXX should go elsewhere eventually */
 int ppc_do_canonicalize_irqs;
@@ -375,7 +381,7 @@ static void __init cpu_init_thread_core_maps(int tpc)
        int i;
 
        threads_per_core = tpc;
-       threads_core_mask = CPU_MASK_NONE;
+       cpumask_clear(&threads_core_mask);
 
        /* This implementation only supports power of 2 number of threads
         * for simplicity and performance
@@ -384,7 +390,7 @@ static void __init cpu_init_thread_core_maps(int tpc)
        BUG_ON(tpc != (1 << threads_shift));
 
        for (i = 0; i < tpc; i++)
-               cpu_set(i, threads_core_mask);
+               cpumask_set_cpu(i, &threads_core_mask);
 
        printk(KERN_INFO "CPU maps initialized for %d thread%s per core\n",
               tpc, tpc > 1 ? "s" : "");
@@ -398,7 +404,7 @@ static void __init cpu_init_thread_core_maps(int tpc)
  *                  cpu_present_mask
  *
  * Having the possible map set up early allows us to restrict allocations
- * of things like irqstacks to num_possible_cpus() rather than NR_CPUS.
+ * of things like irqstacks to nr_cpu_ids rather than NR_CPUS.
  *
  * We do not initialize the online map here; cpus set their own bits in
  * cpu_online_mask as they come up.
@@ -418,7 +424,7 @@ void __init smp_setup_cpu_maps(void)
 
        DBG("smp_setup_cpu_maps()\n");
 
-       while ((dn = of_find_node_by_type(dn, "cpu")) && cpu < NR_CPUS) {
+       while ((dn = of_find_node_by_type(dn, "cpu")) && cpu < nr_cpu_ids) {
                const int *intserv;
                int j, len;
 
@@ -437,7 +443,7 @@ void __init smp_setup_cpu_maps(void)
                                intserv = &cpu; /* assume logical == phys */
                }
 
-               for (j = 0; j < nthreads && cpu < NR_CPUS; j++) {
+               for (j = 0; j < nthreads && cpu < nr_cpu_ids; j++) {
                        DBG("    thread %d -> cpu %d (hard id %d)\n",
                            j, cpu, intserv[j]);
                        set_cpu_present(cpu, true);
@@ -477,12 +483,12 @@ void __init smp_setup_cpu_maps(void)
                if (cpu_has_feature(CPU_FTR_SMT))
                        maxcpus *= nthreads;
 
-               if (maxcpus > NR_CPUS) {
+               if (maxcpus > nr_cpu_ids) {
                        printk(KERN_WARNING
                               "Partition configured for %d cpus, "
                               "operating system maximum is %d.\n",
-                              maxcpus, NR_CPUS);
-                       maxcpus = NR_CPUS;
+                              maxcpus, nr_cpu_ids);
+                       maxcpus = nr_cpu_ids;
                } else
                        printk(KERN_INFO "Partition configured for %d cpus.\n",
                               maxcpus);
@@ -503,6 +509,9 @@ void __init smp_setup_cpu_maps(void)
         */
        cpu_init_thread_core_maps(nthreads);
 
+       /* Now that possible cpus are set, set nr_cpu_ids for later use */
+       setup_nr_cpu_ids();
+
        free_unused_pacas();
 }
 #endif /* CONFIG_SMP */
@@ -575,6 +584,15 @@ int check_legacy_ioport(unsigned long base_port)
                        np = of_find_compatible_node(NULL, NULL, "pnpPNP,f03");
                if (np) {
                        parent = of_get_parent(np);
+
+                       of_i8042_kbd_irq = irq_of_parse_and_map(parent, 0);
+                       if (!of_i8042_kbd_irq)
+                               of_i8042_kbd_irq = 1;
+
+                       of_i8042_aux_irq = irq_of_parse_and_map(parent, 1);
+                       if (!of_i8042_aux_irq)
+                               of_i8042_aux_irq = 12;
+
                        of_node_put(np);
                        np = parent;
                        break;
@@ -584,6 +602,10 @@ int check_legacy_ioport(unsigned long base_port)
                 * name instead */
                if (!np)
                        np = of_find_node_by_name(NULL, "8042");
+               if (np) {
+                       of_i8042_kbd_irq = 1;
+                       of_i8042_aux_irq = 12;
+               }
                break;
        case FDC_BASE: /* FDC1 */
                np = of_find_node_by_type(NULL, "fdc");
@@ -701,16 +723,9 @@ static struct notifier_block ppc_dflt_plat_bus_notifier = {
        .priority = INT_MAX,
 };
 
-static struct notifier_block ppc_dflt_of_bus_notifier = {
-       .notifier_call = ppc_dflt_bus_notify,
-       .priority = INT_MAX,
-};
-
 static int __init setup_bus_notifier(void)
 {
        bus_register_notifier(&platform_bus_type, &ppc_dflt_plat_bus_notifier);
-       bus_register_notifier(&of_platform_bus_type, &ppc_dflt_of_bus_notifier);
-
        return 0;
 }