28 Mar, 2020
1 commit
-
Sub-nodes of /reserved-memory may be disabled. In this case we should not
reserve memory in the memory map.Reported-by: Patrick DELAUNAY
Fixes: fef907b2e440 ("efi_loader: create reservations after
ft_board_setup")
Signed-off-by: Heinrich Schuchardt
Reviewed-by: Atish Patra
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
-
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
19 Feb, 2020
1 commit
-
In the function description use the correct parameter name.
Mention EFI_FDT_USE_INTERNAL.
Signed-off-by: Heinrich Schuchardt
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
08 Jan, 2020
5 commits
-
When be launch a binary via bootefi the bootargs environment variable is
used to set the load options in the loaded image protocol.Free memory allocated for load options when the UEFI binary exits.
Signed-off-by: Heinrich Schuchardt
-
Use a pointer to addressable memory instead of a "physical" address in the
virtual address space of the sandbox to efi_install_fdt().Export the efi_install_fdt() function.
Signed-off-by: Heinrich Schuchardt
-
Provide public function efi_run_imager() which can be used to run an UEFI
image from memory.Signed-off-by: Heinrich Schuchardt
-
If the bootefi command is called without passing the address of a device
tree, the internal device tree is used. For devices with a hardware device
tree it is preferable to used the hardware device tree in this case.Signed-off-by: Heinrich Schuchardt
-
As part of moving the parsing of command line arguments to do_bootefi()
call efi_install_fdt() with the address of the device tree instead of a
string.If the address is EFI_FDT_USE_INTERNAL (= 0), the internal device tree
is used.Signed-off-by: Heinrich Schuchardt
12 Aug, 2019
1 commit
-
Move env_get() over to the new header file.
Acked-by: Joe Hershberger
Signed-off-by: Simon Glass
17 Jul, 2019
2 commits
-
Describe efi_set_bootdev().
Change function descriptions to Sphinx style.
Signed-off-by: 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
13 May, 2019
2 commits
-
Describe that efi_install_fdt() defaults to using the device tree
indicated by environment variable fdtcontroladdr.ACPI tables and device trees are mutually exclusive.
Signed-off-by: Heinrich Schuchardt
-
Move duplicate initialization code to single instance.
Adjust comments of concerned functions.
Signed-off-by: Heinrich Schuchardt
08 May, 2019
1 commit
-
allow_unaligned(), switch_to_non_secure_mode(), and efi_init_obj_list() are
called in sequence in multiple places.Move calls to allow_unaligned() and switch_to_non_secure_mode() to
efi_init_obj_list().Remove unused includes.
Signed-off-by: Heinrich Schuchardt
03 May, 2019
2 commits
-
In case of a failure exit data may be passed to Exit() which in turn is
returned by StartImage().Let the `bootefi` command print the exit data string in case of an error.
Signed-off-by: Heinrich Schuchardt
-
UEFI variables should be installed using well-defined API.
Currently we don't support much, but the value of OsIndicationsSupported
will be updated once some features are added in the future.Signed-off-by: AKASHI Takahiro
Add comments. Rename a variable.
Reviewed-by: Heinrich Schuchardt
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
-
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 -
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 -
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 -
This is a preparatory patch for reworking do_bootefi() in later patch.
Signed-off-by: AKASHI Takahiro
Reviewed-by: Heinrich Schuchardt -
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 -
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
-
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 -
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
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
16 Feb, 2019
4 commits
-
Free resources upon failure.
Correct the function description.
As there is no need for any special address in the dummy memory device
path passed via the EFI_LOADED_IMAGE_PROTOCOL simply use 0 as address.Signed-off-by: Heinrich Schuchardt
-
`bootefi selftest` fails on qemu-x86_defconfig if efi_selftest() is not
invoked using EFI_CALL().Likewise we call the entry point of EFI payloads with
EFI_CALL(efi_start_image()).entry_count indicates if we are in U-Boot (1) or in EFI payload code (0).
As we start in U-Boot code the initial value has to be 1.Signed-off-by: Heinrich Schuchardt
-
Remove the duplicate code in efi_do_enter() and use efi_start_image() to
start the image invoked by the bootefi command.Signed-off-by: Heinrich Schuchardt
-
Up to now efi_load_pe() returns the entry point or NULL in case of an
error. This does not allow to return correct error codes from LoadImage().Let efi_load_pe() return a status code and fill in the entry point in the
corresponding field of the image object.Signed-off-by: Heinrich Schuchardt
13 Feb, 2019
4 commits
-
Refactor the switch from supervisor to hypervisor to a new function called
at the beginning of do_bootefi().Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
The function, efi_init_obj_list(), can be shared in different pseudo efi
applications, like bootefi/bootmgr as well as my efishell. Moreover, it
will be utilized to extend efi initialization, for example, my "removable
disk support" patch and "capsule-on-disk support" patch in the future.So with this patch, it will be moved to a new file, efi_setup.c, under
lib/efi_loader and exported, making no changes in functionality.Signed-off-by: AKASHI Takahiro
Remove lines deactivated by #if 1 #else
Reviewed-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
debug() support supports %p to print pointers.
The debug message is unique. So there is not need to write a possibly
distracting line number.Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf -
When calling efi_dp_from_mem() use a named constant for the memory type.
Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf
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 -
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 -
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 -
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