mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH master 3/4] ARM: k3: define debug_ll_write_reg only on CONFIG_DEBUG_AM62X_UART=y
Date: Tue, 22 Apr 2025 09:55:18 +0200	[thread overview]
Message-ID: <20250422075519.219029-3-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20250422075519.219029-1-a.fatoum@pengutronix.de>

From: Ahmad Fatoum <a.fatoum@barebox.org>

Defining debug_ll_read_reg unconditionally for K3 can clash with other
debug_ll implementations, so move it into the include guard.

Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
 include/mach/k3/debug_ll.h | 37 ++++++++++++++++++-------------------
 1 file changed, 18 insertions(+), 19 deletions(-)

diff --git a/include/mach/k3/debug_ll.h b/include/mach/k3/debug_ll.h
index 13321c61346f..0e479d2e7f2b 100644
--- a/include/mach/k3/debug_ll.h
+++ b/include/mach/k3/debug_ll.h
@@ -2,6 +2,20 @@
 #define __MACH_K3_DEBUG_LL_H__
 #include <io.h>
 
+#define AM62X_UART_UART0_BASE	0x02800000
+#define AM62X_UART_UART1_BASE	0x02810000
+#define AM62X_UART_UART2_BASE	0x02820000
+#define AM62X_UART_UART3_BASE	0x02830000
+#define AM62X_UART_UART4_BASE	0x02840000
+#define AM62X_UART_UART5_BASE	0x02850000
+#define AM62X_UART_UART6_BASE	0x02860000
+
+#if defined CONFIG_DEBUG_AM62X_UART
+#define K3_DEBUG_SOC AM62X_UART
+
+#define __K3_UART_BASE(soc, num) soc##_UART##num##_BASE
+#define K3_UART_BASE(soc, num) __K3_UART_BASE(soc, num)
+
 static inline uint8_t debug_ll_read_reg(void __iomem *base, int reg)
 {
 	return readb(base + (reg << 2));
@@ -22,25 +36,6 @@ static inline void k3_debug_ll_init(void __iomem *base)
 	debug_ll_write_reg(base, 8, 0x00);
 }
 
-#define AM62X_UART_UART0_BASE	0x02800000
-#define AM62X_UART_UART1_BASE	0x02810000
-#define AM62X_UART_UART2_BASE	0x02820000
-#define AM62X_UART_UART3_BASE	0x02830000
-#define AM62X_UART_UART4_BASE	0x02840000
-#define AM62X_UART_UART5_BASE	0x02850000
-#define AM62X_UART_UART6_BASE	0x02860000
-
-#if defined CONFIG_DEBUG_AM62X_UART
-#define K3_DEBUG_SOC AM62X_UART
-
-#define __K3_UART_BASE(soc, num) soc##_UART##num##_BASE
-#define K3_UART_BASE(soc, num) __K3_UART_BASE(soc, num)
-
-static inline void debug_ll_init(void)
-{
-	/* already configured */
-}
-
 static inline void PUTC_LL(int c)
 {
 	void __iomem *base = (void *)K3_UART_BASE(K3_DEBUG_SOC,
@@ -49,6 +44,10 @@ static inline void PUTC_LL(int c)
 	debug_ll_ns16550_putc(base, c);
 }
 
+#else
+static inline void k3_debug_ll_init(void __iomem *base)
+{
+}
 #endif
 
 #endif /* __MACH_K3_DEBUG_LL_H__ */
-- 
2.39.5




  parent reply	other threads:[~2025-04-22  8:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-22  7:55 [PATCH master 1/4] KASan: fix possible breakage with CONFIG_INIT_STACK_ALL Ahmad Fatoum
2025-04-22  7:55 ` [PATCH master 2/4] ARM: Layerscape: fix compilation of LS1028 without LS1046 Ahmad Fatoum
2025-04-22 14:14   ` Sascha Hauer
2025-04-22 14:18     ` Ahmad Fatoum
2025-04-22  7:55 ` Ahmad Fatoum [this message]
2025-04-22 14:23   ` [PATCH master 3/4] ARM: k3: define debug_ll_write_reg only on CONFIG_DEBUG_AM62X_UART=y Sascha Hauer
2025-04-22 14:29     ` Ahmad Fatoum
2025-04-22 14:34       ` Sascha Hauer
2025-04-22  7:55 ` [PATCH master 4/4] memory: correct return value in request_barebox_region stub Ahmad Fatoum
2025-04-22  9:29 ` [PATCH master 1/4] KASan: fix possible breakage with CONFIG_INIT_STACK_ALL 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=20250422075519.219029-3-a.fatoum@pengutronix.de \
    --to=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