tty: serial: msm: Add DT based earlycon support
Add support for DT based early console on platforms with the msm serial hardware.
--- drivers/tty/serial/Kconfig | 1 + drivers/tty/serial/msm_serial.c | 72 ++++++++++++++++++++++++++++++++++------- 2 files changed, 61 insertions(+), 12 deletions(-)
drivers/tty/serial/Kconfig +1 -0
@@ -1051,6 +1051,7 @@ config SERIAL_MSM_CONSOLE bool "MSM serial console support" depends on SERIAL_MSM=y select SERIAL_CORE_CONSOLE + select SERIAL_EARLYCON config SERIAL_MSM_HS tristate "MSM UART High Speed: Serial Driver"
drivers/tty/serial/msm_serial.c +60 -12
108 lines not on this page · raw message
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
Rob Herring
Acked-byQuoted 5 lines · Stephen Boyd
Add support for DT based early console on platforms with the msm serial hardware.
Cc Rob Herring <[email protected]>Signed-off-by Stephen Boyd <[email protected]>
One comment, but looks good to me.
drivers/tty/serial/msm_serial.c static int __init msm_console_setup(struct console *co, char *options) · line 991
Quoted 11 lines
drivers/tty/serial/msm_serial.c +11
-0+static int __init +msm_serial_early_console_setup (struct earlycon_device *device,const char *opt) +{ +if (!device->port.membase) +return -ENODEV ; + + device->con->write = msm_serial_early_write; +return 0 ; +} +OF_EARLYCON_DECLARE (msm_serial,"qcom,msm-uart" , + msm_serial_early_console_setup);
Don't you want to support kernel command line as well? Then if you can't change the DT or bootloader's command line, you can add it into the kernel build with the appended command line. Don't forget to document it in kernel-parameters.txt if you do.
Rob
Quoted 9 lines · Rob Herring
Quoted 5 lines · Stephen Boyd
Add support for DT based early console on platforms with the msm serial hardware.
Cc Rob Herring <[email protected]>Signed-off-by Stephen Boyd <[email protected]>One comment, but looks good to me.
Acked-by Rob Herring <[email protected]>
Thanks.
Quoted 7 lines
Quoted 7 lines
(quoted diff) +7
-0+static int __init +msm_serial_early_console_setup(struct earlycon_device *device, const char *opt) +{ + if (!device->port.membase) + return -ENODEV; + + device->con->write = msm_serial_early_write;
Quoted 10 lines
Review
Quoted 4 lines
(quoted diff) +4
-0+ return 0; +} +OF_EARLYCON_DECLARE(msm_serial, "qcom,msm-uart", + msm_serial_early_console_setup);Don't you want to support kernel command line as well? Then if you can't change the DT or bootloader's command line, you can add it into the kernel build with the appended command line. Don't forget to document it in kernel-parameters.txt if you do.
Ok. Here's the interdiff. I'll send a v2.
---8<----
Documentation/kernel-parameters.txt +12 -0
@@ -936,6 +936,18 @@ bytes respectively. Such letter suffixes can also be entirely omitted. must already be setup and configured. Options are not yet supported. + msm_serial,<addr> + Start an early, polled-mode console on an msm serial + port at the specified address. The serial port + must already be setup and configured. Options are not + yet supported. + + msm_serial_dm,<addr> + Start an early, polled-mode console on an msm serial + dm port at the specified address. The serial port + must already be setup and configured. Options are not + yet supported. + smh Use ARM semihosting calls for early console. earlyprintk= [X86,SH,BLACKFIN,ARM,M68k]
drivers/tty/serial/msm_serial.c +2 -0
@@ -976,6 +976,7 @@ msm_serial_early_console_setup(struct earlycon_device *device, const char *opt) device->con->write = msm_serial_early_write;return 0 ; } +EARLYCON_DECLARE (msm_serial, msm_serial_early_console_setup);OF_EARLYCON_DECLARE (msm_serial,"qcom,msm-uart" , msm_serial_early_console_setup);
@@ -997,6 +998,7 @@ msm_serial_early_console_setup_dm(struct earlycon_device *device, device->con->write = msm_serial_early_write_dm;return 0 ; } +EARLYCON_DECLARE (msm_serial_dm, msm_serial_early_console_setup_dm);OF_EARLYCON_DECLARE (msm_serial_dm,"qcom,msm-uartdm" , msm_serial_early_console_setup_dm);
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation