28 Mar, 2020

1 commit


17 Mar, 2020

2 commits

  • Currently, bootefi only parses memory reservation block to setup
    EFI reserved memory mappings. However, it doesn't parse the
    reserved-memory[1] device tree node that also can contain the
    reserved memory regions.

    Add capability to parse reserved-memory node and update the EFI memory
    mappings accordingly.

    1. /doc/device-tree-bindings/reserved-memory/reserved-memory.txt]

    Signed-off-by: Atish Patra

    Fix an endless loop.

    The /reserved-memory node may have children without reg property. Remove
    a superfluous debug statement.

    Signed-off-by: Heinrich Schuchardt

    Atish Patra
     
  • Some memory reservations are made in ft_board_setup(). Ensure that we
    create reserved memory map entries after ft_board_setup().

    The downside of this patch is that if bootefi is called multiple times with
    an devicetree argument superfluous reservations for the old copies of the
    device tree will exist. But that is still better than missing a reservation.

    Deleting the superfluous reservations is not possible because reservations
    in the memory map are rounded to page size and may be coallesced.

    Signed-off-by: Heinrich Schuchardt

    Heinrich Schuchardt
     

19 Feb, 2020

1 commit


06 Feb, 2020

1 commit

  • At present dm/device.h includes the linux-compatible features. This
    requires including linux/compat.h which in turn includes a lot of headers.
    One of these is malloc.h which we thus end up including in every file in
    U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
    which needs to use the system malloc() in some files.

    Move the compatibility features into a separate header file.

    Signed-off-by: Simon Glass

    Simon Glass
     

08 Jan, 2020

5 commits


12 Aug, 2019

1 commit


17 Jul, 2019

2 commits

  • Describe efi_set_bootdev().

    Change function descriptions to Sphinx style.

    Signed-off-by: Heinrich Schuchardt

    Heinrich Schuchardt
     
  • We currently have some inconsistent use of efi_add_memory_map()
    throughout the code. In particular the return value of efi_add_memory_map()
    is not interpreted the same way by various users in the codebase.

    This patch does the following:

    - Changes efi_add_memory_map() to return efi_status_t.
    - Adds a method description to efi_add_memory_map().
    - Changes efi_add_memory_map() to return EFI_SUCCESS
    - Returns non-zero for error in efi_add_memory_map()
    - Updates efi_allocate_pages() to new efi_add_memory_map()
    - Updates efi_free_pages() to new efi_add_memory_map()
    - Updates efi_carve_out_dt_rsv() to new efi_add_memory_map()
    - Updates efi_add_runtime_mmio() to new efi_add_memory_map()

    Fixes: 5d00995c361c ("efi_loader: Implement memory allocation and map")
    Fixes: 74c16acce30b ("efi_loader: Don't allocate from memory holes")
    Suggested-by: Heinrich Schuchardt
    Cc: Alexander Graf
    Signed-off-by: Bryan O'Donoghue
    Reviewed-by: Heinrich Schuchardt

    Bryan O'Donoghue
     

13 May, 2019

2 commits


08 May, 2019

1 commit


03 May, 2019

2 commits


23 Apr, 2019

