aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Salter <msalter@redhat.com>2014-09-30 17:19:24 -0400
committerGraeme Gregory <graeme.gregory@linaro.org>2014-11-06 12:00:52 +0000
commit428c2270712d18c636349ddeca1a611ed98e1b8f (patch)
tree8903649425ca1d878a02d57293479e763ed11e55
parent40b72576f3da38d62943f15ec187e3527602089c (diff)
downloadleg-kernel-428c2270712d18c636349ddeca1a611ed98e1b8f.tar.gz
arm64: avoid need for console= to enable serial console
Tell kernel to prefer one of the serial ports on platforms pl011, 8250, or sbsa uarts. console= on command line will override these assumed preferences. Signed-off-by: Mark Salter <msalter@redhat.com>
-rw-r--r--arch/arm64/kernel/setup.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index 070d99a88e18..335adb10de86 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -519,3 +519,25 @@ const struct seq_operations cpuinfo_op = {
.stop = c_stop,
.show = c_show
};
+
+/*
+ * Temporary hack to avoid need for console= on command line
+ */
+static int __init arm64_console_setup(void)
+{
+ /* Allow cmdline to override our assumed preferences */
+ if (console_set_on_cmdline)
+ return 0;
+
+ if (IS_ENABLED(CONFIG_SBSAUART_TTY))
+ add_preferred_console("ttySBSA", 0, "115200");
+
+ if (IS_ENABLED(CONFIG_SERIAL_AMBA_PL011))
+ add_preferred_console("ttyAMA", 0, "115200");
+
+ if (IS_ENABLED(CONFIG_SERIAL_8250))
+ add_preferred_console("ttyS", 0, "115200");
+
+ return 0;
+}
+early_initcall(arm64_console_setup);