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 3/3] debug_ll: pl011: define PUTC_LL only when requested
Date: Mon, 01 Jun 2026 14:29:55 +0200	[thread overview]
Message-ID: <20260601-debug-ll-conflicts-v1-3-bf17f9f0e23a@pengutronix.de> (raw)
In-Reply-To: <20260601-debug-ll-conflicts-v1-0-bf17f9f0e23a@pengutronix.de>

pl011.h is mainly included from include/debug_ll.h to provide the
PUTC_LL() implementation. It is also included by some boards to get
debug_ll_pl011_putc(). If a board includes it and at the same time
DEBUG_LL is enabled for another board we end up with conflicting
definitions of PUTC_LL(). To prevent this add a #define DEFINE_PUTC_LL
to include/debug_ll.h. A debug_ll.h file now may only provide PUTC_LL()
when this define is set.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 include/debug_ll.h       | 2 ++
 include/debug_ll/pl011.h | 6 +-----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/include/debug_ll.h b/include/debug_ll.h
index 1410783b73..4cab96fbc4 100644
--- a/include/debug_ll.h
+++ b/include/debug_ll.h
@@ -19,7 +19,9 @@
  * this initialization. Depending on the PUTC_LL implementation the board might
  * also hang in PUTC_LL without proper initialization.
  */
+#define DEFINE_PUTC_LL
 #include <asm/debug_ll.h>
+#undef DEFINE_PUTC_LL
 #endif
 
 #if defined (CONFIG_DEBUG_LL)
diff --git a/include/debug_ll/pl011.h b/include/debug_ll/pl011.h
index aeec456f20..bded6720aa 100644
--- a/include/debug_ll/pl011.h
+++ b/include/debug_ll/pl011.h
@@ -16,11 +16,7 @@ static inline void debug_ll_pl011_putc(void __iomem *base, int c)
 	writel(c, base + UART01x_DR);
 }
 
-#ifdef CONFIG_DEBUG_LL
-
-#ifndef DEBUG_LL_UART_ADDR
-#error DEBUG_LL_UART_ADDR is undefined!
-#endif
+#if defined(CONFIG_DEBUG_LL) && defined(DEFINE_PUTC_LL)
 
 static inline void PUTC_LL(char c)
 {

-- 
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 ` [PATCH 2/3] debug_ll: Add Kconfig options for debug uarts that have none Sascha Hauer
2026-06-01 12:29 ` Sascha Hauer [this message]
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-3-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