git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git]
/
drivers
/
serial
/
amba-pl011.c
diff --git
a/drivers/serial/amba-pl011.c
b/drivers/serial/amba-pl011.c
index
3d966cf
..
034a029
100644
(file)
--- a/
drivers/serial/amba-pl011.c
+++ b/
drivers/serial/amba-pl011.c
@@
-587,12
+587,14
@@
static struct uart_amba_port *amba_ports[UART_NR];
#ifdef CONFIG_SERIAL_AMBA_PL011_CONSOLE
#ifdef CONFIG_SERIAL_AMBA_PL011_CONSOLE
-static void pl011_console_putchar(struct uart_port *port, int ch)
+static inline void
+pl011_console_write_char(struct uart_amba_port *uap, char ch)
{
{
-
struct uart_amba_port *uap = (struct uart_amba_port *)port
;
+
unsigned int status
;
- while (readw(uap->port.membase + UART01x_FR) & UART01x_FR_TXFF)
- barrier();
+ do {
+ status = readw(uap->port.membase + UART01x_FR);
+ } while (status & UART01x_FR_TXFF);
writew(ch, uap->port.membase + UART01x_DR);
}
writew(ch, uap->port.membase + UART01x_DR);
}
@@
-601,6
+603,7
@@
pl011_console_write(struct console *co, const char *s, unsigned int count)
{
struct uart_amba_port *uap = amba_ports[co->index];
unsigned int status, old_cr, new_cr;
{
struct uart_amba_port *uap = amba_ports[co->index];
unsigned int status, old_cr, new_cr;
+ int i;
clk_enable(uap->clk);
clk_enable(uap->clk);
@@
-612,7
+615,14
@@
pl011_console_write(struct console *co, const char *s, unsigned int count)
new_cr |= UART01x_CR_UARTEN | UART011_CR_TXE;
writew(new_cr, uap->port.membase + UART011_CR);
new_cr |= UART01x_CR_UARTEN | UART011_CR_TXE;
writew(new_cr, uap->port.membase + UART011_CR);
- uart_console_write(&uap->port, s, count, pl011_console_putchar);
+ /*
+ * Now, do each character
+ */
+ for (i = 0; i < count; i++) {
+ pl011_console_write_char(uap, s[i]);
+ if (s[i] == '\n')
+ pl011_console_write_char(uap, '\r');
+ }
/*
* Finally, wait for transmitter to become empty
/*
* Finally, wait for transmitter to become empty