mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] serial: omap: make Linux console name configurable
Date: Wed, 19 Mar 2025 11:22:28 +0100	[thread overview]
Message-ID: <20250319102228.2401563-1-s.hauer@pengutronix.de> (raw)

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. 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@pengutronix.de>
---
 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
+	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",
 };
 
-- 
2.39.5




             reply	other threads:[~2025-03-19 10:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-19 10:22 Sascha Hauer [this message]
2025-03-19 10:55 ` Ahmad Fatoum
2025-03-19 11:01   ` Sascha Hauer
2025-03-19 11:03     ` Ahmad Fatoum
2025-03-19 11:16       ` Sascha Hauer
2025-03-19 11:30         ` Ahmad Fatoum
2025-03-19 12:34 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250319102228.2401563-1-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox