- 24 May, 2019 2 commits
-
-
Heinrich Schuchardt authored
According to the UEFI spec 2.8 the GetTime() runtime service should return EFI_UNSUPPORTED if the real time clock is not available. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de>
-
Heinrich Schuchardt authored
Implement the SetTime() runtime service. Extend the real time clock selftest to check setting the clock. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de>
-
- 13 Feb, 2019 1 commit
-
-
Heinrich Schuchardt authored
The first parameter of efi_add_runtime_mmio() is a pointer to a pointer. This should be reflected in the documentation. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
- 23 Dec, 2018 1 commit
-
-
Alexander Graf authored
While changing the RTS alignment to 64KB in commit 7a82c305 ("efi_loader: Align runtime section to 64kb") the relocation code started to break. The reason for that is that we didn't actually look at the real relocation data. We merely took the RUNTIME_CODE section as a hint and started to relocate based on self calculated data from that point on. That calculation was now out of sync though. To ensure we're not running into such a situation again, this patch makes the runtime relocation code a bit more robust. We can just trust the phys/virt hints from the payload. We also should check that we really only have a single section, as the code doesn't handle multiple code relocations yet. Fixes: 7a82c305 ("efi_loader: Align runtime section to 64kb") Reported-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Reported-by:
Loic Devulder <ldevulder@suse.de> Signed-off-by:
Alexander Graf <agraf@suse.de> Reviewed-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Tested-by:
Loic Devulder <ldevulder@suse.de> Tested-by:
Jonathan Gray <jsg@jsg.id.au> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
- 02 Dec, 2018 4 commits
-
-
AKASHI Takahiro authored
See UEFI specification 2.7, section 8.4. Signed-off-by:
AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
AKASHI Takahiro authored
See UEFI specification v2.7, section 8.5.3. Signed-off-by:
AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Alexander Graf authored
With RELA absolute relocations, the relocation target contains our link offset which we need to remove from the equation again. We did this properly in the relative relocation path, but not in the absolute one. So let's do this for the absolute one as well. That way, u-boot can have a TEXT_OFFSET of != 0 and still relocate itself properly. This fixes a bug where efi_loader did not work on the RISC-V QEMU port. With this patch, I can successfully run UEFI applications on the RISC-V QEMU port. Reported-by:
Auer, Lukas <lukas.auer@aisec.fraunhofer.de> Signed-off-by:
Alexander Graf <agraf@suse.de> Tested-by:
Bin Meng <bmeng.cn@gmail.com> Tested-by:
Lukas Auer <lukas.auer@aisec.fraunhofer.de>
-
Heinrich Schuchardt authored
Allow an EFI application to shut down the system. If EFI_RESET_SHUTDOWN is issued call do_poweroff(). Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
- 16 Oct, 2018 1 commit
-
-
Heinrich Schuchardt authored
Currently the relocation of the EFI runtime on x86_64 fails. This renders the EFI subsystem unusable. The ELF relocation records for x86_64 contain an addend field. Always write the function name into error messages related to the EFI runtime relocation. Break an excessively long line. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Tested-by:
Bin Meng <bmeng.cn@gmail.com> Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
- 23 Sep, 2018 2 commits
-
-
Heinrich Schuchardt authored
Correct the description of efi_update_capsule(). Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Heinrich Schuchardt authored
Fix multiple typos Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
- 20 Aug, 2018 3 commits
-
-
Heinrich Schuchardt authored
Add comments for runtime service functions. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Heinrich Schuchardt authored
The crc32 of the runtime services table must be updated after detaching. efi_update_table_header_crc32() must be __efi_runtime. So move it to efi_runtime.c Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Heinrich Schuchardt authored
When applying a virtual memory map we have to update the pointer to the list of configuration tables. Fixes: 4182a129 ("efi_loader: allocate configuration table array") Reported-by:
Mark Kettenis <mark.kettenis@xs4all.nl> Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Tested-by:
Mark Kettenis <kettenis@openbsd.org> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
- 25 Jul, 2018 6 commits
-
-
Heinrich Schuchardt authored
Implement the missing parts of the GetTime() runtime service. Fill seconds. Fill daylight saving time flag correctly. Provide dummy values for capabilities. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Heinrich Schuchardt authored
Remove unused function efi_get_time_init(). Initialization of the RTC has to be done in board bring up not in the EFI subsystem. There is no RTC device in the UEFI spec. The RTC is only accessed through the runtime services. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Heinrich Schuchardt authored
The headersize field has to be set to the size of the whole table including the header. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Heinrich Schuchardt authored
Both in the boot and the runtime services tables we have to specify the UEFI spec revision. The same value is already used for the system table. So let's use a common constant. In the boot services table we have to provide the header signature. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Alexander Graf authored
Now that elf.h contains relocation defines for all architectures we care about, let's just include it unconditionally and refer to the defines. Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Alexander Graf authored
Thanks to CONFIG_SANDBOX, we can not rely on config options to tell us what CPU architecture we're running on. The compiler however does know that, so let's just move the ifdefs over to compiler based defines rather than kconfig based options. Signed-off-by:
Alexander Graf <agraf@suse.de>
-
- 14 Jun, 2018 1 commit
-
-
Simon Glass authored
These constants are defined in arch-specific code but redefined here. Add a TODO to clean this up. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
- 03 Jun, 2018 2 commits
-
-
Heinrich Schuchardt authored
The definitons of the variable services are adjusted: - use efi_uintn_t instead of unsigned long - use u16 * instead of s16 * for Unicode strings - correct definition of QueryVariableInfo - rename efi_get_next_variable to efi_get_next_variable_name Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Heinrich Schuchardt authored
asm/global_data.h is already included via common.h. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
- 29 May, 2018 2 commits
-
-
Rick Chen authored
We have almost all pieces needed to support RISC-V UEFI binaries in place already. The only missing piece are ELF relocations for runtime code and data. This patch adds respective support in the linker script and the runtime relocation code. It also allows users to enable the EFI_LOADER configuration switch on RISC-V platforms. Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Alexander Graf authored
We were using our EFI_CACHELINE_SIZE define only in the runtime service code, but left the image loader to use plain CONFIG_SYS_CACHELINE_SIZE. This patch moves EFI_CACHELINE_SIZE into efi_loader.h and converts the image loader to use it. Signed-off-by:
Alexander Graf <agraf@suse.de>
-
- 11 May, 2018 1 commit
-
-
Tom Rini authored
As part of the main conversion a few files were missed. These files had additional whitespace after the '*' and before the SPDX tag and my previous regex was too strict. This time I did a grep for all SPDX tags and then filtered out anything that matched the correct styles. Fixes: 83d290c5 ("SPDX: Convert all of our single license tags to Linux Kernel style") Reported-by:
Heinrich Schuchardt <xypron.debian@gmx.de> Signed-off-by:
Tom Rini <trini@konsulko.com>
-
- 04 Apr, 2018 5 commits
-
-
Alexander Graf authored
The efi_add_runtime_mmio function incorrectly returned the added address as return value rather than EFI_SUCCESS. Fix it by checking the return value of efi_add_memory_map properly. Fixes: f057cfef5dc ("efi_loader: exit status for efi_reset_system_init") Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Heinrich Schuchardt authored
EFI_RESET_PLATFORM_SPECIFIC is one of the values that can be used for the EFI service ResetSystem. The missing definition is added. The value has to handled in efi_reset_system(). Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Heinrich Schuchardt authored
If an event of a group event is signaled all other events of the same group are signaled too. Function efi_signal_event is renamed to efi_queue_event. A new function efi_signal_event is introduced that checks if an event belongs to a group and than signals all events of the group. Event group notifciation is implemented for ExitBootServices, InstallConfigurationTable, and ResetSystem. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Heinrich Schuchardt authored
All EFI initialization functions should return a status code. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Heinrich Schuchardt authored
efi_reset_system_init provides the architecture or board specific initialization of the EFI subsystem. Errors should be caught and signalled by a return code. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
- 09 Feb, 2018 1 commit
-
-
Heinrich Schuchardt authored
Add stubs for UpdateCapsule, QueryCapsuleCapabilities, and QueryVariableInfo. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
- 20 Sep, 2017 1 commit
-
-
Rob Clark authored
Add EFI variable support, mapping to u-boot environment variables. Variables are pretty important for setting up boot order, among other things. If the board supports saveenv, then it will be called in ExitBootServices() to persist variables set by the efi payload. (For example, fallback.efi configuring BootOrder and BootXXXX load-option variables.) Variables are *not* currently exposed at runtime, post ExitBootServices. On boards without a dedicated device for storage, which the loaded OS is not trying to also use, this is rather tricky. One idea, at least for boards that can persist RAM across reboot, is to keep a "journal" of modified variables in RAM, and then turn halt into a reboot into u-boot, plus store variables, plus halt. Whatever the solution, it likely involves some per-board support. Mapping between EFI variables and u-boot variables: efi_$guid_$varname = {attributes}(type)value For example: efi_8be4df61-93ca-11d2-aa0d-00e098032b8c_OsIndicationsSupported= "{ro,boot,run}(blob)0000000000000000" efi_8be4df61-93ca-11d2-aa0d-00e098032b8c_BootOrder= "(blob)00010000" The attributes are a comma separated list of these possible attributes: + ro - read-only + boot - boot-services access + run - runtime access NOTE: with current implementation, no variables are available after ExitBootServices, and all are persisted (if possible). If not specified, the attributes default to "{boot}". The required type is one of: + utf8 - raw utf8 string + blob - arbitrary length hex string Signed-off-by:
Rob Clark <robdclark@gmail.com> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
- 18 Sep, 2017 1 commit
-
-
Heinrich Schuchardt authored
We should use the predefined constants EFI_PAGE_SHIFT and EFI_PAGE_MASK where applicable. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
- 12 Aug, 2017 1 commit
-
-
Heinrich Schuchardt authored
We should be consistent in the way we calculate page sizes. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
- 19 Oct, 2016 2 commits
-
-
Alexander Graf authored
Compiler attributes are more commonly __foo style tags rather than big upper case eye sores like EFI_RUNTIME_TEXT. Simon Glass felt quite strongly about this, so this patch converts our existing defines over to more eye friendly ones. Signed-off-by:
Alexander Graf <agraf@suse.de> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Add the required pieces to support the EFI loader on x86. Since U-Boot only builds for 32-bit on x86, only a 32-bit EFI application is supported. If a 64-bit kernel must be booted, U-Boot supports this directly using FIT (see doc/uImage.FIT/kernel.its). U-Boot can act as a payload for both 32-bit and 64-bit EFI. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
- 18 Oct, 2016 1 commit
-
-
Alexander Graf authored
EFI allows an OS to leverage firmware drivers while the OS is running. In the generic code we so far had to stub those implementations out, because we would need board specific knowledge about MMIO setups for it. However, boards can easily implement those themselves. This patch provides the framework so that a board can implement its own versions of get_time and reset_system which would actually do something useful. While at it we also introduce a simple way for code to reserve MMIO pointers as runtime available. Signed-off-by:
Alexander Graf <agraf@suse.de>
-
- 06 Jun, 2016 1 commit
-
-
Alexander Graf authored
We introduced special "DEBUG_EFI" defines when the efi loader support was new. After giving it a bit of thought, turns out we really didn't have to - the normal #define DEBUG infrastructure works well enough for efi loader as well. So this patch switches to the common debug() and #define DEBUG way of printing debug information. Signed-off-by:
Alexander Graf <agraf@suse.de>
-
- 27 May, 2016 1 commit
-
-
Alexander Graf authored
We put the system table into our runtime services data section so that payloads may still access it after exit_boot_services. However, most fields in it are quite useless once we're in that state, so let's just patch them out. With this patch we don't get spurious warnings when running EFI binaries anymore. Signed-off-by:
Alexander Graf <agraf@suse.de>
-