Commit 60efcf04 authored by Rob Herring's avatar Rob Herring Committed by Greg Kroah-Hartman

tty/serial: fix 8250 early console option passing to regular console

In the conversion to generic early console, the passing of options from
the early 8250 console to the regular ttyS console was broken. This
resulted in the baud rate changing when switching consoles during boot.

This feature allows specifying a single console option on the kernel
command line rather than both an early console and regular serial tty
console. It would be nice to generalize this feature. However, it only
works if the correct baud rate can be probed early which is not the
case on many platforms which have non-standard UART clock rates. So for
now, this is left as an 8250 specific feature.
Reported-and-tested-by: default avatarTony Luck <tony.luck@intel.com>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
Cc: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 66528f90
...@@ -144,8 +144,11 @@ static int __init early_serial8250_setup(struct earlycon_device *device, ...@@ -144,8 +144,11 @@ static int __init early_serial8250_setup(struct earlycon_device *device,
if (!(device->port.membase || device->port.iobase)) if (!(device->port.membase || device->port.iobase))
return 0; return 0;
if (!device->baud) if (!device->baud) {
device->baud = probe_baud(&device->port); device->baud = probe_baud(&device->port);
snprintf(device->options, sizeof(device->options), "%u",
device->baud);
}
init_port(device); init_port(device);
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include <asm/serial.h> #include <asm/serial.h>
static struct console early_con = { static struct console early_con = {
.name = "earlycon", .name = "uart", /* 8250 console switch requires this name */
.flags = CON_PRINTBUFFER | CON_BOOT, .flags = CON_PRINTBUFFER | CON_BOOT,
.index = -1, .index = -1,
}; };
......
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