From bb6b9b28d6847bc71f910e2e82c9040ff4b97ec0 Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Wed, 30 Nov 2005 16:54:12 +1100 Subject: [PATCH] powerpc: udbg updates The udbg low level io layer has an issue with udbg_getc() returning a char (unsigned on ppc) instead of an int, thus the -1 if you had no available input device could end up turned into 0xff, filling your display with bogus characters. This fixes it, along with adding a little blob to xmon to do a delay before exiting when getting an EOF and fixing the detection of ADB keyboards in udbg_adb.c Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/powermac/udbg_adb.c | 8 ++++---- arch/powerpc/platforms/powermac/udbg_scc.c | 4 ++-- arch/powerpc/platforms/pseries/lpar.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'arch/powerpc/platforms') diff --git a/arch/powerpc/platforms/powermac/udbg_adb.c b/arch/powerpc/platforms/powermac/udbg_adb.c index 3d5ed23bf0e..06c8265c2ba 100644 --- a/arch/powerpc/platforms/powermac/udbg_adb.c +++ b/arch/powerpc/platforms/powermac/udbg_adb.c @@ -29,7 +29,7 @@ */ static void (*udbg_adb_old_putc)(char c); -static char (*udbg_adb_old_getc)(void); +static int (*udbg_adb_old_getc)(void); static int (*udbg_adb_old_getc_poll)(void); static enum { @@ -73,7 +73,7 @@ static unsigned char xmon_shift_keytab[128] = "\0.\0*\0+\0\0\0\0\0/\r\0-\0" /* 0x40 - 0x4f */ "\0\0000123456789\0\0\0"; /* 0x50 - 0x5f */ -static char udbg_adb_local_getc(void) +static int udbg_adb_local_getc(void) { int k, t, on; @@ -116,7 +116,7 @@ static char udbg_adb_local_getc(void) } #endif /* CONFIG_BOOTX_TEXT */ -static char udbg_adb_getc(void) +static int udbg_adb_getc(void) { #ifdef CONFIG_BOOTX_TEXT if (udbg_adb_use_btext && input_type != input_adb_none) @@ -195,7 +195,7 @@ int udbg_adb_init(int force_btext) */ for (np = NULL; (np = of_find_node_by_name(np, "keyboard")) != NULL;) { struct device_node *parent = of_get_parent(np); - int found = (parent && !strcmp(parent->type, "adb") == 0); + int found = (parent && strcmp(parent->type, "adb") == 0); of_node_put(parent); if (found) break; diff --git a/arch/powerpc/platforms/powermac/udbg_scc.c b/arch/powerpc/platforms/powermac/udbg_scc.c index df6dec49c4c..e87d53acfb6 100644 --- a/arch/powerpc/platforms/powermac/udbg_scc.c +++ b/arch/powerpc/platforms/powermac/udbg_scc.c @@ -47,14 +47,14 @@ static int udbg_scc_getc_poll(void) return -1; } -static char udbg_scc_getc(void) +static int udbg_scc_getc(void) { if (sccc) { while ((in_8(sccc) & SCC_RXRDY) == 0) ; return in_8(sccd); } - return 0; + return -1; } static unsigned char scc_inittab[] = { diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c index 615ffb96105..1fe445ab78a 100644 --- a/arch/powerpc/platforms/pseries/lpar.c +++ b/arch/powerpc/platforms/pseries/lpar.c @@ -112,7 +112,7 @@ static int udbg_hvsi_getc_poll(void) return ch; } -static char udbg_hvsi_getc(void) +static int udbg_hvsi_getc(void) { int ch; for (;;) { @@ -173,7 +173,7 @@ static int udbg_getc_pollLP(void) return ch; } -static char udbg_getcLP(void) +static int udbg_getcLP(void) { int ch; for (;;) { -- cgit v1.2.3