summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* efi_loader: detach runtime in ExitBootServices()Heinrich Schuchardt2019-07-062-1/+4
| | | | | | | | | | | | | | | | Linux can be called with a command line parameter efi=novamap, cf. commit 4e46c2a95621 ("efi/arm/arm64: Allow SetVirtualAddressMap() to be omitted"). In this case SetVirtualAddressMap() is not called after ExitBootServices(). OpenBSD 32bit does not call SetVirtualAddressMap() either. Runtime services must be set to an implementation supported at runtime in ExitBootServices(). Reported-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Suggested-by: Alexander Graf <agraf@csgraf.de> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: simplify detachingHeinrich Schuchardt2019-07-061-32/+8
| | | | | | | We do not need any array typed detach list. Let's simply update the pointers directly. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: decision on EFI_RT_SUPPORTED_RESET_SYSTEMHeinrich Schuchardt2019-07-062-4/+7
| | | | | | Move the logic determining which board supports reset at runtime to Kconfig. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: split off detaching SetVirtualAddress()Heinrich Schuchardt2019-07-061-11/+58
| | | | | | | | | | | | | The runtime services SetVirtualAddress() and ConvertPointer() become unavailable after SetVirtualAddress(). Other runtime services become unavailable after ExitBootServices. Move the update of SetVirtualAddress() and ConvertPointer() to efi_relocate_runtime_table(). Use functions with the correct signature when detaching. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_selftest: test variable services at runtimeHeinrich Schuchardt2019-07-062-0/+95
| | | | | | | | | Provide a unit test for the variable services at runtime. Currently we expect EFI_UNSUPPORTED to be returned as the runtime implementation is still missing. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: unimplemented runtime servicesHeinrich Schuchardt2019-07-061-32/+2
| | | | | | | Unimplemented runtime services should always return EFI_UNSUPPORTED as described in the UEFI 2.8 spec. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: let the variable driver patch out the runtimeHeinrich Schuchardt2019-07-063-10/+46
| | | | | | | | | Our variable services are only provided at boottime. Therefore when leaving boottime the variable function are replaced by dummy functions returning EFI_UNSUPPORTED. Move this patching of the runtime table to the variable services implementation. Executed it in ExitBootServices(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: clean up runtime detachingHeinrich Schuchardt2019-07-061-23/+55
| | | | | | | | | | | The detaching of the runtime will have to move to ExitBootServices() to encompass operating system that do not call SetVirtualAddressMap(). This patch changes the logic for the relocation of the pointers in the runtime table such that the relocation becomes independent of the entries in the detach list. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: remove NULL entries from runtime detach listHeinrich Schuchardt2019-07-062-20/+9
| | | | | | | | | Some entries in the system table are set to NULL in ExitBootServices(). We had them in the runtime detach list to avoid relocation of NULL. Let's instead assign the pointers dynamically in efi_initialize_system_table() to avoid the relocation entry. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: initialization of variable servicesHeinrich Schuchardt2019-07-062-0/+15
| | | | | | Provide an initialization routine for variable services. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: move efi_query_variable_info()Heinrich Schuchardt2019-07-062-27/+27
| | | | | | | | Let's keep similar things together. Move efi_query_variable_info() to lib/efi_loader/efi_variable.c Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: remove superfluous spaces in commentsHeinrich Schuchardt2019-07-061-4/+4
| | | | | | Leave only a single space after * if not aligning. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_selftest: description of CMD_BOOTEFI_SELFTESTHeinrich Schuchardt2019-07-061-4/+4
| | | | | | | | | | The current short description has a typo. Let it stand out clear that we provide unit tests. Improve the description of the CMD_BOOTEFI_SELFTEST configuration option. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Alexander Graf <agraf@csgraf.de>
* Merge tag 'efi-2019-07-rc5-3' of ↵Tom Rini2019-06-217-86/+107
|\ | | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for UEFI sub-system for v2019.07-rc5 (3) This pull request provides error fixes for the graphical output protocol, the text output protocol, and the extended text input protocol. Setting the boot device for the bootefi command is now not only supported by the 'load' command but also for the file system specific commands like 'fatload'.
| * efi_loader: fix typo in efi_variable.cHeinrich Schuchardt2019-06-201-2/+2
| | | | | | | | | | | | %s/efi_efi_/efi_/ Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * efi_loader: Delete() return EFI_WARN_DELETE_FAILUREHeinrich Schuchardt2019-06-201-8/+2
| | | | | | | | | | | | | | If EFI_FILE_PROTOCOL.Delete() fails, always close the handle and return EFI_WARN_DELETE_FAILURE. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * efi_loader: ListPackageLists() return EFI_NOT_FOUNDHeinrich Schuchardt2019-06-201-35/+14
| | | | | | | | | | | | | | | | | | | | If no matching package list is found in ListPackageLists(), return EFI_NOT_FOUND. If we do not support a package type, we will not find a matching package list. Remove the unreachable EFI_PRINTF() statements. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * efi_loader: console incorrectly advertised left logo keyHeinrich Schuchardt2019-06-201-3/+1
| | | | | | | | | | | | Avoid to signal that the left logo key is pressed, when it is not. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * efi_loader: alternative scan codes for F5, END, HOMEHeinrich Schuchardt2019-06-201-8/+14
| | | | | | | | | | | | | | Depending on the key board alternative scan codes are used for F5, END, and HOME. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * efi_loader: GOP: provide accurate mode informationHeinrich Schuchardt2019-06-201-12/+12
| | | | | | | | | | | | For 5:6:5 modes provide correct frame buffer information. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * efi_loader: SetMode() must blank screenHeinrich Schuchardt2019-06-201-12/+38
| | | | | | | | | | | | EFI_GRAPHICS_OUTPUT_PROTOCOL.SetMode() must blank the screen. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * efi_loader: system table setupHeinrich Schuchardt2019-06-201-5/+5
| | | | | | | | | | | | When setting up the system table avoid superfluous void * conversions. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * efi_loader: QueryMode() must allocate bufferHeinrich Schuchardt2019-06-202-1/+10
| | | | | | | | | | | | | | | | | | EFI_GRAPHICS_OUTPUT_PROTOCOL.QueryMode() must allocate a buffer for the mode information structure. Adjust the unit test to free the buffer. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * efi_loader: SetMode() parameters checkHeinrich Schuchardt2019-06-201-3/+5
| | | | | | | | | | | | | | If EFI_GRAPHICS_OUTPUT_PROTOCOL.SetMode() is called with an invalid mode, return EFI_UNSUPPORTED. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * efi_loader: QueryMode() check parametersHeinrich Schuchardt2019-06-201-1/+8
| | | | | | | | | | | | Check the parameters of EFI_GRAPHICS_OUTPUT_PROTOCOL.QueryMode(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * efi_loader: Blt() with incorrect BltOperationHeinrich Schuchardt2019-06-201-1/+1
| | | | | | | | | | | | | | If EFI_GRAPHICS_OUTPUT_PROTOCOL.Blt() is called with an invalid value of BltOperation return EFI_INVALID_PARAMETER. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* | lib: Makefile: build fdtdec_common.c when OF_LIBFDT selectedPeng Fan2019-06-211-1/+1
|/ | | | | | | | | | | When build SPL_OF_PLATDATA on i.MX6, meet issue the fdtdec_get_int not defined, however fdtdec.c will use fdtdec_get_int, so let's compile fdtdec_common.c when OF_LIBFDT selected. Since there is also SPL_OF_LIBFDT, so need to use CONFIG_$(SPL_TPL_)OF_LIBFDT. Signed-off-by: Peng Fan <peng.fan@nxp.com>
* efi_loader: fix SetAttribute()Heinrich Schuchardt2019-06-141-0/+2
| | | | | | | The SetAttribute() service and the Reset() service of the simple text output protocol must update the attribute value in the mode information. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: fix SetMode()Heinrich Schuchardt2019-06-141-17/+14
| | | | | | | | | Correct the check of the mode number in SetMode() service of the simple text output protocol. Clear the screen in SetMode(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: GetTime() must return EFI_UNSUPPORTEDHeinrich Schuchardt2019-06-141-2/+1
| | | | | | | If the GetTime() runtime service is not supported, EFI_UNSUPPORTED has to be returned. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: add RuntimeServicesSupported variableAKASHI Takahiro2019-06-142-0/+29
| | | | | | | | | | | | This variable is defined in UEFI specification 2.8, section 8.1. Its value should be updated whenever we add any usable runtime services function. Currently we only support SetVirtualAddress() for all systems and ResetSystem() for some. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: parameter checks SetVariable()Heinrich Schuchardt2019-06-141-1/+3
| | | | | | | Return EFI_INVALID_PARAMETER if the variable name has zero length or the variable has runtime access but not boottime access. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: legal characters in StrToFat()Heinrich Schuchardt2019-06-141-2/+2
| | | | | | | | | | | The UEFI specification does not specify if the characters that have to be replaced by underscore in function StrToFat() of the Unicode collation protocol are those forbidden in FAT long names or those in FAT short names. EDK2 and UEFI SCT assume it is those forbidden in FAT 8.3 short names. Adjust the list of forbidden characters. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: MetaiMatch() must be case insensitiveHeinrich Schuchardt2019-06-141-24/+41
| | | | | | | The MetaiMatch() service of the UnicodeCollationProtocol2 must be case insensitive. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: AllocatePages() must accept addr == 0Heinrich Schuchardt2019-06-141-3/+3
| | | | | | | | It must be possible to allocate memory at address 0 with AllocatePages(). Move a NULL pointer check. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: correct ExitBootServices()Heinrich Schuchardt2019-06-141-5/+8
| | | | | | Always use EFI_EXIT() to return from the function. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: loaded images cannot be started twiceHeinrich Schuchardt2019-06-141-0/+3
| | | | | | | If an image already has been started, return EFI_INVALID_PARAMETER when StartImage() is called for the same handle again. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: LoadImage must return EFI_NOT_FOUNDHeinrich Schuchardt2019-06-141-1/+1
| | | | | | | If the file path does not relate to an existing file, LoadImage() must return EFI_NOT_FOUND. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: LoadImage w/o SourceBuffer and DevicePathHeinrich Schuchardt2019-06-141-11/+4
| | | | | | | If both SourceBuffer and DevicePath are NULL, LoadImage() must return EFI_INVALID_PARAMETER. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* Merge tag 'efi-2019-07-rc5' of git://git.denx.de/u-boot-efiTom Rini2019-06-125-49/+99
|\ | | | | | | | | | | Pull request for UEFI sub-system for v2019.07-rc5 This pull request provides fixes for event services.
| * efi_loader: implement event queueHeinrich Schuchardt2019-06-101-26/+68
| | | | | | | | | | | | | | | | | | | | | | Up to now we have only been using a flag queued for events. But this does not satisfy the requirements of the UEFI spec. Events must be notified in the sequence of decreasing TPL level and within a TPL level in the sequence of signaling. Implement a queue for signaled events. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * efi_selftest: correct event group testHeinrich Schuchardt2019-06-101-5/+4
| | | | | | | | | | | | | | If any member of the event group is signaled, all members must be set to signaled and their notification functions have to be queued. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * efi_loader: event signaling in ExitBootServicesHeinrich Schuchardt2019-06-104-22/+28
| | | | | | | | | | | | | | | | | | | | ExitBootServices() has to stop timer related activity before calling the events of the EFI_EVENT_GROUP_EXIT_BOOT_SERVICES event group. But our current implementation was stopping all other events. All events have to observe the task priority level. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * efi_loader: SignalEvent for event in signaled stateHeinrich Schuchardt2019-06-101-0/+2
| | | | | | | | | | | | | | If an event is already in the signaled state, SignalEvent should not queue the notification function but simply return EFI_SUCCESS. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * efi_loader: RegisterProtocolNotify event signalingHeinrich Schuchardt2019-06-101-0/+1
| | | | | | | | | | | | | | | | | | In a following patch efi_signal_event() will only queue an event if it is not signaled. Set the is_signaled status to false before signaling the event. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* | Merge branch 'master' of git://git.denx.de/u-boot-tegraTom Rini2019-06-082-0/+52
|\ \ | |/ |/| | | | | | | | | | | The bulk of these changes are an effort to unify Tegra186 builds with builds of prior 64-bit Tegra generations. On top of that there are various improvements that allow data (such as the MAC address and boot arguments) to be passed through from early firmware to the kernel on boot.
| * lib: Implement strndup()Thierry Reding2019-06-051-0/+23
| | | | | | | | | | Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
| * fdtdec: Add fdtdec_set_ethernet_mac_address()Thierry Reding2019-06-051-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This function can be used to set the local MAC address for the default Ethernet interface in its device tree node. The default interface is identified by the "ethernet" alias. One case where this is useful is for devices that store their MAC address in a custom location. Once extracted, board code can store the MAC address in U-Boot's control DTB so that it will automatically be used by the Ethernet uclass. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
* | lib/vsprintf: allow printing upper case GUIDsHeinrich Schuchardt2019-06-072-12/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the UEFI context GUIDs are expected to be rendered in upper case. The patch uses the formerly unused bit 1 of the parameter str_format of function uuid_bin_to_str() to indicate if we need upper or lower case output. Function uuid_string() in vsprint.c is adjusted to correctly set the bit depending on the print format code. %pUb: 01020304-0506-0708-090a-0b0c0d0e0f10 %pUB: 01020304-0506-0708-090A-0B0C0D0E0F10 %pUl: 04030201-0605-0807-090a-0b0c0d0e0f10 %pUL: 04030201-0605-0807-090A-0B0C0D0E0F10 Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is concerned by the change. Further patches are needed to adjust the UEFI subsystem. A unit test is provided inside the ut_print command. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* | Merge tag 'efi-2019-07-rc4-2' of git://git.denx.de/u-boot-efiTom Rini2019-06-056-10/+74
|\ \ | |/ |/| | | | | | | | | | | | | | | | | Pull request for UEFI sub-system for v2019.07-rc4-2 Support for managing the non-volatile attribute of UEFI variables is added though we do not have a backend for persistence yet. Error messages for changes of UEFI variables are provided. UEFI boottime service implementations are corrected.