aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/xilinx_uartps.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/serial/xilinx_uartps.c')
-rw-r--r--drivers/tty/serial/xilinx_uartps.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index 806e4bcadbd7..200c1af2141b 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -1051,6 +1051,25 @@ static void cdns_uart_console_putchar(struct uart_port *port, int ch)
1051 cdns_uart_writel(ch, CDNS_UART_FIFO_OFFSET); 1051 cdns_uart_writel(ch, CDNS_UART_FIFO_OFFSET);
1052} 1052}
1053 1053
1054static void cdns_early_write(struct console *con, const char *s, unsigned n)
1055{
1056 struct earlycon_device *dev = con->data;
1057
1058 uart_console_write(&dev->port, s, n, cdns_uart_console_putchar);
1059}
1060
1061static int __init cdns_early_console_setup(struct earlycon_device *device,
1062 const char *opt)
1063{
1064 if (!device->port.membase)
1065 return -ENODEV;
1066
1067 device->con->write = cdns_early_write;
1068
1069 return 0;
1070}
1071EARLYCON_DECLARE(cdns, cdns_early_console_setup);
1072
1054/** 1073/**
1055 * cdns_uart_console_write - perform write operation 1074 * cdns_uart_console_write - perform write operation
1056 * @co: Console handle 1075 * @co: Console handle
@@ -1428,7 +1447,6 @@ static struct platform_driver cdns_uart_platform_driver = {
1428 .probe = cdns_uart_probe, 1447 .probe = cdns_uart_probe,
1429 .remove = cdns_uart_remove, 1448 .remove = cdns_uart_remove,
1430 .driver = { 1449 .driver = {
1431 .owner = THIS_MODULE,
1432 .name = CDNS_UART_NAME, 1450 .name = CDNS_UART_NAME,
1433 .of_match_table = cdns_uart_of_match, 1451 .of_match_table = cdns_uart_of_match,
1434 .pm = &cdns_uart_dev_pm_ops, 1452 .pm = &cdns_uart_dev_pm_ops,