]> err.no Git - linux-2.6/blobdiff - arch/ppc/kernel/setup.c
Merge branch 'upstream'
[linux-2.6] / arch / ppc / kernel / setup.c
index 1b891b806f3dfa9fd4a7781e6d745f8f9e82b7b7..c08ab432e95891b32e51d1e5bf31fc6f26eb22df 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);
@@ -76,17 +74,24 @@ unsigned int DMA_MODE_WRITE;
 
 #ifdef CONFIG_PPC_MULTIPLATFORM
 int _machine = 0;
+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);
 
 dev_t boot_dev;
 #endif /* CONFIG_PPC_MULTIPLATFORM */
 
+int have_of;
+EXPORT_SYMBOL(have_of);
+
+#ifdef __DO_IRQ_CANON
+int ppc_do_canonicalize_irqs;
+EXPORT_SYMBOL(ppc_do_canonicalize_irqs);
+#endif
+
 #ifdef CONFIG_MAGIC_SYSRQ
 unsigned long SYSRQ_KEY = 0x54;
 #endif /* CONFIG_MAGIC_SYSRQ */
@@ -188,18 +193,18 @@ int show_cpuinfo(struct seq_file *m, void *v)
        seq_printf(m, "processor\t: %d\n", i);
        seq_printf(m, "cpu\t\t: ");
 
-       if (cur_cpu_spec[i]->pvr_mask)
-               seq_printf(m, "%s", cur_cpu_spec[i]->cpu_name);
+       if (cur_cpu_spec->pvr_mask)
+               seq_printf(m, "%s", cur_cpu_spec->cpu_name);
        else
                seq_printf(m, "unknown (%08x)", pvr);
 #ifdef CONFIG_ALTIVEC
-       if (cur_cpu_spec[i]->cpu_features & CPU_FTR_ALTIVEC)
+       if (cur_cpu_spec->cpu_features & CPU_FTR_ALTIVEC)
                seq_printf(m, ", altivec supported");
 #endif
        seq_printf(m, "\n");
 
 #ifdef CONFIG_TAU
-       if (cur_cpu_spec[i]->cpu_features & CPU_FTR_TAU) {
+       if (cur_cpu_spec->cpu_features & CPU_FTR_TAU) {
 #ifdef CONFIG_TAU_AVERAGE
                /* more straightforward, but potentially misleading */
                seq_printf(m,  "temperature \t: %u C (uncalibrated)\n",
@@ -315,20 +320,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);
@@ -415,6 +415,9 @@ 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 */
        if (boot_infos)
                relocate_nodes();
@@ -484,19 +487,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;
 
@@ -553,7 +554,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)
 {
@@ -591,7 +592,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:
@@ -721,16 +734,11 @@ 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_map_scc();
+       xmon_init(1);
        if (strstr(cmd_line, "xmon"))
                xmon(NULL);
 #endif /* CONFIG_XMON */
@@ -754,12 +762,12 @@ void __init setup_arch(char **cmdline_p)
         * for a possibly more accurate value.
         */
        if (cpu_has_feature(CPU_FTR_SPLIT_ID_CACHE)) {
-               dcache_bsize = cur_cpu_spec[0]->dcache_bsize;
-               icache_bsize = cur_cpu_spec[0]->icache_bsize;
+               dcache_bsize = cur_cpu_spec->dcache_bsize;
+               icache_bsize = cur_cpu_spec->icache_bsize;
                ucache_bsize = 0;
        } else
                ucache_bsize = dcache_bsize = icache_bsize
-                       = cur_cpu_spec[0]->dcache_bsize;
+                       = cur_cpu_spec->dcache_bsize;
 
        /* reboot on panic */
        panic_timeout = 180;