diff options
Diffstat (limited to 'drivers/serial/amba-pl011.c')
-rw-r--r-- | drivers/serial/amba-pl011.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c index 034a029e356e..3d966cfc9a38 100644 --- a/drivers/serial/amba-pl011.c +++ b/drivers/serial/amba-pl011.c | |||
@@ -587,14 +587,12 @@ static struct uart_amba_port *amba_ports[UART_NR]; | |||
587 | 587 | ||
588 | #ifdef CONFIG_SERIAL_AMBA_PL011_CONSOLE | 588 | #ifdef CONFIG_SERIAL_AMBA_PL011_CONSOLE |
589 | 589 | ||
590 | static inline void | 590 | static void pl011_console_putchar(struct uart_port *port, int ch) |
591 | pl011_console_write_char(struct uart_amba_port *uap, char ch) | ||
592 | { | 591 | { |
593 | unsigned int status; | 592 | struct uart_amba_port *uap = (struct uart_amba_port *)port; |
594 | 593 | ||
595 | do { | 594 | while (readw(uap->port.membase + UART01x_FR) & UART01x_FR_TXFF) |
596 | status = readw(uap->port.membase + UART01x_FR); | 595 | barrier(); |
597 | } while (status & UART01x_FR_TXFF); | ||
598 | writew(ch, uap->port.membase + UART01x_DR); | 596 | writew(ch, uap->port.membase + UART01x_DR); |
599 | } | 597 | } |
600 | 598 | ||
@@ -603,7 +601,6 @@ pl011_console_write(struct console *co, const char *s, unsigned int count) | |||
603 | { | 601 | { |
604 | struct uart_amba_port *uap = amba_ports[co->index]; | 602 | struct uart_amba_port *uap = amba_ports[co->index]; |
605 | unsigned int status, old_cr, new_cr; | 603 | unsigned int status, old_cr, new_cr; |
606 | int i; | ||
607 | 604 | ||
608 | clk_enable(uap->clk); | 605 | clk_enable(uap->clk); |
609 | 606 | ||
@@ -615,14 +612,7 @@ pl011_console_write(struct console *co, const char *s, unsigned int count) | |||
615 | new_cr |= UART01x_CR_UARTEN | UART011_CR_TXE; | 612 | new_cr |= UART01x_CR_UARTEN | UART011_CR_TXE; |
616 | writew(new_cr, uap->port.membase + UART011_CR); | 613 | writew(new_cr, uap->port.membase + UART011_CR); |
617 | 614 | ||
618 | /* | 615 | uart_console_write(&uap->port, s, count, pl011_console_putchar); |
619 | * Now, do each character | ||
620 | */ | ||
621 | for (i = 0; i < count; i++) { | ||
622 | pl011_console_write_char(uap, s[i]); | ||
623 | if (s[i] == '\n') | ||
624 | pl011_console_write_char(uap, '\r'); | ||
625 | } | ||
626 | 616 | ||
627 | /* | 617 | /* |
628 | * Finally, wait for transmitter to become empty | 618 | * Finally, wait for transmitter to become empty |