mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: BAREBOX <barebox@lists.infradead.org>
Subject: [PATCH 2/3] debug_ll: Add Kconfig options for debug uarts that have none
Date: Mon, 01 Jun 2026 14:29:54 +0200	[thread overview]
Message-ID: <20260601-debug-ll-conflicts-v1-2-bf17f9f0e23a@pengutronix.de> (raw)
In-Reply-To: <20260601-debug-ll-conflicts-v1-0-bf17f9f0e23a@pengutronix.de>

Some SoCs include its debug_ll.h header file only by testing if
support for that SoC is compiled in. That doesn't work when barebox is
built for multiple SoCs as this leads to multiple definitions of
PUTC_LL.

Add a debug UART Kconfig option for all SoCs that do not yet have one.
The debug UART selection is a choice which makes sure only a single
debug UART is selected which also means we can include the SoC specific
debug_ll.h files using #if defined / elif defined.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/include/asm/debug_ll.h | 69 ++++++++++++++---------------------------
 common/Kconfig.debug_ll         | 28 +++++++++++++++++
 2 files changed, 52 insertions(+), 45 deletions(-)

diff --git a/arch/arm/include/asm/debug_ll.h b/arch/arm/include/asm/debug_ll.h
index fd7715c743..a645a6e910 100644
--- a/arch/arm/include/asm/debug_ll.h
+++ b/arch/arm/include/asm/debug_ll.h
@@ -3,66 +3,45 @@
 #ifndef __ASM_DEBUG_LL_H__
 #define __ASM_DEBUG_LL_H__
 
-#ifdef CONFIG_DEBUG_IMX_UART
+#if defined CONFIG_DEBUG_IMX_UART
 #include <mach/imx/debug_ll.h>
-#endif
-
-#ifdef CONFIG_DEBUG_ROCKCHIP_UART
+#elif defined CONFIG_DEBUG_ROCKCHIP_UART
 #include <mach/rockchip/debug_ll.h>
-#endif
-
-#ifdef CONFIG_DEBUG_OMAP_UART
+#elif defined CONFIG_DEBUG_OMAP_UART
 #include <mach/omap/debug_ll.h>
-#endif
-
-#ifdef CONFIG_DEBUG_ZYNQMP_UART
+#elif defined CONFIG_DEBUG_ZYNQMP_UART
 #include <mach/zynqmp/debug_ll.h>
-#endif
-
-#ifdef CONFIG_DEBUG_STM32MP_UART
+#elif defined CONFIG_DEBUG_STM32MP_UART
 #include <mach/stm32mp/debug_ll.h>
-#endif
-
-#if defined(CONFIG_DEBUG_VEXPRESS_UART) || \
-    defined(CONFIG_DEBUG_QEMU_ARM32_VIRT)
+#elif defined CONFIG_DEBUG_VEXPRESS_UART || defined CONFIG_DEBUG_QEMU_ARM32_VIRT
 #include <mach/vexpress/debug_ll.h>
-#endif
-
-#ifdef CONFIG_DEBUG_BCM283X_UART
+#elif defined CONFIG_DEBUG_BCM283X_UART
 #include <mach/bcm283x/debug_ll.h>
-#endif
-
-#ifdef CONFIG_DEBUG_LAYERSCAPE_UART
+#elif defined CONFIG_DEBUG_LAYERSCAPE_UART
 #include <mach/layerscape/debug_ll.h>
-#endif
-
-#ifdef CONFIG_DEBUG_SEMIHOSTING
+#elif defined CONFIG_DEBUG_SEMIHOSTING
 #include <debug_ll/semihosting.h>
-#endif
-
-#ifdef CONFIG_DEBUG_QEMU_ARM64_VIRT
+#elif defined CONFIG_DEBUG_AT91_UART
+#include <mach/at91/debug_ll.h>
+#elif defined CONFIG_DEBUG_QEMU_ARM64_VIRT
 #define DEBUG_LL_UART_ADDR		0x9000000
 #include <debug_ll/pl011.h>
-#elif defined CONFIG_ARCH_MVEBU
+#elif defined CONFIG_DEBUG_AM62X_UART
+#include <mach/k3/debug_ll.h>
+#elif defined CONFIG_DEBUG_MVEBU_UART
 #include <mach/mvebu/debug_ll.h>
