[PATCH v2 00/18] Support Firmware Handoff spec via bloblist

Simon Glass sjg at chromium.org
Sat Dec 2 19:31:35 CET 2023


Hi Raymond,

On Mon, 27 Nov 2023 at 12:52, Raymond Mao <raymond.mao at linaro.org> wrote:
>
> Major changes:
>
> Update bloblist to align to Firmware Handoff spec v0.9
> (https://github.com/FirmwareHandoff/firmware_handoff).
>
> Implement Qemu-Arm platform custom functions to retrieve the bloblist
> (aka. Transfer List) from previous loader via boot arguments when
> CONFIG_OF_BOARD option is enabled.
>
> If a board provides both custom functions for getting the bloblist and
> the address of external FDT, the FDT inside the bloblist will be prioritized
> during FDT setup.
>
> The patch set is tested with previous done TF-A/OP-TEE patches through a
> complete Firmware Handoff cycle (BL2, BL31, BL32, BL33).
> TF-A Patches:
> feat(handoff): introduce firmware handoff library
> (https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/22215)
> feat(qemu): implement firmware handoff on qemu
> (https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/22178)
> feat(handoff): enhance transfer list library
> (https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/23776)
> feat(optee): enable transfer list in opteed
> (https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/23777)
> feat(qemu): enable transfer list to BL31/32
> (https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/23778)
> OP-TEE Patch:
> Firmware handoff
> (https://github.com/OP-TEE/optee_os/pull/6308)
> fixup of transfer list entry overriding
> (https://github.com/OP-TEE/optee_os/pull/6461)
>
> Raymond Mao (3):
>   bloblist: Align bloblist used_size and total_size to spec
>   qemu-arm: Get bloblist from boot arguments
>   bloblist: Load the bloblist from the previous loader
>
> Simon Glass (15):
>   bloblist: Update the tag numbering
>   bloblist: Adjust API to align in powers of 2
>   bloblist: Change the magic value
>   bloblist: Set version to 1
>   bloblist: Access record hdr_size and tag via a function
>   bloblist: Drop the flags value
>   bloblist: Drop the spare values
>   bloblist: Change the checksum algorithm
>   bloblist: Checksum the entire bloblist
>   bloblist: Handle alignment with a void entry
>   bloblist: Reduce blob-header size
>   bloblist: Reduce bloblist header size
>   bloblist: Add alignment to bloblist_new()
>   bloblist: Update documentation and header comment
>   fdt: Allow the devicetree to come from a bloblist
>
>  arch/x86/lib/tables.c                    |   3 +-
>  board/emulation/qemu-arm/Makefile        |   1 +
>  board/emulation/qemu-arm/lowlevel_init.S |  19 ++
>  board/emulation/qemu-arm/qemu-arm.c      |  54 ++++++
>  common/bloblist.c                        | 225 +++++++++++++----------
>  configs/qemu_arm64_defconfig             |   3 +
>  configs/qemu_arm_defconfig               |   3 +
>  doc/develop/bloblist.rst                 |   4 +-
>  doc/develop/devicetree/control.rst       |   8 +-
>  dts/Kconfig                              |   9 +-
>  include/bloblist.h                       | 181 ++++++++++--------
>  include/fdtdec.h                         |   3 +-
>  lib/fdtdec.c                             |  52 ++++--
>  test/bloblist.c                          |  86 ++++-----
>  14 files changed, 420 insertions(+), 231 deletions(-)
>  create mode 100644 board/emulation/qemu-arm/lowlevel_init.S
>
> --
> 2.25.1
>

Thank you for taking this on!

It is great to have a qemu test, but please do hook it into test/py so
that it runs in CI.

We should also have a sandbox test. With this series this fails:

/tmp/b/sandbox_spl/spl/u-boot-spl -d /tmp/b/sandbox_spl/u-boot.dtb -m ram.bin

A simple C test could be something that checks that the bloblist is
present, e.g. in test/bloblist.c :

static int bloblist_test_from_spl(struct unit_test_state *uts)
{
   if (!IS_ENABLED(SPL))
      return -EAGAIN;

   ut_assertnonnull(gd->bloblist);

   return 0;
}


Also you could add jwerner to this as he reviewed v1

Here is my cover letter in case it helps (at u-boot-dm/blob-working):

    Series-to: u-boot
    Series-cc: trini, Jose Marinho <jose.marinho at arm.com>
    Series-cc: Julius Werner <jwerner at chromium.org>, ilias,
    Series-cc: Dan Handley <dan.handley at arm.com >
    Cover-letter:
    bloblist: Align to firmware handoff
    In moving from v0.8 to v0.9 the Firmware Handoff specification made some
    changes, including:

       - Use a packed format for headers to reduce space
       - Add an explicit alignment field in the header
       - Renumber all the tags and reduce their size to 24 bits
       - Drop use of the blob header to specify alignment, in favour of a
         'void' blob type

    This series attempts to align to that specification, including updating
    the API and tests. It is likely that refinements will be made as other
    projects implement the spec too.

    As before the code is dual-licensed, to permit use in projects with a
    permissive license.
    END

Regards,
Simon


More information about the U-Boot mailing list