[PATCH v2 17/18] qemu-arm: Get bloblist from boot arguments

Michal Simek michal.simek at amd.com
Mon Dec 4 08:54:36 CET 2023



On 11/27/23 20:50, Raymond Mao wrote:
> Add platform custom function to get bloblist from boot arguments.
> Check whether boot arguments aligns with the register conventions
> defined in FW Handoff spec v0.9.
> Add bloblist related options into qemu default config.
> 
> Signed-off-by: Raymond Mao <raymond.mao at linaro.org>
> ---
> Changes in v2
> - New patch file created for v2.
> 
>   board/emulation/qemu-arm/Makefile        |  1 +
>   board/emulation/qemu-arm/lowlevel_init.S | 19 +++++++++
>   board/emulation/qemu-arm/qemu-arm.c      | 54 ++++++++++++++++++++++++
>   configs/qemu_arm64_defconfig             |  3 ++
>   configs/qemu_arm_defconfig               |  3 ++
>   5 files changed, 80 insertions(+)
>   create mode 100644 board/emulation/qemu-arm/lowlevel_init.S
> 
> diff --git a/board/emulation/qemu-arm/Makefile b/board/emulation/qemu-arm/Makefile
> index a22d1237ff..12821e7083 100644
> --- a/board/emulation/qemu-arm/Makefile
> +++ b/board/emulation/qemu-arm/Makefile
> @@ -1,3 +1,4 @@
>   # SPDX-License-Identifier: GPL-2.0+
>   
>   obj-y	+= qemu-arm.o
> +obj-$(CONFIG_OF_BOARD)	+= lowlevel_init.o
> diff --git a/board/emulation/qemu-arm/lowlevel_init.S b/board/emulation/qemu-arm/lowlevel_init.S
> new file mode 100644
> index 0000000000..d72d7c938a
> --- /dev/null
> +++ b/board/emulation/qemu-arm/lowlevel_init.S
> @@ -0,0 +1,19 @@
> +/* SPDX-License-Identifier: BSD-2-Clause */
> +/*
> + * Copyright (c) 2023, Linaro Limited
> + */
> +
> +#include <config.h>
> +
> +.global save_boot_params
> +save_boot_params:
> +#ifdef CONFIG_ARM64
> +	adr x9, qemu_saved_args

Based on logic below this is available only when CONFIG_OF_BOARD is enabled.
Please look below.

> +	stp x0, x1, [x9]
> +	/* Increment the address by 16 bytes for the next pair of values */
> +	stp x2, x3, [x9, #16]
> +#else
> +	ldr r12, =qemu_saved_args
> +	stm r12, {r0, r1, r2, r3}
> +#endif
> +	b	save_boot_params_ret
> diff --git a/board/emulation/qemu-arm/qemu-arm.c b/board/emulation/qemu-arm/qemu-arm.c
> index 942f1fff57..a3892630d8 100644
> --- a/board/emulation/qemu-arm/qemu-arm.c
> +++ b/board/emulation/qemu-arm/qemu-arm.c
> @@ -4,6 +4,9 @@
>    */
>   
>   #include <common.h>
> +#if IS_ENABLED(CONFIG_OF_BOARD) && IS_ENABLED(CONFIG_BLOBLIST)
> +#include <bloblist.h>
> +#endif

you have dependency on OF_BOARD and BLOBLIST.

>   #include <cpu_func.h>
>   #include <dm.h>
>   #include <efi.h>
> @@ -102,6 +105,16 @@ static struct mm_region qemu_arm64_mem_map[] = {
>   struct mm_region *mem_map = qemu_arm64_mem_map;
>   #endif
>   
> +#if IS_ENABLED(CONFIG_OF_BOARD)

And here OF_BOARD.

Not all should be aligned but I don't think current #if


Thanks,
Michal


More information about the U-Boot mailing list