Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Enable Firmware Handoff in Qemu-Arm via bloblist #2

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from

Commits on Nov 9, 2023

  1. bloblist: Update the tag numbering

    Align bloblist tags with the FW handoff spec v0.9.
    The most common ones are from 0.
    TF related ones are from 0x100.
    All non-standard ones from 0xfff000.
    
    Signed-off-by: Simon Glass <sjg@chromium.org>
    Co-developed-by: Raymond Mao <raymond.mao@linaro.org>
    Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
    sjg20 authored and raymo200915 committed Nov 9, 2023
    Configuration menu
    Copy the full SHA
    fb11105 View commit details
    Browse the repository at this point in the history
  2. bloblist: Adjust API to align in powers of 2

    The updated bloblist structure stores the alignment as a power-of-two
    value in its structures. Adjust the API to use this, to avoid needing to
    calling ilog2().
    
    Drop a stale comment while we are here.
    
    Signed-off-by: Simon Glass <sjg@chromium.org>
    Co-developed-by: Raymond Mao <raymond.mao@linaro.org>
    Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
    sjg20 authored and raymo200915 committed Nov 9, 2023
    Configuration menu
    Copy the full SHA
    c0c351e View commit details
    Browse the repository at this point in the history

Commits on Nov 30, 2023

  1. bloblist: Change the magic value

    This uses a new value with spec v0.9 so change it.
    
    Signed-off-by: Simon Glass <sjg@chromium.org>
    Co-developed-by: Raymond Mao <raymond.mao@linaro.org>
    Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
    sjg20 authored and raymo200915 committed Nov 30, 2023
    Configuration menu
    Copy the full SHA
    7350dec View commit details
    Browse the repository at this point in the history
  2. bloblist: Set version to 1

    The new bloblist for v0.9 has version 1 so update this value.
    
    Signed-off-by: Simon Glass <sjg@chromium.org>
    Co-developed-by: Raymond Mao <raymond.mao@linaro.org>
    Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
    sjg20 authored and raymo200915 committed Nov 30, 2023
    Configuration menu
    Copy the full SHA
    9f62c0f View commit details
    Browse the repository at this point in the history
  3. bloblist: Access record hdr_size and tag via a function

    These values currently use a simple field. With spec v0.9 they have moved
    to a packed format. Convert most accesses to use functions, so this change
    can be accomodated.
    
    Signed-off-by: Simon Glass <sjg@chromium.org>
    sjg20 authored and raymo200915 committed Nov 30, 2023
    Configuration menu
    Copy the full SHA
    4ce3eac View commit details
    Browse the repository at this point in the history
  4. bloblist: Drop the flags value

    There is no flags value in spec v0.9 so drop it.
    
    For now it is still present in the header, with an underscore, so that
    tests continue to pass.
    
    Signed-off-by: Simon Glass <sjg@chromium.org>
    sjg20 authored and raymo200915 committed Nov 30, 2023
    Configuration menu
    Copy the full SHA
    e58b5f1 View commit details
    Browse the repository at this point in the history
  5. bloblist: Drop the spare values

    There are no spare values in spec v0.9 so drop them.
    
    For now they are still present in the headers, with an underscore, so that
    tests continue to pass.
    
    Signed-off-by: Simon Glass <sjg@chromium.org>
    sjg20 authored and raymo200915 committed Nov 30, 2023
    Configuration menu
    Copy the full SHA
    530eac5 View commit details
    Browse the repository at this point in the history
  6. bloblist: Change the checksum algorithm

    Use a sinple 8-bit checksum for bloblist, as specified by the spec
    version 0.9
    
    Signed-off-by: Simon Glass <sjg@chromium.org>
    sjg20 authored and raymo200915 committed Nov 30, 2023
    Configuration menu
    Copy the full SHA
    b8b8c8a View commit details
    Browse the repository at this point in the history
  7. bloblist: Checksum the entire bloblist

    Spec v0.9 specifies that the entire bloblist area is checksummed,
    including unused portions. Update the code to follow this.
    
    Signed-off-by: Simon Glass <sjg@chromium.org>
    sjg20 authored and raymo200915 committed Nov 30, 2023
    Configuration menu
    Copy the full SHA
    75a9e57 View commit details
    Browse the repository at this point in the history
  8. bloblist: Handle alignment with a void entry

    Rather than setting the alignment using the header size, add an entirely
    new entry to cover the gap left by the alignment.
    
    Signed-off-by: Simon Glass <sjg@chromium.org>
    sjg20 authored and raymo200915 committed Nov 30, 2023
    Configuration menu
    Copy the full SHA
    a9ef90b View commit details
    Browse the repository at this point in the history
  9. bloblist: Reduce blob-header size

    The v0.9 spec provides for an 8-byte header for each blob, with fewer
    fields.
    The blob data start address should be aligned with the alignment specified
    by the bloblist header.
    Update the implementation to match this.
    
    Signed-off-by: Simon Glass <sjg@chromium.org>
    Co-developed-by: Raymond Mao <raymond.mao@linaro.org>
    Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
    sjg20 authored and raymo200915 committed Nov 30, 2023
    Configuration menu
    Copy the full SHA
    f167683 View commit details
    Browse the repository at this point in the history
  10. bloblist: Reduce bloblist header size

    The v0.9 spec provides for a 16-byte header with fewer fields. Update
    the implementation to match this.
    
    This also adds an alignment field.
    
    Signed-off-by: Simon Glass <sjg@chromium.org>
    sjg20 authored and raymo200915 committed Nov 30, 2023
    Configuration menu
    Copy the full SHA
    fdc5b2c View commit details
    Browse the repository at this point in the history
  11. bloblist: Add alignment to bloblist_new()

    Allow the alignment to be specified when creating a bloblist.
    
    Signed-off-by: Simon Glass <sjg@chromium.org>
    sjg20 authored and raymo200915 committed Nov 30, 2023
    Configuration menu
    Copy the full SHA
    5028402 View commit details
    Browse the repository at this point in the history
  12. bloblist: Update documentation and header comment

    Align the documentation with the v0.9 spec.
    
    Signed-off-by: Simon Glass <sjg@chromium.org>
    sjg20 authored and raymo200915 committed Nov 30, 2023
    Configuration menu
    Copy the full SHA
    5726533 View commit details
    Browse the repository at this point in the history
  13. fdt: Allow the devicetree to come from a bloblist

    Standard passage provides for a bloblist to be passed from one firmware
    phase to the next. That can be used to pass the devicetree along as well.
    If CONFIG_OF_BOARD is defined, a board custom routine will provide a
    bloblist or a specified memory address to retrieve the devicetree at
    runtime.
    A devicetree from a bloblist is prioritized than the one from specified
    memory region.
    
    Tests for this will be added as part of the Universal Payload work.
    
    Signed-off-by: Simon Glass <sjg@chromium.org>
    Co-developed-by: Raymond Mao <raymond.mao@linaro.org>
    Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
    sjg20 authored and raymo200915 committed Nov 30, 2023
    Configuration menu
    Copy the full SHA
    11df09b View commit details
    Browse the repository at this point in the history
  14. bloblist: Align bloblist used_size and total_size to spec

    Align used_size and total_size of the bloblist header to the definition
    of the FW Handoff spec v0.9.
    Update the related bloblist APIs and UT testcases.
    
    Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
    raymo200915 committed Nov 30, 2023
    Configuration menu
    Copy the full SHA
    08a5943 View commit details
    Browse the repository at this point in the history
  15. qemu-arm: Get bloblist from boot arguments

    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@linaro.org>
    raymo200915 committed Nov 30, 2023
    Configuration menu
    Copy the full SHA
    2cf2039 View commit details
    Browse the repository at this point in the history
  16. bloblist: Load the bloblist from the previous loader

    During bloblist initialization, when CONFIG_OF_BOARD is defined,
    invoke the platform custom function to load the bloblist via boot
    arguments from the previous loader.
    If the bloblist exists, copy it into the fixed bloblist memory region.
    
    Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
    raymo200915 committed Nov 30, 2023
    Configuration menu
    Copy the full SHA
    b208eb8 View commit details
    Browse the repository at this point in the history
  17. bloblist: add flags to bloblist header

    Add flags to bloblist header to align to the FW handoff spec.
    
    Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
    raymo200915 committed Nov 30, 2023
    Configuration menu
    Copy the full SHA
    a52fe4f View commit details
    Browse the repository at this point in the history