mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM: add DEBUG_LL support for ARM64 QEMU Virt
@ 2023-01-30  6:45 Ahmad Fatoum
  2023-01-31  8:22 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2023-01-30  6:45 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

From: Ahmad Fatoum <a.fatoum@pengutronix.de>

We have DEBUG_LL for the PL011 on the ARM64 QEMU Virt,
but it is unused. Wire it in.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/Kconfig                |  1 +
 arch/arm/cpu/board-dt-2nd.c     |  2 ++
 arch/arm/include/asm/debug_ll.h | 11 +++++++++++
 common/Kconfig                  |  4 ++++
 4 files changed, 18 insertions(+)
 create mode 100644 arch/arm/include/asm/debug_ll.h

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 759b29ee77e1..8183f6d54686 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -292,6 +292,7 @@ config ARCH_ARM64_VIRT
 	select ARM_AMBA
 	select BOARD_ARM_VIRT
 	select HW_HAS_PCI
+	select HAS_ASM_DEBUG_LL
 
 endchoice
 
diff --git a/arch/arm/cpu/board-dt-2nd.c b/arch/arm/cpu/board-dt-2nd.c
index 6f4a6f26a8c7..6f69a6dd27a2 100644
--- a/arch/arm/cpu/board-dt-2nd.c
+++ b/arch/arm/cpu/board-dt-2nd.c
@@ -19,6 +19,8 @@ void dt_2nd_aarch64(void *fdt)
 {
 	unsigned long membase, memsize;
 
+	putc_ll('>');
+
 	/* entry point already set up stack */
 
 	arm_cpu_lowlevel_init();
diff --git a/arch/arm/include/asm/debug_ll.h b/arch/arm/include/asm/debug_ll.h
new file mode 100644
index 000000000000..d7b25a7fcab9
--- /dev/null
+++ b/arch/arm/include/asm/debug_ll.h
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef __ASM_DEBUG_LL_H__
+#define __ASM_DEBUG_LL_H__
+
+#ifdef CONFIG_DEBUG_QEMU_ARM64_VIRT
+#define DEBUG_LL_UART_ADDR		0x9000000
+#include <debug_ll/pl011.h>
+#endif
+
+#endif
diff --git a/common/Kconfig b/common/Kconfig
index 9e175d36c43e..d95797099341 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -1479,6 +1479,10 @@ config DEBUG_SUN20I
 	depends on SOC_ALLWINNER_SUN20I
 	select DEBUG_LL_NS16550
 
+config DEBUG_QEMU_ARM64_VIRT
+	bool "QEMU ARM64 Virt PL011 console"
+	depends on ARCH_ARM64_VIRT
+
 endchoice
 
 config DEBUG_LL_NS16550
-- 
2.38.1




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

* Re: [PATCH] ARM: add DEBUG_LL support for ARM64 QEMU Virt
  2023-01-30  6:45 [PATCH] ARM: add DEBUG_LL support for ARM64 QEMU Virt Ahmad Fatoum
@ 2023-01-31  8:22 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2023-01-31  8:22 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox, Ahmad Fatoum

On Mon, Jan 30, 2023 at 07:45:10AM +0100, Ahmad Fatoum wrote:
> From: Ahmad Fatoum <a.fatoum@pengutronix.de>
> 
> We have DEBUG_LL for the PL011 on the ARM64 QEMU Virt,
> but it is unused. Wire it in.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  arch/arm/Kconfig                |  1 +
>  arch/arm/cpu/board-dt-2nd.c     |  2 ++
>  arch/arm/include/asm/debug_ll.h | 11 +++++++++++
>  common/Kconfig                  |  4 ++++
>  4 files changed, 18 insertions(+)
>  create mode 100644 arch/arm/include/asm/debug_ll.h

Applied, thanks

Sascha

> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 759b29ee77e1..8183f6d54686 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -292,6 +292,7 @@ config ARCH_ARM64_VIRT
>  	select ARM_AMBA
>  	select BOARD_ARM_VIRT
>  	select HW_HAS_PCI
> +	select HAS_ASM_DEBUG_LL
>  
>  endchoice
>  
> diff --git a/arch/arm/cpu/board-dt-2nd.c b/arch/arm/cpu/board-dt-2nd.c
> index 6f4a6f26a8c7..6f69a6dd27a2 100644
> --- a/arch/arm/cpu/board-dt-2nd.c
> +++ b/arch/arm/cpu/board-dt-2nd.c
> @@ -19,6 +19,8 @@ void dt_2nd_aarch64(void *fdt)
>  {
>  	unsigned long membase, memsize;
>  
> +	putc_ll('>');
> +
>  	/* entry point already set up stack */
>  
>  	arm_cpu_lowlevel_init();
> diff --git a/arch/arm/include/asm/debug_ll.h b/arch/arm/include/asm/debug_ll.h
> new file mode 100644
> index 000000000000..d7b25a7fcab9
> --- /dev/null
> +++ b/arch/arm/include/asm/debug_ll.h
> @@ -0,0 +1,11 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +
> +#ifndef __ASM_DEBUG_LL_H__
> +#define __ASM_DEBUG_LL_H__
> +
> +#ifdef CONFIG_DEBUG_QEMU_ARM64_VIRT
> +#define DEBUG_LL_UART_ADDR		0x9000000
> +#include <debug_ll/pl011.h>
> +#endif
> +
> +#endif
> diff --git a/common/Kconfig b/common/Kconfig
> index 9e175d36c43e..d95797099341 100644
> --- a/common/Kconfig
> +++ b/common/Kconfig
> @@ -1479,6 +1479,10 @@ config DEBUG_SUN20I
>  	depends on SOC_ALLWINNER_SUN20I
>  	select DEBUG_LL_NS16550
>  
> +config DEBUG_QEMU_ARM64_VIRT
> +	bool "QEMU ARM64 Virt PL011 console"
> +	depends on ARCH_ARM64_VIRT
> +
>  endchoice
>  
>  config DEBUG_LL_NS16550
> -- 
> 2.38.1
> 
> 
> 

-- 
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-01-31  8:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-30  6:45 [PATCH] ARM: add DEBUG_LL support for ARM64 QEMU Virt Ahmad Fatoum
2023-01-31  8:22 ` Sascha Hauer

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