]> xenbits.xensource.com Git - people/julieng/linux-arm.git/commitdiff
arm64: avoid needing console= to enable serial console
authorMark Salter <msalter@redhat.com>
Wed, 25 Mar 2015 18:17:50 +0000 (14:17 -0400)
committerJulien Grall <julien.grall@citrix.com>
Fri, 18 Sep 2015 15:29:25 +0000 (16:29 +0100)
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>
arch/arm64/kernel/setup.c

index f3067d4d4e35711680376372395667efdc45ad07..6f8d814c4e5ced5200969162e556f339076140c5 100644 (file)
@@ -568,3 +568,22 @@ 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_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);