Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart
[sfrench/cifs-2.6.git] / arch / ppc / kernel / setup.c
index dc55e1abc45bde685741522caa14f1cfae7cfb5e..53e9deacee824884fd43cf8eab392cfa64b597ce 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Common prep/pmac/chrp boot and setup code.
+ * Common prep/chrp boot and setup code.
  */
 
 #include <linux/config.h>
@@ -35,7 +35,6 @@
 #include <asm/machdep.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
-#include <asm/pmac_feature.h>
 #include <asm/sections.h>
 #include <asm/nvram.h>
 #include <asm/xmon.h>
@@ -55,7 +54,6 @@
 
 extern void platform_init(unsigned long r3, unsigned long r4,
                unsigned long r5, unsigned long r6, unsigned long r7);
-extern void bootx_init(unsigned long r4, unsigned long phys);
 extern void identify_cpu(unsigned long offset, unsigned long cpu);
 extern void do_cpu_ftr_fixups(unsigned long offset);
 extern void reloc_got2(unsigned long offset);
@@ -80,8 +78,6 @@ EXPORT_SYMBOL(_machine);
 
 extern void prep_init(unsigned long r3, unsigned long r4,
                unsigned long r5, unsigned long r6, unsigned long r7);
-extern void pmac_init(unsigned long r3, unsigned long r4,
-               unsigned long r5, unsigned long r6, unsigned long r7);
 extern void chrp_init(unsigned long r3, unsigned long r4,
                unsigned long r5, unsigned long r6, unsigned long r7);
 
@@ -172,9 +168,8 @@ int show_cpuinfo(struct seq_file *m, void *v)
                /* Show summary information */
 #ifdef CONFIG_SMP
                unsigned long bogosum = 0;
-               for (i = 0; i < NR_CPUS; ++i)
-                       if (cpu_online(i))
-                               bogosum += cpu_data[i].loops_per_jiffy;
+               for_each_online_cpu(i)
+                       bogosum += cpu_data[i].loops_per_jiffy;
                seq_printf(m, "total bogomips\t: %lu.%02lu\n",
                           bogosum/(500000/HZ), bogosum/(5000/HZ) % 100);
 #endif /* CONFIG_SMP */
@@ -324,20 +319,15 @@ early_init(int r3, int r4, int r5)
        identify_cpu(offset, 0);
        do_cpu_ftr_fixups(offset);
 
-#if defined(CONFIG_PPC_MULTIPLATFORM)
+#if defined(CONFIG_PPC_OF)
        reloc_got2(offset);
 
-       /* If we came here from BootX, clear the screen,
-        * set up some pointers and return. */
-       if ((r3 == 0x426f6f58) && (r5 == 0))
-               bootx_init(r4, phys);
-
        /*
         * don't do anything on prep
         * for now, don't use bootinfo because it breaks yaboot 0.5
         * and assume that if we didn't find a magic number, we have OF
         */
-       else if (*(unsigned long *)(0) != 0xdeadc0de)
+       if (*(unsigned long *)(0) != 0xdeadc0de)
                phys = prom_init(r3, r4, (prom_entry)r5);
 
        reloc_got2(-offset);
@@ -424,6 +414,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
        }
 #endif
 
+#ifdef CONFIG_PPC_OF
        have_of = 1;
 
        /* prom_init has already been called from __start */
@@ -495,19 +486,17 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
 #endif /* CONFIG_ADB */
 
        switch (_machine) {
-#ifdef CONFIG_PPC_PMAC
-       case _MACH_Pmac:
-               pmac_init(r3, r4, r5, r6, r7);
-               break;
-#endif
 #ifdef CONFIG_PPC_CHRP
        case _MACH_chrp:
                chrp_init(r3, r4, r5, r6, r7);
                break;
 #endif
        }
+#endif /* CONFIG_PPC_OF */
 }
+#endif /* CONFIG_PPC_MULTIPLATFORM */
 
+#ifdef CONFIG_PPC_OF
 #ifdef CONFIG_SERIAL_CORE_CONSOLE
 extern char *of_stdout_device;
 
@@ -564,7 +553,7 @@ static int __init set_preferred_console(void)
 }
 console_initcall(set_preferred_console);
 #endif /* CONFIG_SERIAL_CORE_CONSOLE */
-#endif /* CONFIG_PPC_MULTIPLATFORM */
+#endif /* CONFIG_PPC_OF */
 
 struct bi_record *find_bootinfo(void)
 {
@@ -602,7 +591,19 @@ void parse_bootinfo(struct bi_record *rec)
 #endif /* CONFIG_BLK_DEV_INITRD */
 #ifdef CONFIG_PPC_MULTIPLATFORM
                case BI_MACHTYPE:
-                       _machine = data[0];
+                       /* Machine types changed with the merge. Since the
+                        * bootinfo are now deprecated, we can just hard code
+                        * the appropriate conversion here for when we are
+                        * called with yaboot which passes us a machine type
+                        * this way.
+                        */
+                       switch(data[0]) {
+                       case 1: _machine = _MACH_prep; break;
+                       case 2: _machine = _MACH_Pmac; break;
+                       case 4: _machine = _MACH_chrp; break;
+                       default:
+                               _machine = data[0];
+                       }
                        break;
 #endif
                case BI_MEMSIZE:
@@ -710,9 +711,8 @@ int __init ppc_init(void)
        if ( ppc_md.progress ) ppc_md.progress("             ", 0xffff);
 
        /* register CPU devices */
-       for (i = 0; i < NR_CPUS; i++)
-               if (cpu_possible(i))
-                       register_cpu(&cpu_devices[i], i, NULL);
+       for_each_cpu(i)
+               register_cpu(&cpu_devices[i], i, NULL);
 
        /* call platform init */
        if (ppc_md.init != NULL) {
@@ -732,13 +732,8 @@ void __init setup_arch(char **cmdline_p)
        /* so udelay does something sensible, assume <= 1000 bogomips */
        loops_per_jiffy = 500000000 / HZ;
 
-#ifdef CONFIG_PPC_MULTIPLATFORM
-       /* This could be called "early setup arch", it must be done
-        * now because xmon need it
-        */
-       if (_machine == _MACH_Pmac)
-               pmac_feature_init();    /* New cool way */
-#endif
+       if (ppc_md.init_early)
+               ppc_md.init_early();
 
 #ifdef CONFIG_XMON
        xmon_init(1);