mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] ARM: Zynqmp: define cdns_serial_putc for use with pbl_set_putc
Date: Wed, 13 Sep 2023 14:01:57 +0200	[thread overview]
Message-ID: <20230913120157.1859226-1-a.fatoum@pengutronix.de> (raw)

Unlike other debug_ll headers, such as i.MX's or AT91, the ZynqMP header
only defined PUTC_LL, but no function suitable for use with
pbl_set_putc.

Remedy that, so PBL entry points can benefit from CONFIG_PBL_CONSOLE.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 include/mach/zynqmp/debug_ll.h | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/include/mach/zynqmp/debug_ll.h b/include/mach/zynqmp/debug_ll.h
index 7642e37a4ed5..cc94d3ce54b4 100644
--- a/include/mach/zynqmp/debug_ll.h
+++ b/include/mach/zynqmp/debug_ll.h
@@ -15,9 +15,9 @@
 #define ZYNQMP_UART_STS_TFUL	(1 << 4)
 #define ZYNQMP_UART_TXDIS		(1 << 5)
 
-static inline void PUTC_LL(int c)
+static inline void cdns_serial_putc(void *ctx, int c)
 {
-	void __iomem *base = (void __iomem *)ZYNQMP_DEBUG_LL_UART_BASE;
+	void __iomem *base = ctx;
 
 	if (readl(base) & ZYNQMP_UART_TXDIS)
 		return;
@@ -28,4 +28,9 @@ static inline void PUTC_LL(int c)
 	writel(c, base + 0x30);
 }
 
+static inline void PUTC_LL(int c)
+{
+	cdns_serial_putc(IOMEM(ZYNQMP_DEBUG_LL_UART_BASE), c);
+}
+
 #endif /* __MACH_ZYNQMP_DEBUG_LL_H__ */
-- 
2.39.2




             reply	other threads:[~2023-09-13 12:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-13 12:01 Ahmad Fatoum [this message]
2023-09-14  7:44 ` 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=20230913120157.1859226-1-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