earlycon: support aml-uart as the name for earlycon [1/1]
authorJiamin Ma <jiamin.ma@amlogic.com>
Thu, 11 Apr 2019 05:37:51 +0000 (13:37 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Wed, 17 Apr 2019 04:23:55 +0000 (21:23 -0700)
PD#SWPL-6969

Problem:
For some historical reason, aml-uart is configured as the earlycon
name in uboot, which is not recognized by 4.9 kernel

Solution:
support aml-uart as the name for earlycon

Verify:
Ampere

Change-Id: I53463ac6d27ff3e911aa675cd5d10d6cbf26ba05
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
drivers/amlogic/uart/meson_uart.c
include/linux/serial_core.h

index 20ccd01..3e1ee9f 100644 (file)
@@ -956,6 +956,7 @@ static int __init meson_early_console_setup(struct earlycon_device *device,
        return 0;
 }
 EARLYCON_DECLARE(aml_uart, meson_early_console_setup);
+EARLYCON_DECLARE_COMP(aml-uart, meson_early_console_setup);
 
 static struct console meson_serial_console = {
        .name = AML_UART_DEV_NAME,
index 42e3f06..082edc7 100644 (file)
@@ -375,6 +375,11 @@ extern const struct earlycon_id *__earlycon_table_end[];
 
 #define EARLYCON_DECLARE(_name, fn)    OF_EARLYCON_DECLARE(_name, "", fn)
 
+#ifdef CONFIG_AMLOGIC_MODIFY
+#define EARLYCON_DECLARE_COMP(_name, fn) \
+       _OF_EARLYCON_DECLARE(_name, "", fn, __LINE__ ## __COUNTER__)
+#endif
+
 extern int of_setup_earlycon(const struct earlycon_id *match,
                             unsigned long node,
                             const char *options);