mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-05-07 04:21:33 -04:00
[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 <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
committed by
Paul Mackerras
parent
54b9a9aedc
commit
bb6b9b28d6
@@ -276,7 +276,7 @@ static int of_translate_one(struct device_node *parent, struct of_bus *bus,
|
||||
|
||||
finish:
|
||||
of_dump_addr("OF: parent translation for:", addr, pna);
|
||||
DBG("OF: with offset: %lx\n", offset);
|
||||
DBG("OF: with offset: "PRu64"\n", offset);
|
||||
|
||||
/* Translate it into parent bus space */
|
||||
return pbus->translate(addr, offset, pna);
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include <asm/processor.h>
|
||||
|
||||
void (*udbg_putc)(char c);
|
||||
char (*udbg_getc)(void);
|
||||
int (*udbg_getc)(void);
|
||||
int (*udbg_getc_poll)(void);
|
||||
|
||||
/* udbg library, used by xmon et al */
|
||||
@@ -57,8 +57,8 @@ int udbg_write(const char *s, int n)
|
||||
|
||||
int udbg_read(char *buf, int buflen)
|
||||
{
|
||||
char c, *p = buf;
|
||||
int i;
|
||||
char *p = buf;
|
||||
int i, c;
|
||||
|
||||
if (!udbg_getc)
|
||||
return 0;
|
||||
@@ -66,8 +66,11 @@ int udbg_read(char *buf, int buflen)
|
||||
for (i = 0; i < buflen; ++i) {
|
||||
do {
|
||||
c = udbg_getc();
|
||||
if (c == -1 && i == 0)
|
||||
return -1;
|
||||
|
||||
} while (c == 0x11 || c == 0x13);
|
||||
if (c == 0)
|
||||
if (c == 0 || c == -1)
|
||||
break;
|
||||
*p++ = c;
|
||||
}
|
||||
|
||||
@@ -69,14 +69,14 @@ static int udbg_550_getc_poll(void)
|
||||
return -1;
|
||||
}
|
||||
|
||||
static char udbg_550_getc(void)
|
||||
static int udbg_550_getc(void)
|
||||
{
|
||||
if (udbg_comport) {
|
||||
while ((in_8(&udbg_comport->lsr) & LSR_DR) == 0)
|
||||
/* wait for char */;
|
||||
return in_8(&udbg_comport->rbr);
|
||||
}
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
void udbg_init_uart(void __iomem *comport, unsigned int speed,
|
||||
|
||||
Reference in New Issue
Block a user