From: Michael Ellerman Date: Wed, 11 Jan 2006 00:54:08 +0000 (+1100) Subject: [PATCH] powerpc: Early debugging support for iSeries X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bf6a7112bda99aadd6675526423a96be6b356a3d;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git [PATCH] powerpc: Early debugging support for iSeries Connect iSeries up to the standard early debugging infrastructure. To actually use this you need to enable the iSeries early debugging in setup_64.c. Then after the messages are logged hit Ctrl-x Ctrl-x on your console to dump the Hypervisor console buffer. Signed-off-by: Michael Ellerman Signed-off-by: Paul Mackerras --- diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index c4b76961d6d..177d8249078 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -75,22 +75,26 @@ * but your kernel will not boot on anything else if you do so */ -/* This one is for use on LPAR machines that support an HVC console - * on vterm 0 - */ +/* For use on LPAR machines that support an HVC console on vterm 0 */ extern void udbg_init_debug_lpar(void); -/* This one is for use on Apple G5 machines - */ + +/* This one is for use on Apple G5 machines */ extern void udbg_init_pmac_realmode(void); + /* That's RTAS panel debug */ extern void call_rtas_display_status_delay(unsigned char c); + /* Here's maple real mode debug */ extern void udbg_init_maple_realmode(void); +/* For iSeries - hit Ctrl-x Ctrl-x to see the output */ +extern void udbg_init_iseries(void); + #define EARLY_DEBUG_INIT() do {} while(0) #if 0 #define EARLY_DEBUG_INIT() udbg_init_debug_lpar() +#define EARLY_DEBUG_INIT() udbg_init_iseries() #define EARLY_DEBUG_INIT() udbg_init_maple_realmode() #define EARLY_DEBUG_INIT() udbg_init_pmac_realmode() #define EARLY_DEBUG_INIT() \ diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c index ad5ef80500c..25cdebdf6f2 100644 --- a/arch/powerpc/platforms/iseries/setup.c +++ b/arch/powerpc/platforms/iseries/setup.c @@ -52,6 +52,7 @@ #include #include #include +#include #include "naca.h" #include "setup.h" @@ -62,10 +63,8 @@ #include "call_sm.h" #include "call_hpt.h" -extern void hvlog(char *fmt, ...); - #ifdef DEBUG -#define DBG(fmt...) hvlog(fmt) +#define DBG(fmt...) udbg_printf(fmt) #else #define DBG(fmt...) #endif @@ -984,3 +983,16 @@ static int __init early_parsemem(char *p) return 0; } early_param("mem", early_parsemem); + +static void hvputc(char c) +{ + if (c == '\n') + hvputc('\r'); + + HvCall_writeLogBuffer(&c, 1); +} + +void __init udbg_init_iseries(void) +{ + udbg_putc = hvputc; +} diff --git a/drivers/char/viocons.c b/drivers/char/viocons.c index cb82ebf4cb0..bead38a4a68 100644 --- a/drivers/char/viocons.c +++ b/drivers/char/viocons.c @@ -131,7 +131,7 @@ static void initDataEvent(struct viocharlpevent *viochar, HvLpIndex lp); static struct tty_driver *viotty_driver; -void hvlog(char *fmt, ...) +static void hvlog(char *fmt, ...) { int i; unsigned long flags; @@ -147,7 +147,7 @@ void hvlog(char *fmt, ...) spin_unlock_irqrestore(&consoleloglock, flags); } -void hvlogOutput(const char *buf, int count) +static void hvlogOutput(const char *buf, int count) { unsigned long flags; int begin;