Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[POWERPC] Use udbg_early_init() on ppc32

udbg_early_init() is a function used on 64 bit systems, which
initializes whichever early udbg backend is configured. This function
is not called on 32-bit, however if btext early debug is enabled it
does have an explicit, inline, #ifdef-ed assignment performing
analagous initialization.

This patch makes things more uniform by folding the btext
initialization as an option into udbg_early_init() and calling that
from the 32-bit setup path.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by

David Gibson and committed by
Paul Mackerras
719c91cc 8d38a5b2

+14 -6
+9
arch/powerpc/kernel/btext.c
··· 18 18 #include <asm/io.h> 19 19 #include <asm/lmb.h> 20 20 #include <asm/processor.h> 21 + #include <asm/udbg.h> 21 22 22 23 #define NO_SCROLL 23 24 ··· 913 912 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 914 913 0x00, 0x00, 0x00, 0x00, 915 914 }; 915 + 916 + void __init udbg_init_btext(void) 917 + { 918 + /* If btext is enabled, we might have a BAT setup for early display, 919 + * thus we do enable some very basic udbg output 920 + */ 921 + udbg_putc = btext_drawchar; 922 + }
+2 -6
arch/powerpc/kernel/setup_32.c
··· 116 116 */ 117 117 void __init machine_init(unsigned long dt_ptr, unsigned long phys) 118 118 { 119 - /* If btext is enabled, we might have a BAT setup for early display, 120 - * thus we do enable some very basic udbg output 121 - */ 122 - #ifdef CONFIG_BOOTX_TEXT 123 - udbg_putc = btext_drawchar; 124 - #endif 119 + /* Enable early debugging if any specified (see udbg.h) */ 120 + udbg_early_init(); 125 121 126 122 /* Do some early initialization based on the flat device tree */ 127 123 early_init_devtree(__va(dt_ptr));
+2
arch/powerpc/kernel/udbg.c
··· 49 49 udbg_init_debug_beat(); 50 50 #elif defined(CONFIG_PPC_EARLY_DEBUG_PAS_REALMODE) 51 51 udbg_init_pas_realmode(); 52 + #elif defined(CONFIG_BOOTX_TEXT) 53 + udbg_init_btext(); 52 54 #endif 53 55 } 54 56
+1
include/asm-powerpc/udbg.h
··· 46 46 extern void __init udbg_init_rtas_panel(void); 47 47 extern void __init udbg_init_rtas_console(void); 48 48 extern void __init udbg_init_debug_beat(void); 49 + extern void __init udbg_init_btext(void); 49 50 50 51 #endif /* __KERNEL__ */ 51 52 #endif /* _ASM_POWERPC_UDBG_H */