#include <asm/io.h>
 #include <asm/lmb.h>
 #include <asm/processor.h>
+#include <asm/udbg.h>
 
 #define NO_SCROLL
 
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 0x00, 0x00, 0x00, 0x00,
 };
+
+void __init udbg_init_btext(void)
+{
+       /* If btext is enabled, we might have a BAT setup for early display,
+        * thus we do enable some very basic udbg output
+        */
+       udbg_putc = btext_drawchar;
+}
 
  */
 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));
 
        udbg_init_debug_beat();
 #elif defined(CONFIG_PPC_EARLY_DEBUG_PAS_REALMODE)
        udbg_init_pas_realmode();
+#elif defined(CONFIG_BOOTX_TEXT)
+       udbg_init_btext();
 #endif
 }
 
 
 extern void __init udbg_init_rtas_panel(void);
 extern void __init udbg_init_rtas_console(void);
 extern void __init udbg_init_debug_beat(void);
+extern void __init udbg_init_btext(void);
 
 #endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_UDBG_H */