mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] debug_ll: pl011: add PBL console helper
@ 2026-01-12  8:56 Ahmad Fatoum
  2026-01-12  8:56 ` [PATCH 2/2] ARM: cpu: setupc: implement 32-bit relocate_to_adr_full Ahmad Fatoum
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2026-01-12  8:56 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

For use with pbl_set_putc, define a helper for PL011, like we already do
for NS16550.

Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
 include/debug_ll/pl011.h | 29 ++++++++++++++++++++---------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/include/debug_ll/pl011.h b/include/debug_ll/pl011.h
index 12f9ce1564c5..aeec456f2006 100644
--- a/include/debug_ll/pl011.h
+++ b/include/debug_ll/pl011.h
@@ -3,25 +3,36 @@
 #ifndef __INCLUDE_ARM_ASM_DEBUG_LL_PL011_H__
 #define __INCLUDE_ARM_ASM_DEBUG_LL_PL011_H__
 
+#include <io.h>
+#include <linux/amba/serial.h>
+
+static inline void debug_ll_pl011_putc(void __iomem *base, int c)
+{
+	/* Wait until there is space in the FIFO */
+	while (readl(base + UART01x_FR) & UART01x_FR_TXFF)
+		;
+
+	/* Send the character */
+	writel(c, base + UART01x_DR);
+}
+
+#ifdef CONFIG_DEBUG_LL
+
 #ifndef DEBUG_LL_UART_ADDR
 #error DEBUG_LL_UART_ADDR is undefined!
 #endif
 
-#include <io.h>
-#include <linux/amba/serial.h>
-
 static inline void PUTC_LL(char c)
 {
-	/* Wait until there is space in the FIFO */
-	while (readl(DEBUG_LL_UART_ADDR + UART01x_FR) & UART01x_FR_TXFF)
-		;
+	void __iomem *base = IOMEM(DEBUG_LL_UART_ADDR);
 
-	/* Send the character */
-	writel(c, DEBUG_LL_UART_ADDR + UART01x_DR);
+	debug_ll_pl011_putc(base, c);
 
 	/* Wait to make sure it hits the line, in case we die too soon. */
-	while (readl(DEBUG_LL_UART_ADDR + UART01x_FR) & UART01x_FR_TXFF)
+	while (readl(base + UART01x_FR) & UART01x_FR_TXFF)
 		;
 }
 
+#endif
+
 #endif /* __INCLUDE_ARM_ASM_DEBUG_LL_PL011_H__ */
-- 
2.47.3




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-01-12  8:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-12  8:56 [PATCH 1/2] debug_ll: pl011: add PBL console helper Ahmad Fatoum
2026-01-12  8:56 ` [PATCH 2/2] ARM: cpu: setupc: implement 32-bit relocate_to_adr_full Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox