mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM: Zynqmp: define cdns_serial_putc for use with pbl_set_putc
@ 2023-09-13 12:01 Ahmad Fatoum
  2023-09-14  7:44 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2023-09-13 12:01 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

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




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

* Re: [PATCH] ARM: Zynqmp: define cdns_serial_putc for use with pbl_set_putc
  2023-09-13 12:01 [PATCH] ARM: Zynqmp: define cdns_serial_putc for use with pbl_set_putc Ahmad Fatoum
@ 2023-09-14  7:44 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2023-09-14  7:44 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Wed, Sep 13, 2023 at 02:01:57PM +0200, Ahmad Fatoum wrote:
> 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(-)

Applied, thanks

Sascha

> 
> 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
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



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

end of thread, other threads:[~2023-09-14  7:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-13 12:01 [PATCH] ARM: Zynqmp: define cdns_serial_putc for use with pbl_set_putc Ahmad Fatoum
2023-09-14  7:44 ` Sascha Hauer

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