[PATCH] serial: omap: make Linux console name configurable

Ahmad Fatoum a.fatoum at pengutronix.de
Wed Mar 19 03:55:53 PDT 2025


Hello Sascha,

On 3/19/25 11:22, Sascha Hauer wrote:
> Depending on the configuration Linux on OMAP SoCs either needs ttyO or
> ttyS as console name. We used to pass ttyO, but c1c0d18973
> ("serial: omap: Use ttyS as Linux console name") recently changed this
> to ttyS which breaks setups that used to work earlier. Make the
> name configurable to allow for setups requiring ttyS and use ttyO
> as default to keep existing setups working.
> 
> Note that with ti,am4372-uart we used to pass ttyO as well, but this
> specific compatible is only supported by the 8250 based driver which
> needs ttyS as console name. 

This reads as if 8250_omap supports only ttyS, but it has logic to
support ttyO as well.

> With this patch we always pass ttyS
> regardless of CONFIG_DRIVER_SERIAL_NS16550_OMAP_TTYS.
> 
> All new SoCs like the K3 SoCs are only supported by the 8250 based
> driver which needs ttyS. On these SoCs CONFIG_DRIVER_SERIAL_NS16550_OMAP_TTYS
> will also have no effect.
> 
> Fixes: c1c0d18973 ("serial: omap: Use ttyS as Linux console name")
> Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>

See also the comment below.


> ---
>  drivers/serial/Kconfig          | 12 ++++++++++++
>  drivers/serial/serial_ns16550.c |  4 ++++
>  2 files changed, 16 insertions(+)
> 
> diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
> index b7312ca796..6ac1d94526 100644
> --- a/drivers/serial/Kconfig
> +++ b/drivers/serial/Kconfig
> @@ -77,6 +77,18 @@ config DRIVER_SERIAL_NS16550
>  	help
>  	  Enable this to get support for NS16550 based serial devices
>  
> +config DRIVER_SERIAL_NS16550_OMAP_TTYS

default ARCH_K3 ?

> +	depends on ARCH_OMAP
> +	bool "Use ttyS as console name for TI OMAP/AMxxx SoCs"
> +	help
> +	  Linux has two different drivers for the TI OMAP/AMxxx serial ports. One is
> +	  based on the generic 8250 driver and activated with CONFIG_SERIAL_8250_OMAP.
> +	  This one uses ttyS as console name. When CONFIG_SERIAL_8250_OMAP_TTYO_FIXUP
> +	  is enabled, this driver takes ttyO as console name as well, but issues a warning
> +	  during boot. The other driver is activated with CONFIG_SERIAL_OMAP and takes ttyO
> +	  as console name. Say yes here to pass ttyS as console, otherwise ttyO will be
> +	  used.
> +
>  config DRIVER_SERIAL_ATMEL
>  	depends on ARCH_AT91
>  	default y
> diff --git a/drivers/serial/serial_ns16550.c b/drivers/serial/serial_ns16550.c
> index 56a1c6c6b9..6d4a4e8c7c 100644
> --- a/drivers/serial/serial_ns16550.c
> +++ b/drivers/serial/serial_ns16550.c
> @@ -402,7 +402,11 @@ static struct ns16550_drvdata ns16550_drvdata = {
>  
>  static __maybe_unused struct ns16550_drvdata omap_drvdata = {
>  	.init_port = ns16550_omap_init_port,
> +#ifdef CONFIG_DRIVER_SERIAL_NS16550_OMAP_TTYS
>  	.linux_console_name = "ttyS",
> +#else
> +	.linux_console_name = "ttyO",
> +#endif
>  	.linux_earlycon_name = "omap8250",
>  };
>  




More information about the barebox mailing list