2016-03-18 17:10:43 +00:00
|
|
|
From ce7a9e482dcf66d155e74b39ada1708cf6d9cb25 Mon Sep 17 00:00:00 2001
|
2015-03-26 11:49:10 +00:00
|
|
|
From: Mark Salter <msalter@redhat.com>
|
|
|
|
Date: Wed, 25 Mar 2015 14:17:50 -0400
|
2015-03-26 13:21:41 +00:00
|
|
|
Subject: [PATCH] arm64: avoid needing console= to enable serial console
|
2015-03-26 11:49:10 +00:00
|
|
|
|
|
|
|
Tell kernel to prefer one of the serial ports for console on
|
|
|
|
platforms currently supported (pl011 or 8250). console= on
|
|
|
|
command line will override these assumed preferences. This is
|
|
|
|
just a hack to get the behavior we want from DT provided by
|
|
|
|
firmware.
|
|
|
|
|
|
|
|
Signed-off-by: Mark Salter <msalter@redhat.com>
|
|
|
|
---
|
2016-03-18 17:10:43 +00:00
|
|
|
arch/arm64/kernel/setup.c | 20 ++++++++++++++++++++
|
|
|
|
1 file changed, 20 insertions(+)
|
2015-03-26 11:49:10 +00:00
|
|
|
|
|
|
|
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
|
2016-03-18 17:10:43 +00:00
|
|
|
index 9dc67769b6a4..dfac33b47423 100644
|
2015-03-26 11:49:10 +00:00
|
|
|
--- a/arch/arm64/kernel/setup.c
|
|
|
|
+++ b/arch/arm64/kernel/setup.c
|
2016-03-18 17:10:43 +00:00
|
|
|
@@ -417,3 +417,22 @@ static int __init register_kernel_offset_dumper(void)
|
2015-11-05 18:48:38 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2016-03-18 17:10:43 +00:00
|
|
|
__initcall(register_kernel_offset_dumper);
|
2015-03-26 11:49:10 +00:00
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * 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_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);
|
2015-11-05 18:48:38 +00:00
|
|
|
--
|
|
|
|
2.5.0
|
|
|
|
|