* required, these have to be supplied via some other means (eg, GPIO)
* and hooked into this driver.
*/
+#include <linux/config.h>
#if defined(CONFIG_SERIAL_AMBA_PL011_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
#define SUPPORT_SYSRQ
#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);
}
{
struct uart_amba_port *uap = amba_ports[co->index];
unsigned int status, old_cr, new_cr;
+ int i;
clk_enable(uap->clk);
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