On Wednesday 05 November 2014 20:32:57 al.stone@linaro.org wrote:
From: Mark Salter msalter@redhat.com
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
arch/arm64/kernel/setup.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 070d99a..335adb1 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);
I don't think this is a good idea. In DT, we have the 'stdout-path' property in the chosen node that points to the correct device to use, and this is already used by earlycon, so we should use the same one for the real console.
I would assume that ACPI also has a way to specify the preferred console in some table, so we should use that there.
Arnd