aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2014-06-12 12:52:44 -0500
committerAlex Shi <alex.shi@linaro.org>2014-08-29 19:48:45 +0800
commit2f56ce0e13c04d5342807755115fe842a1caa6c4 (patch)
treeecdd0c7cdeff0a3a4eb858b57fa91e7fcd8d5cf6
parent4d856c4e9fa9d9ce997e8482c8e878d157462f8c (diff)
downloadlinux-linaro-stable-v3.10/topic/earlycon.tar.gz
tty/serial: fix 8250 early console option passing to regular consolev3.10/topic/earlycon
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: Tony Luck <tony.luck@intel.com> Signed-off-by: Rob Herring <robh@kernel.org> Cc: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 60efcf0414be5876d81276e3c1fd12680ba2ce71) Signed-off-by: Alex Shi <alex.shi@linaro.org> (cherry picked from commit 5eb6ba4882c9c0b3b83486ab66b0c9e68189de4b) Signed-off-by: Alex Shi <alex.shi@linaro.org>
-rw-r--r--drivers/tty/serial/8250/8250_early.c5
-rw-r--r--drivers/tty/serial/earlycon.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/drivers/tty/serial/8250/8250_early.c b/drivers/tty/serial/8250/8250_early.c
index cfef801a49d4..4858b8a99d3b 100644
--- a/drivers/tty/serial/8250/8250_early.c
+++ b/drivers/tty/serial/8250/8250_early.c
@@ -144,8 +144,11 @@ static int __init early_serial8250_setup(struct earlycon_device *device,
if (!(device->port.membase || device->port.iobase))
return 0;
- if (!device->baud)
+ if (!device->baud) {
device->baud = probe_baud(&device->port);
+ snprintf(device->options, sizeof(device->options), "%u",
+ device->baud);
+ }
init_port(device);
diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
index 73bf1e21aae0..4f27f788ac6f 100644
--- a/drivers/tty/serial/earlycon.c
+++ b/drivers/tty/serial/earlycon.c
@@ -23,7 +23,7 @@
#include <asm/serial.h>
static struct console early_con = {
- .name = "earlycon",
+ .name = "uart", /* 8250 console switch requires this name */
.flags = CON_PRINTBUFFER | CON_BOOT,
.index = -1,
};