summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* lib: Create a new Kconfig option for charset conversionSimon Glass2021-07-282-1/+9
| | | | | | | | | | Rather than looking at two KConfig options in the Makefile, create a new Kconfig option for compiling lib/charset.c Enable it for UFS also, which needs this support. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* lib: strto: add simple_strtoll functionRoland Gaudig2021-07-271-0/+8
| | | | | | | | Add simple_strtoll function for converting a string containing digits into a long long int value. Signed-off-by: Roland Gaudig <roland.gaudig@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* efi_loader: remove asm/setjmp.h from efi_api.hAKASHI Takahiro2021-07-241-0/+1
| | | | | | | | | | | | | | In the commit c982874e930d ("efi_loader: refactor efi_setup_loaded_image()"), setjmp-related definitions were moved to efi_loaded_image_obj in efi_loader.h. So setjmp.h is no longer refererenced in efi_api.h. This also fixes some error when efi_api.h will be included in mkeficapsule.c. Fixes: c982874e930d ("efi_loader: refactor efi_setup_loaded_image()") Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: capsule: remove authentication dataAKASHI Takahiro2021-07-241-13/+57
| | | | | | | | | | If capsule authentication is disabled and yet a capsule file is signed, its signature must be removed from image data to flush. Otherwise, the firmware will be corrupted after update. Fixes: 04be98bd6bcf ("efi: capsule: Add support for uefi capsule authentication") Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
* efi_loader: capsule: remove unused guidAKASHI Takahiro2021-07-241-3/+0
| | | | | | | | efi_guid_capsule_root_cert_guid is never used. Just remove it. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* smbios: error handling for invalid addressesHeinrich Schuchardt2021-07-242-8/+11
| | | | | | | | | | | SMBIOS tables only support 32bit addresses. If we don't have memory here handle the error gracefully: * on x86_64 fail to start U-Boot * during UEFI booting ignore the missing table Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* smbios: Fix calculating BIOS Release DatePali Rohár2021-07-241-0/+23
| | | | | | | | | | | | | | | | | | | | | | BIOS Release Date must be in format mm/dd/yyyy and must be release date. U-Boot currently sets BIOS Release Date from U_BOOT_DMI_DATE macro which is generated from current build timestamp. Fix this issue by setting U_BOOT_DMI_DATE macro to U-Boot version which is better approximation of U-Boot release date than current build timestamp. Current U-Boot versioning is in format yyyy.mm so as a day choose 01. Some operating systems are using BIOS Release Date for detecting when was SMBIOS table filled or if it could support some feature (e.g. BIOS from 1990 cannot support features invented in 2000). So this change also ensures that recompiling U-Boot from same sources but in different year does not change behavior of some operating systems. Macro U_BOOT_DMI_DATE is not used in other file than lib/smbios.c so remove it from global autogenerated files and also from Makefile. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* lib: wrap crypt API to hide errno usageSteffen Jaeckel2021-07-236-35/+74
| | | | | | | | | In order to prevent using the global errno, replace it with a static version and create a wrapper function which returns the error value. Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
* lib: add crypt subsystemSteffen Jaeckel2021-07-2310-0/+813
| | | | | | | | | | | | | | | | | Add the basic functionality required to support the standard crypt format. The files crypt-sha256.c and crypt-sha512.c originate from libxcrypt and their formatting is therefor retained. The integration is done via a crypt_compare() function in crypt.c. ``` libxcrypt $ git describe --long --always --all tags/v4.4.17-0-g6b110bc ``` Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
* efi_capsule: Move signature from DTB to .rodataIlias Apalodimas2021-07-184-3/+47
| | | | | | | | | | | | | | The capsule signature is now part of our DTB. This is problematic when a user is allowed to change/fixup that DTB from U-Boots command line since he can overwrite the signature as well. So Instead of adding the key on the DTB, embed it in the u-boot binary it self as part of it's .rodata. This assumes that the U-Boot binary we load is authenticated by a previous boot stage loader. Reviewed-by: Masami Hiramatsu <masami.hiramatsu@linaro.org> Tested-by: Masami Hiramatsu <masami.hiramatsu@linaro.org> Tested-by: Sughosh Ganu <sughosh.ganu@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
* efi_loader: increase eventlog buffer sizeMasahisa Kojima2021-07-181-1/+1
| | | | | | | | | TCG PC Client PFP spec says "The Log Area Minimum Length for the TCG event log MUST be at least 64KB." in ACPI chapter. This commit increase the buffer size to 64KB. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: Use %pD to log device-path instead of local efi_dp_str()Masami Hiramatsu2021-07-181-5/+1
| | | | | | | | | | Use %pD to log device-path instead of using efi_dp_str() and efi_free_pool() locally in find_boot_device(). This is a cleanup patch, no feature update nor fix. Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: set partition GUID in device path for SIG_TYPE_GUIDAlfonso Sánchez-Beato2021-07-182-2/+9
| | | | | | | | | | | Previously, the GPT device GUID was being used instead of the partition, which was incorrect. Signed-off-by: Alfonso Sánchez-Beato <alfonso.sanchez-beato@canonical.com> Let EFI_LOADER select CONFIG_PARTITION_UUIDS. Use log_warning() instead of printf() for warning. Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
* image: rsa: Move verification algorithm to a linker listAlexandru Gagniuc2021-07-161-0/+16
| | | | | | | | | | | | | Move the RSA verification crytpo_algo structure out of the crypto_algos array, and into a linker list. Although it appears we are adding an #ifdef to rsa-verify.c, the gains outweigh this small inconvenience. This is because rsa_verify() is defined differently based on #ifdefs. This change allows us to have a single definition of rsa_verify(). Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* image: Rename CONFIG_FIT_ENABLE_RSASSA_PSS_SUPPORTSimon Glass2021-07-162-3/+3
| | | | | | | | Drop the ENABLE and SUPPORT parts of this, which are redundant. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
* lib/vsprintf.c: remove unused ip6_addr_string()Rasmus Villemoes2021-07-151-1/+5
| | | | | | | | | | | | | | | | | | There's currently no user of %p[iI]6, so including ip6_addr_string() in the image is a waste of bytes. It's easy enough to have the compiler elide it without removing the code completely. The closest I can find to anybody "handling" ipv6 in U-Boot currently is in efi_net.c which does if (ipv6) { ret = EFI_UNSUPPORTED; As indicated in the comment, it can easily be put back, but preferably under a config knob. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
* lib/vsprintf.c: remove stale commentRasmus Villemoes2021-07-151-3/+0
| | | | | | | | U-Boot doesn't support %pS/%pF or any other kind of kallsyms-like lookups. Remove the comment. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
* lib/vsprintf.c: implement printf() in terms of vprintf()Rasmus Villemoes2021-07-151-12/+1
| | | | | | | | | This saves some code, both in terms of #LOC and .text size, and it is also the normal convention that foo(...) is implemented in terms of vfoo(). Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
* tpm: Check outgoing command sizeSimon Glass2021-07-151-0/+5
| | | | | | | | | In tpm_sendrecv_command() the command buffer is passed in. If a mistake is somehow made in setting this up, the size could be out of range. Add a sanity check for this. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Coverity (CID: 331152)
* lib: move rtc-lib.c to libHeinrich Schuchardt2021-07-142-0/+78
| | | | | | | | Function rtc_to_tm() is needed for FAT file system support even if we don't have a real time clock. So move it from drivers/ to lib/. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* efi_loader: Fix to set bootdev_root correctly if bootdev foundMasami Hiramatsu2021-07-121-1/+2
| | | | | | | | | | | Fix find_boot_device() to set bootdev_root if it finds the bootdev from BootNext. Currently it sets the bootdev_root only when it finds bootdev from BootOrder. Fixes: c74cd8bd08d1 ("efi_loader: capsule: add capsule_on_disk support") Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org> Accked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: set CapsuleLast after each capsuleHeinrich Schuchardt2021-07-121-12/+13
| | | | | | | | If multiple capsules are applied, the FMP drivers for the individual capsules can expect the value of CapsuleLast to be accurate. Hence CapsuleLast must be updated after each capsule. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: missing EFI_CALL() in set_capsule_resultHeinrich Schuchardt2021-07-121-5/+5
| | | | | | | efi_set_variable() should be called with EFI_CALL(). Use efi_set_variable_int() instead. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: rework messages for capsule updatesHeinrich Schuchardt2021-07-121-13/+15
| | | | | | | | * Use log category LOGC_EFI. This allows to remove 'EFI:' prefixes in messages. * Rephrase some of the messages. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: provide file attributes in EFI_FILE_PROTOCOL.Read()Heinrich Schuchardt2021-07-121-0/+15
| | | | | | | When reading a directory using EFI_FILE_PROTOCOL.Read() provide file attributes and timestamps. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* lib: remove superfluous #ifdefs from date.cHeinrich Schuchardt2021-07-121-6/+0
| | | | | | | We should avoid #ifdef in C modules. Unused functions are eliminated by the linker. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* Merge branch 'next'Tom Rini2021-07-056-153/+267
|\
| * Merge tag 'v2021.07-rc5' into nextTom Rini2021-06-285-5/+8
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prepare v2021.07-rc5 # gpg: Signature made Mon 28 Jun 2021 03:39:36 PM EDT # gpg: using RSA key 1A3C7F70E08FAB1707809BBF147C39FF9634B72C # gpg: Good signature from "Thomas Rini <trini@konsulko.com>" [ultimate] # Conflicts: # configs/am64x_evm_r5_defconfig
| * | lib: rational: copy the rational fraction lib routines from LinuxTero Kristo2021-06-113-0/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Copy the best rational approximation calculation routines from Linux. Typical usecase for these routines is to calculate the M/N divider values for PLLs to reach a specific clock rate. This is based on linux kernel commit: "lib/math/rational.c: fix possible incorrect result from rational fractions helper" (sha1: 323dd2c3ed0641f49e89b4e420f9eef5d3d5a881) Signed-off-by: Tero Kristo <t-kristo@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Tero Kristo <kristo@kernel.org>
| * | display_options: Split print_buffer() into two functionsSimon Glass2021-06-081-45/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | At present print_buffer() outputs a hex dump but it is not possible to place this dump in a string. Refactor it into a top-level function which does the printing and a utility function that dumps a line into a string. This makes the code more generally useful. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | hexdump: Allow ctrl-c to interrupt outputSimon Glass2021-06-081-4/+9
| | | | | | | | | | | | | | | | | | | | | If a long hexdump is initated the user may wish to interrupt it. Add support for this. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | hexdump: Support any rowsizeSimon Glass2021-06-081-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | At present print_hex_dump() only supports either 16- or 32-byte lines. With U-Boot we want to support any line length up to a maximum of 64. Update the function to support this, with 0 defaulting to 16, as with print_buffer(). Signed-off-by: Simon Glass <sjg@chromium.org>
| * | hexdump: Add support for sandboxSimon Glass2021-06-081-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation outputs an address as a pointer. Update the code to use an address instead, respecting the 32/64 nature of the CPU. Add some initial tests copied from print_test_display_buffer(), just the ones that can pass with the current implementation. Note that for this case print_hex_dump() and print_bufffer() produce the same result. For now the tests are duplicated sine we have separate functions. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | hexdump: Move API to header fileSimon Glass2021-06-081-75/+3
| | | | | | | | | | | | | | | | | | | | | | | | Move the comments to the header file so people can find the function info without digging in the implementation. Fix up the code style and add an enum for the first arg. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | display_options: Drop two spaces before the ASCII columnSimon Glass2021-06-081-1/+1
| | | | | | | | | | | | | | | | | | | | | At present with print_buffer() U-Boot shows four spaces between the hex and ASCII data. Two seems enough and matches print_hex_dump(). Change it. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | lmb: add lmb_dump_region() functionPatrick Delaunay2021-06-071-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add lmb_dump_region() function, to simplify lmb_dump_all_force(). This patch is based on Linux memblock dump function. An example of bdinfo output is: ..... fdt_size = 0x000146a0 FB base = 0xfdd00000 lmb_dump_all: memory.cnt = 0x1 memory[0] [0xc0000000-0xffffffff], 0x40000000 bytes flags: 0 reserved.cnt = 0x6 reserved[0] [0x10000000-0x10045fff], 0x00046000 bytes flags: 4 reserved[1] [0x30000000-0x3003ffff], 0x00040000 bytes flags: 4 reserved[2] [0x38000000-0x3800ffff], 0x00010000 bytes flags: 4 reserved[3] [0xe8000000-0xefffffff], 0x08000000 bytes flags: 4 reserved[4] [0xfbaea344-0xfdffffff], 0x02515cbc bytes flags: 0 reserved[5] [0xfe000000-0xffffffff], 0x02000000 bytes flags: 4 arch_number = 0x00000000 TLB addr = 0xfdff0000 .... Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | lmb: add lmb_is_reserved_flagsPatrick Delaunay2021-06-071-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new function lmb_is_reserved_flags to check if an address is reserved with a specific flags. This function can be used to check if an address was reserved with no-map flags with: lmb_is_reserved_flags(lmb, addr, LMB_NOMAP); Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
| * | lmb: Add support of flags for no-map propertiesPatrick Delaunay2021-06-071-9/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add "flags" in lmb_property to save the "no-map" property of reserved region and a new function lmb_reserve_flags() to check this flag. The default allocation use flags = LMB_NONE. The adjacent reserved memory region are merged only when they have the same flags value. This patch is partially based on flags support done in Linux kernel mm/memblock .c (previously lmb.c); it is why LMB_NOMAP = 0x4, it is aligned with MEMBLOCK_NOMAP value. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | | efi_loader: Allow capsule update on-disk without checking OsIndicationsIlias Apalodimas2021-07-022-8/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although U-Boot supports capsule update on-disk, it's lack of support for SetVariable at runtime prevents applications like fwupd from using it. In order to perform the capsule update on-disk the spec says that the OS must copy the capsule to the \EFI\UpdateCapsule directory and set a bit in the OsIndications variable. The firmware then checks for the EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED bit in OsIndications variable, which is set by the submitter to trigger processing of the capsule on the next reboot. Let's add a config option which ignores the bit and just relies on the capsule being present. Since U-Boot deletes the capsule while processing it, we won't end up applying it multiple times. Note that this is allowed for all capsules. In the future, once authenticated capsules are fully supported, we can limit the functionality to those only. Signed-off-by: apalos <ilias.apalodimas@linaro.org> Reword Kconfig description. Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* | | efi_loader: clear OsIndicationsHeinrich Schuchardt2021-07-021-1/+39
| | | | | | | | | | | | | | | | | | | | | | | | After each reboot we must clear flag EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED in variable OsIndications. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* | | efi_loader: Improve the parameter check for QueryVariableInfo()Masami Hiramatsu2021-07-021-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve efi_query_variable_info() to check the parameter settings and return correct error code according to the UEFI Specification 2.9, and the Self Certification Test (SCT) II Case Specification, June 2017, chapter 4.1.4 QueryVariableInfo(). Reported-by: Kazuhiko Sakamoto <sakamoto.kazuhiko@socionext.com> Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* | | efi_loader: missing parentheses in query_console_sizeHeinrich Schuchardt2021-07-021-1/+1
| | | | | | | | | | | | | | | | | | | | | After if we should use parentheses to keep the code readable. Fixes: a95f4c885991 ("efi_loader: NULL dereference in EFI console") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* | | efi_loader: Always install FMPsIlias Apalodimas2021-07-022-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We only install FMPs if a CapsuleUpdate is requested. Since we now have an ESRT table which relies on FMPs to build the required information, it makes more sense to unconditionally install them. This will allow userspace applications (e.g fwupd) to make use of the ERST and provide us with files we can use to run CapsuleUpdate on-disk Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* | | efi_loader: Force a single FMP instance per hardware storeIlias Apalodimas2021-07-021-23/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Chapter 23 of the EFI spec (rev 2.9) says: "A specific updatable hardware firmware store must be represented by exactly one FMP instance". This is not the case for us, since both of our FMP protocols can be installed at the same time because they are controlled by a single 'dfu_alt_info' env variable. So make the config options depend on each other and allow the user to install one of them at any given time. If we fix the meta-data provided by the 'dfu_alt_info' in the future, to hint about the capsule type (fit or raw) we can revise this and enable both FMPs to be installed, as long as they target different firmware hardware stores Note that we are not using a Kconfig 'choice' on purpose, since we want to allow both of those to be installed and tested in sandbox Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* | | efi: Fix to use null handle to create new handle for efi_fmp_rawMasami Hiramatsu2021-07-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When running the efidebug capsule disk-update command, the efi_fmp_raw protocol installation fails with 2 (EFI_INVALID_PARAMETER) as below. This is because the code passes efi_root instead of the handle local var. => efidebug capsule disk-update EFI: Call: efi_install_multiple_protocol_interfaces( &handle, &efi_guid_firmware_management_protocol, &efi_fmp_fit, NULL) EFI: Entry efi_install_multiple_protocol_interfaces(00000000fbaf5988) EFI: Call: efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) EFI: Entry efi_install_protocol_interface(00000000fbaf5988, 86c77a67-0b97-4633-a187-49104d0685c7, 0, 00000000fbfa6ee8) EFI: new handle 00000000fbb37520 EFI: Exit: efi_install_protocol_interface: 0 EFI: 0 returned by efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) EFI: Exit: efi_install_multiple_protocol_interfaces: 0 EFI: 0 returned by efi_install_multiple_protocol_interfaces( &handle, &efi_guid_firmware_management_protocol, &efi_fmp_fit, NULL) EFI: Call: efi_install_multiple_protocol_interfaces( &efi_root, &efi_guid_firmware_management_protocol, &efi_fmp_raw, NULL) EFI: Entry efi_install_multiple_protocol_interfaces(00000000fbfec648) EFI: Call: efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) EFI: Entry efi_install_protocol_interface(00000000fbfec648, 86c77a67-0b97-4633-a187-49104d0685c7, 0, 00000000fbfa6f18) EFI: handle 00000000fbaf8520 EFI: Exit: efi_install_protocol_interface: 2 EFI: 2 returned by efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) EFI: Exit: efi_install_multiple_protocol_interfaces: 2 EFI: 2 returned by efi_install_multiple_protocol_interfaces( &efi_root, &efi_guid_firmware_management_protocol, &efi_fmp_raw, NULL) Command failed, result=1 To fix this issue, pass the handle local var which is set NULL right before installing efi_fmp_raw as same as the installing efi_fmp_fit. (In both cases, the local reference to the handle will be just discarded) Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* | | Merge tag 'efi-2021-07-rc5-2' of ↵Tom Rini2021-06-293-9/+18
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://source.denx.de/u-boot/custodians/u-boot-efi Pull request for efi-2021-07-rc5-2 Documentation: * man-page for askenv bug fixes * correct display of BootOrder in efidebug command * do not allow TPL_HIGH_LEVEL for CreateEvent(Ex) * correct handling of unknown properties in SMBIOS tables
| * | smbios: Fix SMBIOS tablesIlias Apalodimas2021-06-281-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit e4f8e543f1a9("smbios: Drop the unused Kconfig options") break SMBIOS tables. The reason is that the patch drops the Kconfig options *after* removing the code using them, but that changes the semantics of the code completely. Prior to the change a non NULL value was used in the 'product' and 'manufacturer ' fields. Chapter 6.2 of the DMTF spec requires Manufacturer and Product Name to be non-null on some of the tables. So let's add sane defaults for Type1/2/3. * Before the patchset: <snip> Handle 0x0002, DMI type 2, 14 bytes Base Board Information Manufacturer: Not Specified Product Name: Not Specified Version: Not Specified Serial Number: Not Specified Asset Tag: Not Specified Features: Board is a hosting board Location In Chassis: Not Specified Chassis Handle: 0x0000 Type: Motherboard Invalid entry length (0). DMI table is broken! Stop. * After the patchset: <snip> Handle 0x0005, DMI type 32, 11 bytes System Boot Information Status: No errors detected Handle 0x0006, DMI type 127, 4 bytes End Of Table Fixes: e4f8e543f1a9 ("smbios: Drop the unused Kconfig options") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
| * | smbios: Fix BIOS Characteristics Extension Byte 2Ilias Apalodimas2021-06-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently define the EFI support of an SMBIOS table as the third bit of "BIOS Characteristics Extension Byte 1". The latest DMTF spec defines it on "BIOS Characteristics Extension Byte 2". Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Remove superfluous assignment. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * | smbios: convert function descriptions to Sphinx styleHeinrich Schuchardt2021-06-281-5/+5
| | | | | | | | | | | | | | | | | | Use 'Return:' instead of '@return:'. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * | efi_loader: TPL_HIGH_LEVEL not allowed for CreateEventHeinrich Schuchardt2021-06-282-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to chapter 7.1 "Event, Timer, and Task Priority Services" TPL_HIGH_LEVEL should not be exposed to applications and drivers. According to the discussion with EDK II contributors this implies that CreateEvent() shall not allow to create events with TPL_HIGH_LEVEL. Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Acked-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>