On Fri, Jun 05, 2020 at 04:43:21PM +0800, Fugang Duan wrote: > GKI kernel requires drivers built as modules including > console driver, so add the support that imx serial console > driver can be built as module. > > The changes of the patch: > - imx console driver can be built as module. > - move out earlycon code to separated driver like imx_earlycon.c, > and imx earlycon driver only support build-in. > > Signed-off-by: Fugang Duan <fugang.duan@xxxxxxx> > --- > drivers/tty/serial/Kconfig | 17 +++++++---- > drivers/tty/serial/Makefile | 1 + > drivers/tty/serial/imx.c | 37 ++--------------------- > drivers/tty/serial/imx_earlycon.c | 50 +++++++++++++++++++++++++++++++ > 4 files changed, 65 insertions(+), 40 deletions(-) > > diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig > index adf9e80e7dc9..890cbf214561 100644 > --- a/drivers/tty/serial/Kconfig > +++ b/drivers/tty/serial/Kconfig > @@ -502,20 +502,27 @@ config SERIAL_IMX > can enable its onboard serial port by enabling this option. > > config SERIAL_IMX_CONSOLE > - bool "Console on IMX serial port" > - depends on SERIAL_IMX=y > + tristate "Console on IMX serial port" > + depends on SERIAL_IMX > select SERIAL_CORE_CONSOLE > - select SERIAL_EARLYCON if OF > help > If you have enabled the serial port on the Freescale IMX > - CPU you can make it the console by answering Y to this option. > + CPU you can make it the console by answering Y/M to this option. > > - Even if you say Y here, the currently visible virtual console > + Even if you say Y/M here, the currently visible virtual console > (/dev/tty0) will still be used as the system console by default, but > you can alter that using a kernel command line option such as > "console=ttymxc0". (Try "man bootparam" or see the documentation of > your bootloader about how to pass options to the kernel at boot time.) > > +config SERIAL_IMX_EARLYCON > + bool "Earlycon on IMX serial port" > + depends OF > + select SERIAL_EARLYCON if OF > + help > + If you have enabled the earlycon on the Freescale IMX > + CPU you can make it the earlycon by answering Y to this option. > + Did you test this? I get the folllowing errors with this patch: scripts/kconfig/conf --oldconfig Kconfig drivers/tty/serial/Kconfig:521: syntax error drivers/tty/serial/Kconfig:520: invalid statement drivers/tty/serial/Kconfig:521: invalid statement drivers/tty/serial/Kconfig:522: invalid statement drivers/tty/serial/Kconfig:523: unknown statement "If" drivers/tty/serial/Kconfig:524:warning: ignoring unsupported character '.' drivers/tty/serial/Kconfig:524: unknown statement "CPU" make[1]: *** [scripts/kconfig/Makefile:71: oldconfig] Error 1 make: *** [Makefile:606: oldconfig] Error 2 I'll let you make the obvious fix and actually test it this time before resending :) thanks, greg k-h