9 commits

  • The EBBR specification prescribes that we should have either an ACPI table
    or a device tree but not both. Let us enforce this condition in the
    `bootefi` command.

    If the bootefi command is called without a device tree parameter use a
    previously device tree or fall back to the internal device tree.

    The fdt unit test should not be run on boards with an ACPI table.

    Signed-off-by: Heinrich Schuchardt

    Heinrich Schuchardt
     
  • In the current implementation, bootefi command and EFI boot manager
    don't use load_image API, instead, use more primitive and internal
    functions. This will introduce duplicated code and potentially
    unknown bugs as well as inconsistent behaviours.

    With this patch, do_efibootmgr() and do_boot_efi() are completely
    overhauled and re-implemented using load_image API.

    Signed-off-by: AKASHI Takahiro

    Use efi_root as parent handle for the loaded image.
    LoadImage() should be called with BootPolicy = true by the boot manager.
    Avoid duplicate free_pool().
    Eliminate variable memdp which is not needed after anymore due to
    "efi_loader: correctly split device path of loaded image".

    Reviewed-by: Heinrich Schuchardt
    Signed-off-by: Heinrich Schuchardt

    AKASHI Takahiro
     
  • This is a preparatory patch for reworking do_bootefi() in later patch.
    All the non-boot-manager-based (that is, bootefi ) code is put
    into one function, do_bootefi_image().

    Signed-off-by: AKASHI Takahiro
    Reviewed-by: Heinrich Schuchardt

    AKASHI Takahiro
     
  • This is a preparatory patch for reworking do_bootefi() in later patch.
    do_bootmgr_exec() is renamed to do_efibootmgr() as we put all the necessary
    code into this function.

    Signed-off-by: AKASHI Takahiro
    Reviewed-by: Heinrich Schuchardt

    AKASHI Takahiro
     
  • This is a preparatory patch for reworking do_bootefi() in later patch.

    Signed-off-by: AKASHI Takahiro
    Reviewed-by: Heinrich Schuchardt

    AKASHI Takahiro
     
  • This is a preparatory patch for reworking do_bootefi() in later patch.

    Efi_selftest code is unusual in terms of execution path in do_bootefi(),
    which make that function complicated and hard to understand. With this
    patch, all efi_selftest related code will be put in a separate function.

    The change also includes expanding efi_run_prepare() and efi_run_finish()
    in do_bootefi_exec().

    Signed-off-by: AKASHI Takahiro
    Reviewed-by: Heinrich Schuchardt

    AKASHI Takahiro
     
  • This is a preparatory patch for reworking do_bootefi() in later patch.
    For simplicity, merge two functions.

    Signed-off-by: AKASHI Takahiro

    Return error code of efi_install_configuration_table() when aborting from
    efi_install_fdt().

    Reviewed-by: Heinrich Schuchardt

    AKASHI Takahiro
     
  • This is a preparatory patch for reworking do_bootefi() in later patch.

    Carve out a function to handle the installation of the device tree
    as a configuration table in system table.

    Signed-off-by: AKASHI Takahiro
    Reviewed-by: Heinrich Schuchardt

    AKASHI Takahiro
     
  • set_load_options() can fail, so it should return error code to stop
    invoking an image.
    In addition, set_load_options() now takes a handle, instead of
    loaded_image_info, to utilize efi_load_image() in a later patch.

    Signed-off-by: AKASHI Takahiro
    Reviewed-by: Heinrich Schuchardt

    AKASHI Takahiro
     

13 Apr, 2019

1 commit

  • Following Ard's suggestion:
    Runtime data sections are intended for data that is used by the runtime
    services implementation.
    Let's change the type to EFI_BOOT_SERVICES_DATA.

    This also fixes booting of armv7 using efi and fdtcontroladdr.

    Suggested-by: Ard Biesheuvel
    Signed-off-by: Ilias Apalodimas
    Acked-by: Ard Biesheuvel
    Reviewed-by: Heinrich Schuchardt

    Ilias Apalodimas
     

16 Feb, 2019

4 commits


13 Feb, 2019

4 commits


03 Dec, 2018

4 commits

  • When copying the device we must ensure that the copy does not fall into a
    memory area reserved by the same.

    So let's change the sequence: first create memory reservations and then
    copy the device tree.

    Signed-off-by: Heinrich Schuchardt
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     
  • The sandbox is using a virtual address space which is neither the physical
    address space of the operating system nor the virtual address space in
    which Linux aplications live. The addresses used insided the flattened
    device tree use this sandbox virtual address space. The EFI subsystem uses
    the virtual address space of the operating system and this is where the fdt
    is stored.

    Fix all incorrect addresses for the fdt in cmd/bootefi.cmd.

    Signed-off-by: Heinrich Schuchardt
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     
  • When allocating EFI memory pages the size in bytes has to be converted to
    pages.

    Provide a macro efi_size_in_pages() for this conversion.
    Use it in the EFI subsystem and correct related comments.

    Signed-off-by: Heinrich Schuchardt
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     
  • This function can be used from do_bootefi_exec() so that we use mostly the
    same code for a normal EFI application and an EFI test.

    Rename the function and use it in both places.

    Signed-off-by: Simon Glass
    Signed-off-by: Alexander Graf

    Simon Glass