Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[pandora-kernel.git] / arch / powerpc / kernel / udbg.c
index eba148f..fc9af47 100644 (file)
@@ -18,6 +18,7 @@
 #include <asm/udbg.h>
 
 void (*udbg_putc)(char c);
+void (*udbg_flush)(void);
 int (*udbg_getc)(void);
 int (*udbg_getc_poll)(void);
 
@@ -54,6 +55,9 @@ void __init udbg_early_init(void)
 #elif defined(CONFIG_PPC_EARLY_DEBUG_44x)
        /* PPC44x debug */
        udbg_init_44x_as1();
+#elif defined(CONFIG_PPC_EARLY_DEBUG_40x)
+       /* PPC40x debug */
+       udbg_init_40x_realmode();
 #elif defined(CONFIG_PPC_EARLY_DEBUG_CPM)
        udbg_init_cpm();
 #endif
@@ -73,6 +77,9 @@ void udbg_puts(const char *s)
                        while ((c = *s++) != '\0')
                                udbg_putc(c);
                }
+
+               if (udbg_flush)
+                       udbg_flush();
        }
 #if 0
        else {
@@ -95,6 +102,9 @@ int udbg_write(const char *s, int n)
                }
        }
 
+       if (udbg_flush)
+               udbg_flush();
+
        return n - remain;
 }
 
@@ -151,8 +161,8 @@ static void udbg_console_write(struct console *con, const char *s,
 static struct console udbg_console = {
        .name   = "udbg",
        .write  = udbg_console_write,
-       .flags  = CON_PRINTBUFFER | CON_ENABLED | CON_BOOT,
-       .index  = -1,
+       .flags  = CON_PRINTBUFFER | CON_ENABLED | CON_BOOT | CON_ANYTIME,
+       .index  = 0,
 };
 
 static int early_console_initialized;