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

Raymond Mao raymond.mao at linaro.org
Mon Dec 4 21:06:34 CET 2023


Hi Simon

On Sat, 2 Dec 2023 at 16:16, Simon Glass <sjg at chromium.org> wrote:

> Hi Raymond,
>
> On Mon, 27 Nov 2023 at 12:53, Raymond Mao <raymond.mao at linaro.org> wrote:
> >
> > Add platform custom function to get bloblist from boot arguments.
>
> This should be the same for all ARM platforms. The ultimate goal is
> something like [1]
>
Yes, I agree. The current series just focuses on Qemu but ultimately
should be adapted
to all Arm platforms.

>  #include <common.h>
> > +#if IS_ENABLED(CONFIG_OF_BOARD) && IS_ENABLED(CONFIG_BLOBLIST)
> > +#include <bloblist.h>
> > +#endif
> >  #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)
>
> OF_BLOBLIST and please avoid #if
>
I will remove the build option for argument copying, as they don't
really depend on OF_BOARD
or _BLOBLIST.


> > +       /* Check the register conventions */
> > +       fdt = (unsigned long)bloblist_find(BLOBLISTT_CONTROL_FDT, 0);
>
> This should happen in fdtdec.c automatically. See [2]
>
The reason I have to call `bloblist_find()` here is to get the fdt address
and compare with
arg0 and arg2 (see below few lines of code) to check if it is compliant to
the register conventions
for AARCH64/32 defined by the FW Handoff spec.
This is better to be placed here instead of fdtdec.c

> +       if (IS_ENABLED(CONFIG_ARM64)) {
> > +               if (fdt != qemu_saved_args.arg0 || qemu_saved_args.arg2
> != 0)
> > +                       ret = -EIO;
> > +       } else {
> > +               if (fdt != qemu_saved_args.arg2 || qemu_saved_args.arg0
> != 0)
> > +                       ret = -EIO;
> > +       }
> > +
> > +       if (ret)
> > +               gd->bloblist = NULL;  /* Reset the gd bloblist pointer */
> > +       else
> > +               memmove((void *)addr,  (void *)qemu_saved_args.arg3,
> > +                       gd->bloblist->total_size);
> > +#endif
> > +
> > +       return ret;
> > +}
> > +
>
> Thanks and regards,
Raymond


More information about the U-Boot mailing list