aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2006-01-10 19:54:08 -0500
committerPaul Mackerras <paulus@samba.org>2006-01-10 22:48:13 -0500
commitbf6a7112bda99aadd6675526423a96be6b356a3d (patch)
treee3a0e144ac933e7f35d6fa5f95bc0e0fb0ba6309
parentf481f1edee77b3d623457685add1c6b507c25d6f (diff)
[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 <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--arch/powerpc/kernel/setup_64.c14
-rw-r--r--arch/powerpc/platforms/iseries/setup.c18
-rw-r--r--drivers/char/viocons.c4
3 files changed, 26 insertions, 10 deletions
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index c4b76961d6de..177d8249078d 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -75,22 +75,26 @@
75 * but your kernel will not boot on anything else if you do so 75 * but your kernel will not boot on anything else if you do so
76 */ 76 */
77 77
78/* This one is for use on LPAR machines that support an HVC console 78/* For use on LPAR machines that support an HVC console on vterm 0 */
79 * on vterm 0
80 */
81extern void udbg_init_debug_lpar(void); 79extern void udbg_init_debug_lpar(void);
82/* This one is for use on Apple G5 machines 80
83 */ 81/* This one is for use on Apple G5 machines */
84extern void udbg_init_pmac_realmode(void); 82extern void udbg_init_pmac_realmode(void);
83
85/* That's RTAS panel debug */ 84/* That's RTAS panel debug */
86extern void call_rtas_display_status_delay(unsigned char c); 85extern void call_rtas_display_status_delay(unsigned char c);
86
87/* Here's maple real mode debug */ 87/* Here's maple real mode debug */
88extern void udbg_init_maple_realmode(void); 88extern void udbg_init_maple_realmode(void);
89 89
90/* For iSeries - hit Ctrl-x Ctrl-x to see the output */
91extern void udbg_init_iseries(void);
92
90#define EARLY_DEBUG_INIT() do {} while(0) 93#define EARLY_DEBUG_INIT() do {} while(0)
91 94
92#if 0 95#if 0
93#define EARLY_DEBUG_INIT() udbg_init_debug_lpar() 96#define EARLY_DEBUG_INIT() udbg_init_debug_lpar()
97#define EARLY_DEBUG_INIT() udbg_init_iseries()
94#define EARLY_DEBUG_INIT() udbg_init_maple_realmode() 98#define EARLY_DEBUG_INIT() udbg_init_maple_realmode()
95#define EARLY_DEBUG_INIT() udbg_init_pmac_realmode() 99#define EARLY_DEBUG_INIT() udbg_init_pmac_realmode()
96#define EARLY_DEBUG_INIT() \ 100#define EARLY_DEBUG_INIT() \
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index ad5ef80500ce..25cdebdf6f2e 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -52,6 +52,7 @@
52#include <asm/iseries/mf.h> 52#include <asm/iseries/mf.h>
53#include <asm/iseries/hv_lp_event.h> 53#include <asm/iseries/hv_lp_event.h>
54#include <asm/iseries/lpar_map.h> 54#include <asm/iseries/lpar_map.h>
55#include <asm/udbg.h>
55 56
56#include "naca.h" 57#include "naca.h"
57#include "setup.h" 58#include "setup.h"
@@ -62,10 +63,8 @@
62#include "call_sm.h" 63#include "call_sm.h"
63#include "call_hpt.h" 64#include "call_hpt.h"
64 65
65extern void hvlog(char *fmt, ...);
66
67#ifdef DEBUG 66#ifdef DEBUG
68#define DBG(fmt...) hvlog(fmt) 67#define DBG(fmt...) udbg_printf(fmt)
69#else 68#else
70#define DBG(fmt...) 69#define DBG(fmt...)
71#endif 70#endif
@@ -984,3 +983,16 @@ static int __init early_parsemem(char *p)
984 return 0; 983 return 0;
985} 984}
986early_param("mem", early_parsemem); 985early_param("mem", early_parsemem);
986
987static void hvputc(char c)
988{
989 if (c == '\n')
990 hvputc('\r');
991
992 HvCall_writeLogBuffer(&c, 1);
993}
994
995void __init udbg_init_iseries(void)
996{
997 udbg_putc = hvputc;
998}
diff --git a/drivers/char/viocons.c b/drivers/char/viocons.c
index cb82ebf4cb07..bead38a4a68a 100644
--- a/drivers/char/viocons.c
+++ b/drivers/char/viocons.c
@@ -131,7 +131,7 @@ static void initDataEvent(struct viocharlpevent *viochar, HvLpIndex lp);
131 131
132static struct tty_driver *viotty_driver; 132static struct tty_driver *viotty_driver;
133 133
134void hvlog(char *fmt, ...) 134static void hvlog(char *fmt, ...)
135{ 135{
136 int i; 136 int i;
137 unsigned long flags; 137 unsigned long flags;
@@ -147,7 +147,7 @@ void hvlog(char *fmt, ...)
147 spin_unlock_irqrestore(&consoleloglock, flags); 147 spin_unlock_irqrestore(&consoleloglock, flags);
148} 148}
149 149
150void hvlogOutput(const char *buf, int count) 150static void hvlogOutput(const char *buf, int count)
151{ 151{
152 unsigned long flags; 152 unsigned long flags;
153 int begin; 153 int begin;