Merge master.kernel.org:/home/rmk/linux-2.6-i2c manually
[sfrench/cifs-2.6.git] / arch / ppc64 / kernel / setup.c
index d1b33f0b26cb12261712d00b8e203cf9e7d24129..bfa8791c9807f865bb89085f0054759bbd452eaa 100644 (file)
@@ -25,7 +25,7 @@
 #include <linux/seq_file.h>
 #include <linux/ioport.h>
 #include <linux/console.h>
-#include <linux/version.h>
+#include <linux/utsname.h>
 #include <linux/tty.h>
 #include <linux/root_dev.h>
 #include <linux/notifier.h>
@@ -89,7 +89,7 @@ extern void udbg_init_maple_realmode(void);
 #define EARLY_DEBUG_INIT() udbg_init_maple_realmode()
 #define EARLY_DEBUG_INIT() udbg_init_pmac_realmode()
 #define EARLY_DEBUG_INIT()                                             \
-       do { ppc_md.udbg_putc = call_rtas_display_status_delay; } while(0)
+       do { udbg_putc = call_rtas_display_status_delay; } while(0)
 #endif
 
 /* extern void *stab; */
@@ -108,7 +108,6 @@ int boot_cpuid = 0;
 int boot_cpuid_phys = 0;
 dev_t boot_dev;
 u64 ppc64_pft_size;
-u64 ppc64_debug_switch;
 
 struct ppc64_caches ppc64_caches;
 EXPORT_SYMBOL_GPL(ppc64_caches);
@@ -154,34 +153,6 @@ struct screen_info screen_info = {
        .orig_video_points = 16
 };
 
-/*
- * Initialize the PPCDBG state.  Called before relocation has been enabled.
- */
-void __init ppcdbg_initialize(void)
-{
-       ppc64_debug_switch = PPC_DEBUG_DEFAULT; /* | PPCDBG_BUSWALK | */
-       /* PPCDBG_PHBINIT | PPCDBG_MM | PPCDBG_MMINIT | PPCDBG_TCEINIT | PPCDBG_TCE */;
-}
-
-/*
- * Early boot console based on udbg
- */
-static struct console udbg_console = {
-       .name   = "udbg",
-       .write  = udbg_console_write,
-       .flags  = CON_PRINTBUFFER,
-       .index  = -1,
-};
-static int early_console_initialized;
-
-void __init disable_early_printk(void)
-{
-       if (!early_console_initialized)
-               return;
-       unregister_console(&udbg_console);
-       early_console_initialized = 0;
-}
-
 #if defined(CONFIG_PPC_MULTIPLATFORM) && defined(CONFIG_SMP)
 
 static int smt_enabled_cmdline;
@@ -425,12 +396,6 @@ void __init early_setup(unsigned long dt_ptr)
        }
        ppc_md = **mach;
 
-       /* our udbg callbacks got overriden by the above, let's put them
-        * back in. Ultimately, I want those things to be split from the
-        * main ppc_md
-        */
-       EARLY_DEBUG_INIT();
-
        DBG("Found, Initializing memory management...\n");
 
        /*
@@ -536,15 +501,19 @@ static void __init check_for_initrd(void)
 
        DBG(" -> check_for_initrd()\n");
 
-       prop = (u64 *)get_property(of_chosen, "linux,initrd-start", NULL);
-       if (prop != NULL) {
-               initrd_start = (unsigned long)__va(*prop);
-               prop = (u64 *)get_property(of_chosen, "linux,initrd-end", NULL);
+       if (of_chosen) {
+               prop = (u64 *)get_property(of_chosen,
+                               "linux,initrd-start", NULL);
                if (prop != NULL) {
-                       initrd_end = (unsigned long)__va(*prop);
-                       initrd_below_start_ok = 1;
-               } else
-                       initrd_start = 0;
+                       initrd_start = (unsigned long)__va(*prop);
+                       prop = (u64 *)get_property(of_chosen,
+                                       "linux,initrd-end", NULL);
+                       if (prop != NULL) {
+                               initrd_end = (unsigned long)__va(*prop);
+                               initrd_below_start_ok = 1;
+                       } else
+                               initrd_start = 0;
+               }
        }
 
        /* If we were passed an initrd, set the ROOT_DEV properly if the values
@@ -627,13 +596,12 @@ void __init setup_system(void)
         * Initialize xmon
         */
 #ifdef CONFIG_XMON_DEFAULT
-       xmon_init();
+       xmon_init(1);
 #endif
        /*
         * Register early console
         */
-       early_console_initialized = 1;
-       register_console(&udbg_console);
+       register_early_udbg_console();
 
        /* Save unparsed command line copy for /proc/cmdline */
        strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE);
@@ -653,7 +621,7 @@ void __init setup_system(void)
        smp_release_cpus();
 #endif /* defined(CONFIG_SMP) && !defined(CONFIG_PPC_ISERIES) */
 
-       printk("Starting Linux PPC64 %s\n", UTS_RELEASE);
+       printk("Starting Linux PPC64 %s\n", system_utsname.version);
 
        printk("-----------------------------------------------------\n");
        printk("ppc64_pft_size                = 0x%lx\n", ppc64_pft_size);
@@ -694,7 +662,6 @@ void machine_restart(char *cmd)
        local_irq_disable();
        while (1) ;
 }
-EXPORT_SYMBOL(machine_restart);
 
 void machine_power_off(void)
 {
@@ -707,7 +674,8 @@ void machine_power_off(void)
        local_irq_disable();
        while (1) ;
 }
-EXPORT_SYMBOL(machine_power_off);
+/* Used by the G5 thermal driver */
+EXPORT_SYMBOL_GPL(machine_power_off);
 
 void machine_halt(void)
 {
@@ -720,7 +688,6 @@ void machine_halt(void)
        local_irq_disable();
        while (1) ;
 }
-EXPORT_SYMBOL(machine_halt);
 
 static int ppc64_panic_event(struct notifier_block *this,
                              unsigned long event, void *ptr)
@@ -1071,6 +1038,8 @@ void __init setup_arch(char **cmdline_p)
        irqstack_early_init();
        emergency_stack_init();
 
+       stabs_alloc();
+
        /* set up the bootmem stuff with available memory */
        do_init_bootmem();
        sparse_init();
@@ -1314,7 +1283,7 @@ void __init generic_find_legacy_serial_ports(u64 *physport,
 
 static struct platform_device serial_device = {
        .name   = "serial8250",
-       .id     = 0,
+       .id     = PLAT8250_DEV_PLATFORM,
        .dev    = {
                .platform_data = serial_ports,
        },
@@ -1342,11 +1311,13 @@ static int __init early_xmon(char *p)
        /* ensure xmon is enabled */
        if (p) {
                if (strncmp(p, "on", 2) == 0)
-                       xmon_init();
+                       xmon_init(1);
+               if (strncmp(p, "off", 3) == 0)
+                       xmon_init(0);
                if (strncmp(p, "early", 5) != 0)
                        return 0;
        }
-       xmon_init();
+       xmon_init(1);
        debugger(NULL);
 
        return 0;