aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2014-12-18 12:47:12 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-09 17:10:46 -0500
commit00648d0282dcca1da453c0b20d27e24bf901a854 (patch)
tree4ddbba3cd0ef465d22b2cb58ab6535597aba6402 /drivers/tty
parent201d8975ae5ada760bf29edd837da039f494709a (diff)
tty: serial: 8250: omap: add ttySx console if the user didn't
This patch invokes add_preferred_console() with ttyS based on ttyO arguments if the user didn't specify it on its own. This ensures that the user will see the kernel booting on his serial console in case he forgot to update the command line. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/8250/8250_omap.c40
-rw-r--r--drivers/tty/serial/8250/Kconfig19
2 files changed, 59 insertions, 0 deletions
diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
index 96b69bfd773f..273f37c6b493 100644
--- a/drivers/tty/serial/8250/8250_omap.c
+++ b/drivers/tty/serial/8250/8250_omap.c
@@ -1248,6 +1248,46 @@ static int omap8250_runtime_resume(struct device *dev)
1248} 1248}
1249#endif 1249#endif
1250 1250
1251#ifdef CONFIG_SERIAL_8250_OMAP_TTYO_FIXUP
1252static int __init omap8250_console_fixup(void)
1253{
1254 char *omap_str;
1255 char *options;
1256 u8 idx;
1257
1258 if (strstr(boot_command_line, "console=ttyS"))
1259 /* user set a ttyS based name for the console */
1260 return 0;
1261
1262 omap_str = strstr(boot_command_line, "console=ttyO");
1263 if (!omap_str)
1264 /* user did not set ttyO based console, so we don't care */
1265 return 0;
1266
1267 omap_str += 12;
1268 if ('0' <= *omap_str && *omap_str <= '9')
1269 idx = *omap_str - '0';
1270 else
1271 return 0;
1272
1273 omap_str++;
1274 if (omap_str[0] == ',') {
1275 omap_str++;
1276 options = omap_str;
1277 } else {
1278 options = NULL;
1279 }
1280
1281 add_preferred_console("ttyS", idx, options);
1282 pr_err("WARNING: Your 'console=ttyO%d' has been replaced by 'ttyS%d'\n",
1283 idx, idx);
1284 pr_err("This ensures that you still see kernel messages. Please\n");
1285 pr_err("update your kernel commandline.\n");
1286 return 0;
1287}
1288console_initcall(omap8250_console_fixup);
1289#endif
1290
1251static const struct dev_pm_ops omap8250_dev_pm_ops = { 1291static const struct dev_pm_ops omap8250_dev_pm_ops = {
1252 SET_SYSTEM_SLEEP_PM_OPS(omap8250_suspend, omap8250_resume) 1292 SET_SYSTEM_SLEEP_PM_OPS(omap8250_suspend, omap8250_resume)
1253 SET_RUNTIME_PM_OPS(omap8250_runtime_suspend, 1293 SET_RUNTIME_PM_OPS(omap8250_runtime_suspend,
diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig
index 0fcbcd29502f..6f7f2d753def 100644
--- a/drivers/tty/serial/8250/Kconfig
+++ b/drivers/tty/serial/8250/Kconfig
@@ -308,6 +308,25 @@ config SERIAL_8250_OMAP
308 308
309 This driver uses ttyS instead of ttyO. 309 This driver uses ttyS instead of ttyO.
310 310
311config SERIAL_8250_OMAP_TTYO_FIXUP
312 bool "Replace ttyO with ttyS"
313 depends on SERIAL_8250_OMAP=y && SERIAL_8250_CONSOLE
314 default y
315 help
316 This option replaces the "console=ttyO" argument with the matching
317 ttyS argument if the user did not specified it on the command line.
318 This ensures that the user can see the kernel output during boot
319 which he wouldn't see otherwise. The getty has still to be configured
320 for ttyS instead of ttyO regardless of this option.
321 This option is intended for people who "automatically" enable this
322 driver without knowing that this driver requires a different console=
323 argument. If you read this, please keep this option disabled and
324 instead update your kernel command line. If you prepare a kernel for a
325 distribution or other kind of larger user base then you probably want
326 to keep this option enabled. Otherwise people might complain about a
327 not booting kernel because the serial console remains silent in case
328 they forgot to update the command line.
329
311config SERIAL_8250_FINTEK 330config SERIAL_8250_FINTEK
312 tristate "Support for Fintek F81216A LPC to 4 UART" 331 tristate "Support for Fintek F81216A LPC to 4 UART"
313 depends on SERIAL_8250 && PNP 332 depends on SERIAL_8250 && PNP