powerpc: Fix compile error when CONFIG_PROC_VMCORE is not defined
[powerpc.git] / arch / powerpc / kernel / setup_32.c
index b45eedb..db72a92 100644 (file)
 #include <asm/nvram.h>
 #include <asm/xmon.h>
 #include <asm/time.h>
+#include <asm/serial.h>
+#include <asm/udbg.h>
+
+#include "setup.h"
 
 #define DBG(fmt...)
 
@@ -55,10 +59,6 @@ extern void power4_idle(void);
 boot_infos_t *boot_infos;
 struct ide_machdep_calls ppc_ide_md;
 
-/* XXX should go elsewhere */
-int __irq_offset_value;
-EXPORT_SYMBOL(__irq_offset_value);
-
 int boot_cpuid;
 EXPORT_SYMBOL_GPL(boot_cpuid);
 int boot_cpuid_phys;
@@ -70,8 +70,6 @@ unsigned int DMA_MODE_WRITE;
 int have_of = 1;
 
 #ifdef CONFIG_PPC_MULTIPLATFORM
-int _machine = 0;
-
 extern void prep_init(void);
 extern void pmac_init(void);
 extern void chrp_init(void);
@@ -176,12 +174,23 @@ void __init platform_init(void)
  */
 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
+
+       /* Do some early initialization based on the flat device tree */
        early_init_devtree(__va(dt_ptr));
 
+       /* Check default command line */
 #ifdef CONFIG_CMDLINE
-       strlcpy(cmd_line, CONFIG_CMDLINE, sizeof(cmd_line));
+       if (cmd_line[0] == 0)
+               strlcpy(cmd_line, CONFIG_CMDLINE, sizeof(cmd_line));
 #endif /* CONFIG_CMDLINE */
 
+       /* Base init based on machine type */
        platform_init();
 
 #ifdef CONFIG_6xx
@@ -279,37 +288,27 @@ arch_initcall(ppc_init);
 /* Warning, IO base is not yet inited */
 void __init setup_arch(char **cmdline_p)
 {
-       extern char *klimit;
        extern void do_init_bootmem(void);
 
        /* so udelay does something sensible, assume <= 1000 bogomips */
        loops_per_jiffy = 500000000 / HZ;
 
        unflatten_device_tree();
+       check_for_initrd();
+
+       if (ppc_md.init_early)
+               ppc_md.init_early();
+
+       find_legacy_serial_ports();
        finish_device_tree();
 
        smp_setup_cpu_maps();
 
-#ifdef CONFIG_BOOTX_TEXT
-       init_boot_display();
-#endif
-
-#ifdef CONFIG_PPC_PMAC
-       /* 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 */
+#ifdef CONFIG_XMON_DEFAULT
+       xmon_init(1);
 #endif
-
-#ifdef CONFIG_XMON
-       xmon_map_scc();
-       if (strstr(cmd_line, "xmon")) {
-               xmon_init(1);
-               debugger(NULL);
-       }
-#endif /* CONFIG_XMON */
-       if ( ppc_md.progress ) ppc_md.progress("setup_arch: enter", 0x3eab);
+       /* Register early console */
+       register_early_udbg_console();
 
 #if defined(CONFIG_KGDB)
        if (ppc_md.kgdb_map_scc)
@@ -342,7 +341,7 @@ void __init setup_arch(char **cmdline_p)
        init_mm.start_code = PAGE_OFFSET;
        init_mm.end_code = (unsigned long) _etext;
        init_mm.end_data = (unsigned long) _edata;
-       init_mm.brk = (unsigned long) klimit;
+       init_mm.brk = klimit;
 
        /* Save unparsed command line copy for /proc/cmdline */
        strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE);