Commit 68349581 authored by Philippe Gerum's avatar Philippe Gerum

serial/xilinx: enable raw console channel

Enable the serial driver for raw_printk() output.
parent 97a8d8fa
......@@ -1216,6 +1216,34 @@ static void cdns_uart_console_write(struct console *co, const char *s,
spin_unlock_irqrestore(&port->lock, flags);
}
#ifdef CONFIG_RAW_PRINTK
static void cdns_uart_console_write_raw(struct console *co, const char *s,
unsigned int count)
{
struct uart_port *port = &cdns_uart_port[co->index];
unsigned int imr, ctrl;
imr = readl(port->membase + CDNS_UART_IMR);
writel(imr, port->membase + CDNS_UART_IDR);
ctrl = readl(port->membase + CDNS_UART_CR);
ctrl &= ~CDNS_UART_CR_TX_DIS;
ctrl |= CDNS_UART_CR_TX_EN;
writel(ctrl, port->membase + CDNS_UART_CR);
while (count-- > 0) {
if (*s == '\n')
writel('\r', port->membase + CDNS_UART_FIFO);
writel(*s++, port->membase + CDNS_UART_FIFO);
}
writel(ctrl, port->membase + CDNS_UART_CR);
writel(imr, port->membase + CDNS_UART_IER);
}
#endif
/**
* cdns_uart_console_setup - Initialize the uart to default config
* @co: Console handle
......@@ -1251,7 +1279,12 @@ static struct console cdns_uart_console = {
.write = cdns_uart_console_write,
.device = uart_console_device,
.setup = cdns_uart_console_setup,
#ifdef CONFIG_RAW_PRINTK
.write_raw = cdns_uart_console_write_raw,
.flags = CON_PRINTBUFFER | CON_RAW,
#else
.flags = CON_PRINTBUFFER,
#endif
.index = -1, /* Specified on the cmdline (e.g. console=ttyPS ) */
.data = &cdns_uart_uart_driver,
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment