diff options
author | Michal Simek <michal.simek@xilinx.com> | 2014-09-10 06:43:02 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-28 21:32:37 -0400 |
commit | 6fa62fc46e10f34aed70d2cfcf573ba8d3833e18 (patch) | |
tree | d1ba4c97c243a577b80e920a6873681eac817992 | |
parent | a4688bcd34bd2f4fe7fb88856c85d3091270ab53 (diff) |
serial: cadence: Add generic earlycon support
Add earlycon support for the cadence serial port.
This is based on recent patches:
"tty/serial: pl011: add generic earlycon support"
(sha1: 0d3c673e7881e691991b2a4745bd4f149603baa2)
"tty/serial: add arm/arm64 semihosting earlycon"
(sha1: d50d7269ebcb438afa346cdffce0f4e2a1b9e831)
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | Documentation/kernel-parameters.txt | 6 | ||||
-rw-r--r-- | drivers/tty/serial/Kconfig | 1 | ||||
-rw-r--r-- | drivers/tty/serial/xilinx_uartps.c | 19 |
3 files changed, 26 insertions, 0 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 10d51c2f10d7..adc1cd7c3bc7 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -921,6 +921,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
921 | 921 | ||
922 | earlycon= [KNL] Output early console device and options. | 922 | earlycon= [KNL] Output early console device and options. |
923 | 923 | ||
924 | cdns,<addr> | ||
925 | Start an early, polled-mode console on a cadence serial | ||
926 | port at the specified address. The cadence serial port | ||
927 | must already be setup and configured. Options are not | ||
928 | yet supported. | ||
929 | |||
924 | uart[8250],io,<addr>[,options] | 930 | uart[8250],io,<addr>[,options] |
925 | uart[8250],mmio,<addr>[,options] | 931 | uart[8250],mmio,<addr>[,options] |
926 | uart[8250],mmio32,<addr>[,options] | 932 | uart[8250],mmio32,<addr>[,options] |
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index 81f6ee7d4223..02a896f4dbcd 100644 --- a/drivers/tty/serial/Kconfig +++ b/drivers/tty/serial/Kconfig | |||
@@ -1429,6 +1429,7 @@ config SERIAL_XILINX_PS_UART_CONSOLE | |||
1429 | bool "Cadence UART console support" | 1429 | bool "Cadence UART console support" |
1430 | depends on SERIAL_XILINX_PS_UART=y | 1430 | depends on SERIAL_XILINX_PS_UART=y |
1431 | select SERIAL_CORE_CONSOLE | 1431 | select SERIAL_CORE_CONSOLE |
1432 | select SERIAL_EARLYCON | ||
1432 | help | 1433 | help |
1433 | Enable a Cadence UART port to be the system console. | 1434 | Enable a Cadence UART port to be the system console. |
1434 | 1435 | ||
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 7f8027f27ab9..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 | ||
1054 | static 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 | |||
1061 | static 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 | } | ||
1071 | EARLYCON_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 |