-#elif defined CONFIG_ARCH_ZYNQ
-#include <mach/zynq/debug_ll.h>
-#elif defined CONFIG_ARCH_VERSATILE
+#elif defined CONFIG_DEBUG_CLPS711X_UART
+#include <mach/clps711x/debug_ll.h>
+#elif defined CONFIG_DEBUG_MXS_UART
+#include <mach/mxs/debug_ll.h>
+#elif defined CONFIG_DEBUG_VERSATILE_UART
 #include <mach/versatile/debug_ll.h>
-#elif defined CONFIG_ARCH_TEGRA
+#elif defined CONFIG_DEBUG_TEGRA_UART
 #include <mach/tegra/debug_ll.h>
-#elif defined CONFIG_ARCH_SOCFPGA
+#elif defined CONFIG_DEBUG_ZYNQ_UART
+#include <mach/zynq/debug_ll.h>
+#elif defined CONFIG_DEBUG_SOCFPGA_UART
 #include <mach/socfpga/debug_ll.h>
-#elif defined CONFIG_ARCH_PXA
-#include <mach/pxa/debug_ll.h>
-#elif defined CONFIG_ARCH_MXS
-#include <mach/mxs/debug_ll.h>
-#elif defined CONFIG_ARCH_CLPS711X
-#include <mach/clps711x/debug_ll.h>
-#elif defined CONFIG_ARCH_AT91
-#include <mach/at91/debug_ll.h>
-#elif defined CONFIG_ARCH_K3
-#include <mach/k3/debug_ll.h>
 #endif
 
 #endif
diff --git a/common/Kconfig.debug_ll b/common/Kconfig.debug_ll
index 715b1978f8..3f06e2eef4 100644
--- a/common/Kconfig.debug_ll
+++ b/common/Kconfig.debug_ll
@@ -312,6 +312,10 @@ config DEBUG_RPI4_MINI_UART
 	  Say Y here if you want low-level debugging support on
 	  RaspberryPi 4 board mini UART.
 
+config DEBUG_ZYNQ_UART
+	bool "Zynq debug UART"
+	depends on ARCH_ZYNQ
+
 config DEBUG_ZYNQMP_UART
 	bool "Zynqmp Debug UART"
 	depends on ARCH_ZYNQMP
@@ -390,6 +394,30 @@ config DEBUG_OPENRISC_NS16550
 	bool "OpenRISC NS16550 console"
 	depends on OPENRISC
 
+config DEBUG_MVEBU_UART
+	bool "mvebu console"
+	depends on ARCH_MVEBU
+
+config DEBUG_CLPS711X_UART
+	bool "CLPS711x debug UART"
+	depends on ARCH_CLPS711X
+
+config DEBUG_MXS_UART
+	bool "MXS debug UART"
+	depends on ARCH_MXS
+
+config DEBUG_VERSATILE_UART
+	bool "Versatile debug UART"
+	depends on ARCH_VERSATILE
+
+config DEBUG_TEGRA_UART
+	bool "Tegra debug UART"
+	depends on ARCH_TEGRA
+
+config DEBUG_SOCFPGA_UART
+	bool "SoCFPGA debug UART"
+	depends on ARCH_SOCFPGA
+
 endchoice
 
 config DEBUG_LL_NS16550

-- 
2.47.3




  parent reply	other threads:[~2026-06-01 12:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-01 12:29 [PATCH 0/3] debug_ll: Cleanup conflicts for multiple SoCs Sascha Hauer
2026-06-01 12:29 ` [PATCH 1/3] debug_ll: give PUTC_LL a common prototype Sascha Hauer
2026-06-01 12:29 ` Sascha Hauer [this message]
2026-06-01 12:29 ` [PATCH 3/3] debug_ll: pl011: define PUTC_LL only when requested Sascha Hauer
2026-06-04  5:55 ` [PATCH 0/3] debug_ll: Cleanup conflicts for multiple SoCs 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=20260601-debug-ll-conflicts-v1-2-bf17f9f0e23a@pengutronix.de \
    --to=s.hauer@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