summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2019-08-30efi_loader: efi_dp_from_file() expect UTF-8 pathHeinrich Schuchardt
Properly convert UTF-8 file names to UTF-16. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-21Merge tag 'efi-2019-07-rc5-3' of ↵Tom Rini
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'.
2019-06-21lib: Makefile: build fdtdec_common.c when OF_LIBFDT selectedPeng Fan
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>
2019-06-20efi_loader: fix typo in efi_variable.cHeinrich Schuchardt
%s/efi_efi_/efi_/ Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-20efi_loader: Delete() return EFI_WARN_DELETE_FAILUREHeinrich Schuchardt
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>
2019-06-20efi_loader: ListPackageLists() return EFI_NOT_FOUNDHeinrich Schuchardt
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>
2019-06-20efi_loader: console incorrectly advertised left logo keyHeinrich Schuchardt
Avoid to signal that the left logo key is pressed, when it is not. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-20efi_loader: alternative scan codes for F5, END, HOMEHeinrich Schuchardt
Depending on the key board alternative scan codes are used for F5, END, and HOME. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-20efi_loader: GOP: provide accurate mode informationHeinrich Schuchardt
For 5:6:5 modes provide correct frame buffer information. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-20efi_loader: SetMode() must blank screenHeinrich Schuchardt
EFI_GRAPHICS_OUTPUT_PROTOCOL.SetMode() must blank the screen. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-20efi_loader: system table setupHeinrich Schuchardt
When setting up the system table avoid superfluous void * conversions. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-20efi_loader: QueryMode() must allocate bufferHeinrich Schuchardt
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>
2019-06-20efi_loader: SetMode() parameters checkHeinrich Schuchardt
If EFI_GRAPHICS_OUTPUT_PROTOCOL.SetMode() is called with an invalid mode, return EFI_UNSUPPORTED. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-20efi_loader: QueryMode() check parametersHeinrich Schuchardt
Check the parameters of EFI_GRAPHICS_OUTPUT_PROTOCOL.QueryMode(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-20efi_loader: Blt() with incorrect BltOperationHeinrich Schuchardt
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>
2019-06-14efi_loader: fix SetAttribute()Heinrich Schuchardt
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>
2019-06-14efi_loader: fix SetMode()Heinrich Schuchardt
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>
2019-06-14efi_loader: GetTime() must return EFI_UNSUPPORTEDHeinrich Schuchardt
If the GetTime() runtime service is not supported, EFI_UNSUPPORTED has to be returned. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-14efi_loader: add RuntimeServicesSupported variableAKASHI Takahiro
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>
2019-06-14efi_loader: parameter checks SetVariable()Heinrich Schuchardt
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>
2019-06-14efi_loader: legal characters in StrToFat()Heinrich Schuchardt
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>
2019-06-14efi_loader: MetaiMatch() must be case insensitiveHeinrich Schuchardt
The MetaiMatch() service of the UnicodeCollationProtocol2 must be case insensitive. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-14efi_loader: AllocatePages() must accept addr == 0Heinrich Schuchardt
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>
2019-06-14efi_loader: correct ExitBootServices()Heinrich Schuchardt
Always use EFI_EXIT() to return from the function. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-14efi_loader: loaded images cannot be started twiceHeinrich Schuchardt
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>
2019-06-14efi_loader: LoadImage must return EFI_NOT_FOUNDHeinrich Schuchardt
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>
2019-06-14efi_loader: LoadImage w/o SourceBuffer and DevicePathHeinrich Schuchardt
If both SourceBuffer and DevicePath are NULL, LoadImage() must return EFI_INVALID_PARAMETER. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-12Merge tag 'efi-2019-07-rc5' of git://git.denx.de/u-boot-efiTom Rini
Pull request for UEFI sub-system for v2019.07-rc5 This pull request provides fixes for event services.
2019-06-10efi_loader: implement event queueHeinrich Schuchardt
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>
2019-06-10efi_selftest: correct event group testHeinrich Schuchardt
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>
2019-06-10efi_loader: event signaling in ExitBootServicesHeinrich Schuchardt
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>
2019-06-10efi_loader: SignalEvent for event in signaled stateHeinrich Schuchardt
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>
2019-06-10efi_loader: RegisterProtocolNotify event signalingHeinrich Schuchardt
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>
2019-06-08Merge branch 'master' of git://git.denx.de/u-boot-tegraTom Rini
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.
2019-06-07lib/vsprintf: allow printing upper case GUIDsHeinrich Schuchardt
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>
2019-06-05Merge tag 'efi-2019-07-rc4-2' of git://git.denx.de/u-boot-efiTom Rini
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.
2019-06-05lib: Implement strndup()Thierry Reding
Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
2019-06-05fdtdec: Add fdtdec_set_ethernet_mac_address()Thierry Reding
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>
2019-06-04efi_loader: bootmgr: make BootNext non-volatileAKASHI Takahiro
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-04efi_loader: variable: support non-volatile attributeAKASHI Takahiro
The attribute, EFI_VARIABLE_NON_VOLATILE, should be encoded as "nv" flag in U-Boot variable if specified. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-04efi_loader: notify memory map changesHeinrich Schuchardt
When the memory map is changed signal events of the EFI_EVENT_GROUP_MEMORY_MAP_CHANGE event group. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-04efi_loader: bootmgr: print a message when loading from BootNext failedAKASHI Takahiro
If a user defines BootNext but not BootOrder and loading from BootNext fails, you will see only a message like this: BootOrder not defined This may confuse a user. Adding an error message will be helpful. An example output looks like this: => efidebug boot add 0001 label1 scsi 0:1 "\path1\file1.efi" "--option foo" => efidebug boot add 0002 label2 scsi 0:1 "\path2\file2.efi" "--option bar" => efidebug boot add 0003 label3 scsi 0:1 "\path3\file3.efi" "--option no" => efidebug boot order 0001 0002 => efidebug boot next 0003 => bootefi bootmgr Loading from Boot0003 'label3' failed Loading from BootNext failed, falling back to BootOrder Loading from Boot0001 'label1' failed Loading from Boot0002 'label2' failed EFI boot manager: Cannot load any image Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Adjust messages. Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-04efi_loader: close protocols in UnloadImage()Heinrich Schuchardt
When UnloadImage() is called all protocols opened by the image have to be closed. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-04efi_loader: fix EnableCursor()Heinrich Schuchardt
The EnableCursor() service of the simple text output protocol must update the the CursorVisible field of the output mode. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-04efi_loader: check timer events in Stall()Heinrich Schuchardt
During a call to Stall() we should periodically check for timer events. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-04lib: time: export usec_to_tick()Heinrich Schuchardt
In the UEFI Stall() boottime service we need access to usec_to_tick(). Export the function. Remove redundant implementation in arch/arm/mach-rockchip/rk_timer.c. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-04efi_loader: DisconnectController() with no driverHeinrich Schuchardt
If DisconnectController() is called and no driver is managing ControllerHandle, return EFI_SUCCESS. UEFI SCT II 2017, 3.3.12 DisconnectController(), 5.1.3.12.4 - 5.1.3.12.6 Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-01efi_selftest: unit test for OpenProtocolInformation()Heinrich Schuchardt
Provide a unit test that checks that the open protocol information is correctly updated when opening and closing protocols. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-01efi_loader: CloseProtocol() fix open protocol informationHeinrich Schuchardt
CloseProtocol() must delete all open protocol information records relating to import parameters not only one. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-01efi_loader: open protocol informationHeinrich Schuchardt
When a protocol is opened the open protocol information must be updated. The key fields of the open protocol information records are ImageHandle, ControllerHandle, and Attributes. Consider the Attributes field when determining if an open protocol information record has to be updated or a new one has to be created. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>