[POWERPC] irqtrace support for 64-bit powerpc
[safe/jmp/linux-2.6] / arch / powerpc / kernel / setup_32.c
index a4c2964..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);
@@ -63,12 +66,9 @@ unsigned int DMA_MODE_WRITE;
 
 int have_of = 1;
 
-#ifdef CONFIG_PPC_MULTIPLATFORM
-dev_t boot_dev;
-#endif /* CONFIG_PPC_MULTIPLATFORM */
-
 #ifdef CONFIG_VGA_CONSOLE
 unsigned long vgacon_remap_base;
+EXPORT_SYMBOL(vgacon_remap_base);
 #endif
 
 /*
@@ -95,13 +95,14 @@ unsigned long __init early_init(unsigned long dt_ptr)
 
        /* First zero the BSS -- use memset_io, some platforms don't have
         * caches on yet */
-       memset_io((void __iomem *)PTRRELOC(&__bss_start), 0, _end - __bss_start);
+       memset_io((void __iomem *)PTRRELOC(&__bss_start), 0,
+                       __bss_stop - __bss_start);
 
        /*
         * Identify the CPU type and fix up code sections
         * that depend on which cpu we have.
         */
-       spec = identify_cpu(offset);
+       spec = identify_cpu(offset, mfspr(SPRN_PVR));
 
        do_feature_fixups(spec->cpu_features,
                          PTRRELOC(&__start___ftr_fixup),
@@ -119,12 +120,8 @@ unsigned long __init early_init(unsigned long dt_ptr)
  */
 void __init machine_init(unsigned long dt_ptr, unsigned long phys)
 {
-       /* If btext is enabled, we might have a BAT setup for early display,
-        * thus we do enable some very basic udbg output
-        */
-#ifdef CONFIG_BOOTX_TEXT
-       udbg_putc = btext_drawchar;
-#endif
+       /* Enable early debugging if any specified (see udbg.h) */
+       udbg_early_init();
 
        /* Do some early initialization based on the flat device tree */
        early_init_devtree(__va(dt_ptr));
@@ -175,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 */
@@ -202,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) {
@@ -264,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;
@@ -278,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;
@@ -291,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();