[PATCH v2 1/9] bloblist: add API to check the register conventions
Ilias Apalodimas
ilias.apalodimas at linaro.org
Fri Dec 22 11:55:04 CET 2023
Hi Raymond,
On Thu, 21 Dec 2023 at 02:40, Raymond Mao <raymond.mao at linaro.org> wrote:
>
> Add bloblist_check_reg_conv() to check whether the bloblist is compliant
> to the register conventions defined in Firmware Handoff specification.
> This API can be used for all Arm platforms.
>
> Signed-off-by: Raymond Mao <raymond.mao at linaro.org>
> ---
> Changes in v2
> - Refactor of bloblist_check_reg_conv().
>
> common/bloblist.c | 13 +++++++++++++
> include/bloblist.h | 12 ++++++++++++
> 2 files changed, 25 insertions(+)
>
> diff --git a/common/bloblist.c b/common/bloblist.c
> index 625e480f6b..193122a8af 100644
> --- a/common/bloblist.c
> +++ b/common/bloblist.c
> @@ -542,3 +542,16 @@ int bloblist_maybe_init(void)
>
> return 0;
> }
> +
> +int bloblist_check_reg_conv(ulong rfdt, ulong rzero)
> +{
> + if (!IS_ENABLED(CONFIG_OF_BOARD))
> + return 0;
> +
> + if (rzero || rfdt != (ulong)bloblist_find(BLOBLISTT_CONTROL_FDT, 0)) {
> + gd->bloblist = NULL; /* Reset the gd bloblist pointer */
> + return -EIO;
> + }
> +
> + return 0;
> +}
The function looks correct, but the name is a bit off. There are no
registers conventions check AFAICT. We are just comparing 2 addresses.
Am I missing anything?
Thanks
/Ilias
> diff --git a/include/bloblist.h b/include/bloblist.h
> index 84fc943819..b5d0f147f6 100644
> --- a/include/bloblist.h
> +++ b/include/bloblist.h
> @@ -461,4 +461,16 @@ static inline int bloblist_maybe_init(void)
> }
> #endif /* BLOBLIST */
>
> +/**
> + * bloblist_check_reg_conv() - Check whether the bloblist is compliant to
> + * the register conventions according to the
> + * Firmware Handoff spec.
> + *
> + * @rfdt: Register that holds the FDT base address.
> + * @rzero: Register that must be zero.
> + * Return: 0 if OK, -EIO if the bloblist is not compliant to the register
> + * conventions.
> + */
> +int bloblist_check_reg_conv(ulong rfdt, ulong rzero);
> +
> #endif /* __BLOBLIST_H */
> --
> 2.25.1
>
More information about the U-Boot
mailing list