Remove obsolete #include <linux/config.h>
[cascardo/linux.git] / arch / powerpc / kernel / udbg.c
index 9567d94..5730906 100644 (file)
  */
 
 #include <stdarg.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/sched.h>
 #include <linux/console.h>
+#include <linux/init.h>
 #include <asm/processor.h>
+#include <asm/udbg.h>
 
 void (*udbg_putc)(char c);
 int (*udbg_getc)(void);
 int (*udbg_getc_poll)(void);
 
+/*
+ * Early debugging facilities. You can enable _one_ of these via .config,
+ * if you do so your kernel _will not boot_ on anything else. Be careful.
+ */
+void __init udbg_early_init(void)
+{
+#if defined(CONFIG_PPC_EARLY_DEBUG_LPAR)
+       /* For LPAR machines that have an HVC console on vterm 0 */
+       udbg_init_debug_lpar();
+#elif defined(CONFIG_PPC_EARLY_DEBUG_G5)
+       /* For use on Apple G5 machines */
+       udbg_init_pmac_realmode();
+#elif defined(CONFIG_PPC_EARLY_DEBUG_RTAS_PANEL)
+       /* RTAS panel debug */
+       udbg_init_rtas_panel();
+#elif defined(CONFIG_PPC_EARLY_DEBUG_RTAS_CONSOLE)
+       /* RTAS console debug */
+       udbg_init_rtas_console();
+#elif defined(CONFIG_PPC_EARLY_DEBUG_MAPLE)
+       /* Maple real mode debug */
+       udbg_init_maple_realmode();
+#elif defined(CONFIG_PPC_EARLY_DEBUG_ISERIES)
+       /* For iSeries - hit Ctrl-x Ctrl-x to see the output */
+       udbg_init_iseries();
+#endif
+}
+
 /* udbg library, used by xmon et al */
 void udbg_puts(const char *s)
 {
@@ -90,6 +118,12 @@ void udbg_printf(const char *fmt, ...)
        va_end(args);
 }
 
+void __init udbg_progress(char *s, unsigned short hex)
+{
+       udbg_puts(s);
+       udbg_puts("\n");
+}
+
 /*
  * Early boot console based on udbg
  */
@@ -110,12 +144,14 @@ static int early_console_initialized;
 
 void __init disable_early_printk(void)
 {
-#if 1
        if (!early_console_initialized)
                return;
+       if (strstr(saved_command_line, "udbg-immortal")) {
+               printk(KERN_INFO "early console immortal !\n");
+               return;
+       }
        unregister_console(&udbg_console);
        early_console_initialized = 0;
-#endif
 }
 
 /* called by setup_system */