[POWERPC] irqtrace support for 64-bit powerpc
[safe/jmp/linux-2.6] / arch / powerpc / kernel / setup_32.c
index f688548..d813c39 100644 (file)
@@ -10,7 +10,9 @@
 #include <linux/reboot.h>
 #include <linux/delay.h>
 #include <linux/initrd.h>
+#if defined(CONFIG_IDE) || defined(CONFIG_IDE_MODULE)
 #include <linux/ide.h>
+#endif
 #include <linux/tty.h>
 #include <linux/bootmem.h>
 #include <linux/seq_file.h>
 #include <linux/cpu.h>
 #include <linux/console.h>
 
-#include <asm/residual.h>
 #include <asm/io.h>
 #include <asm/prom.h>
 #include <asm/processor.h>
 #include <asm/pgtable.h>
 #include <asm/setup.h>
-#include <asm/amigappc.h>
 #include <asm/smp.h>
 #include <asm/elf.h>
 #include <asm/cputable.h>
 
 extern void bootx_init(unsigned long r4, unsigned long phys);
 
+#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
 struct ide_machdep_calls ppc_ide_md;
+EXPORT_SYMBOL(ppc_ide_md);
+#endif
 
 int boot_cpuid;
 EXPORT_SYMBOL_GPL(boot_cpuid);
@@ -169,6 +172,18 @@ int __init ppc_setup_l2cr(char *str)
 }
 __setup("l2cr=", ppc_setup_l2cr);
 
+/* Checks "l3cr=xxxx" command-line option */
+int __init ppc_setup_l3cr(char *str)
+{
+       if (cpu_has_feature(CPU_FTR_L3CR)) {
+               unsigned long val = simple_strtoul(str, NULL, 0);
+               printk(KERN_INFO "l3cr set to %lx\n", val);
+               _set_L3CR(val);         /* and enable it */
+       }
+       return 1;
+}
+__setup("l3cr=", ppc_setup_l3cr);
+
 #ifdef CONFIG_GENERIC_NVRAM
 
 /* Generic nvram hooks used by drivers/char/gen_nvram.c */
@@ -196,18 +211,22 @@ EXPORT_SYMBOL(nvram_sync);
 
 #endif /* CONFIG_NVRAM */
 
-static struct cpu cpu_devices[NR_CPUS];
+static DEFINE_PER_CPU(struct cpu, cpu_devices);
 
 int __init ppc_init(void)
 {
-       int i;
+       int cpu;
 
        /* clear the progress line */
-       if ( ppc_md.progress ) ppc_md.progress("             ", 0xffff);
+       if (ppc_md.progress)
+               ppc_md.progress("             ", 0xffff);
 
        /* register CPU devices */
-       for_each_possible_cpu(i)
-               register_cpu(&cpu_devices[i], i);
+       for_each_possible_cpu(cpu) {
+               struct cpu *c = &per_cpu(cpu_devices, cpu);
+               c->hotpluggable = 1;
+               register_cpu(c, cpu);
+       }
 
        /* call platform init */
        if (ppc_md.init != NULL) {
@@ -258,13 +277,11 @@ void __init setup_arch(char **cmdline_p)
         * Systems with OF can look in the properties on the cpu node(s)
         * for a possibly more accurate value.
         */
-       if (cpu_has_feature(CPU_FTR_SPLIT_ID_CACHE)) {
-               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->dcache_bsize;
+       dcache_bsize = cur_cpu_spec->dcache_bsize;
+       icache_bsize = cur_cpu_spec->icache_bsize;
+       ucache_bsize = 0;
+       if (cpu_has_feature(CPU_FTR_UNIFIED_ID_CACHE))
+               ucache_bsize = icache_bsize = dcache_bsize;
 
        /* reboot on panic */
        panic_timeout = 180;
@@ -272,7 +289,7 @@ void __init setup_arch(char **cmdline_p)
        if (ppc_md.panic)
                setup_panic();
 
-       init_mm.start_code = PAGE_OFFSET;
+       init_mm.start_code = (unsigned long)_stext;
        init_mm.end_code = (unsigned long) _etext;
        init_mm.end_data = (unsigned long) _edata;
        init_mm.brk = klimit;
@@ -285,7 +302,8 @@ void __init setup_arch(char **cmdline_p)
        conswitchp = &dummy_con;
 #endif
 
-       ppc_md.setup_arch();
+       if (ppc_md.setup_arch)
+               ppc_md.setup_arch();
        if ( ppc_md.progress ) ppc_md.progress("arch: exit", 0x3eab);
 
        paging_init();