aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2015-03-09 16:27:16 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-26 11:17:55 -0400
commit0e3e143e5d1e7be65331cdf6d100b08bc6c15b72 (patch)
tree790b0276b7991bf2ff2218de7c81a45674bf0aa9
parentfeed5bab0d33feb5dbe5365b34d044c79f93dc6b (diff)
serial: 8250_early: Assume uart already initialized if no baud option
The <baud><parity><bit> option string is not supplied if the earlycon is started via devicetree and OF_EARLYCON_DECLARE(). The option string is also not required if started via kernel command line parameters of the form: earlycon=uart,mmio,<addr> console=uart,mmio,<addr> If earlycon_device->baud is 0, then an option string was not supplied. In this case, assume the uart has already been initialized by the bootloader or firmware. Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/8250/8250_early.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/tty/serial/8250/8250_early.c b/drivers/tty/serial/8250/8250_early.c
index d7b831bcf367..1701d00fd9f6 100644
--- a/drivers/tty/serial/8250/8250_early.c
+++ b/drivers/tty/serial/8250/8250_early.c
@@ -149,12 +149,18 @@ static int __init early_serial8250_setup(struct earlycon_device *device,
149 return 0; 149 return 0;
150 150
151 if (!device->baud) { 151 if (!device->baud) {
152 struct uart_port *port = &device->port;
153 unsigned int ier;
154
152 device->baud = probe_baud(&device->port); 155 device->baud = probe_baud(&device->port);
153 snprintf(device->options, sizeof(device->options), "%u", 156 snprintf(device->options, sizeof(device->options), "%u",
154 device->baud); 157 device->baud);
155 }
156 158
157 init_port(device); 159 /* assume the device was initialized, only mask interrupts */
160 ier = serial8250_early_in(port, UART_IER);
161 serial8250_early_out(port, UART_IER, ier & UART_IER_UUE);
162 } else
163 init_port(device);
158 164
159 device->con->write = early_serial8250_write; 165 device->con->write = early_serial8250_write;
160 return 0; 166 return 0;