summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2021-04-22lmb: remove lmb_region.sizePatrick Delaunay1-6/+0
Remove the unused field size of struct lmb_region as it is initialized to 0 and never used after in lmb library. See Linux kernel commit 4734b594c6ca ("memblock: Remove memblock_type.size and add memblock.memory_size instead") Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-04-22lmb: move CONFIG_LMB in KconfigPatrick Delaunay1-0/+7
Migrate CONFIG_LMB in Kconfig. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-04-20lz4: Fix unaligned accessesKarl Beldan1-3/+12
Signed-off-by: Karl Beldan <karl.beldan+oss@gmail.com>
2021-04-17efi_loader: fix possible buffer overflowMasahisa Kojima1-1/+1
Variable "final" will have SHA512 digest, but currently the array size is not sufficient. Let's fix it. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-04-17efi_loader: memory leak in efi_capsule_scan_dir()Heinrich Schuchardt1-0/+3
If realloc() fails, we should free the old buffer. Fixes: c74cd8bd08d1: ("efi_loader: capsule: add capsule_on_disk support") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-04-17efi_loader: esrt: Remove incorrect invocations of EFI_CALL macroSughosh Ganu1-14/+14
Remove function invocations using the EFI_CALL macro for those functions that do not have an EFI_ENTRY call in their definition. Such functions can use u-boot api's which rely on u-boot global data(gd) pointer. The Arm and RiscV architectures maintain a separate gd pointer, one for u-boot, and a separate gd for the efi application. Calling a function through the EFI_CALL macro changes the gd pointer to that used for the efi application, with u-boot gd being unavailable. Any function then trying to dereference u-boot's gd will result in an abort. Fix this issue by removing the EFI_CALL macro for all of such functions which do not begin by an EFI_ENTRY function call. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-04-15lib/rsa: Use EVP_PKEY instead of RSAChan, Donald1-102/+67
Most modern OpenSSL engines have methods overridden at the EVP level rather than at RSA level, to make these engines work properly with mkimage, the RSA signing code needs to switch to using EVP_* APIs as much as possible. Signed-off-by: Donald Chan <hoiho@lab126.com> [trini: Rebase on top of keyfile changes] Signed-off-by: Tom Rini <trini@konsulko.com>
2021-04-14lib/ecdsa: Use the 'keydir' argument from mkimage if appropriateAlexandru Gagniuc1-1/+13
Keys can be derived from keydir, and the "key-name-hint" property of the FIT. They can also be specified ad-literam via 'keyfile'. Update the ECDSA signing path to use the appropriate one. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-04-14lib/rsa: Use the 'keyfile' argument from mkimageAlexandru Gagniuc1-8/+26
Keys can be derived from keydir, and the "key-name-hint" property of the FIT. They can also be specified ad-literam via 'keyfile'. Update the RSA signing path to use the appropriate one. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-04-14lib: Add support for ECDSA image signingAlexandru Gagniuc1-0/+306
mkimage supports rsa2048, and rsa4096 signatures. With newer silicon now supporting hardware-accelerated ECDSA, it makes sense to expand signing support to elliptic curves. Implement host-side ECDSA signing and verification with libcrypto. Device-side implementation of signature verification is beyond the scope of this patch. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-04-14lib/rsa: Make fdt_add_bignum() available outside of RSA codeAlexandru Gagniuc2-64/+73
fdt_add_bignum() is useful for algorithms other than just RSA. To allow its use for ECDSA, move it to a common file under lib/. The new file is suffixed with '-libcrypto' because it has a direct dependency on openssl. This is due to the use of the "BIGNUM *" type. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-04-14lib: Rename rsa-checksum.c to hash-checksum.cAlexandru Gagniuc5-4/+6
rsa-checksum.c sontains the hash_calculate() implementations. Despite the "rsa-" file prefix, this function is useful for other algorithms. To prevent confusion, move this file to lib/, and rename it to hash-checksum.c, to give it a more "generic" feel. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-04-13lib: string: Implement strlcatSean Anderson1-0/+19
This introduces strlcat, which provides a safer interface than strncat. It never copies more than its size bytes, including the terminating nul. In addition, it never reads past dest[size - 1], even if dest is not nul-terminated. This also removes the stub for dwc3 now that we have a proper implementation. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-04-13lib: string: Fix strlcpy return valueSean Anderson1-4/+8
strlcpy should always return the number of bytes copied. We were accidentally missing the nul-terminator. We also always used to return a non-zero value, even if we did not actually copy anything. Fixes: 23cd138503 ("Integrate USB gadget layer and USB CDC driver layer") Signed-off-by: Sean Anderson <seanga2@gmail.com>
2021-04-13hash: Allow for SHA512 hardware implementationsJoel Stanley1-8/+7
Similar to support for SHA1 and SHA256, allow the use of hardware hashing engine by enabling the algorithm and setting CONFIG_SHA_HW_ACCEL / CONFIG_SHA_PROG_HW_ACCEL. Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-04-12lib: optee: migration optee_copy_fdt_nodes for OF_LIVE supportPatrick Delaunay1-27/+18
The optee_copy_fdt_nodes is only used to copy op-tee nodes of U-Boot device tree (from gd->fdt_blob when OF_LIVE is not activated) to external device tree but it is not compatible with OF_LIVE. This patch migrates all used function fdt_ functions to read node on old_blob to ofnode functions, compatible with OF_LIVE and remove this parameter "old_blob". The generated "device tree" is checked on stm32mp platform with OF_LIVE activated. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-04-10efi_loader: Change ptr arithmetics tcg eventlog bufferIlias Apalodimas1-9/+10
Although ptr arithmetics are allowed with extensions in gcc, they are not allowed by the C spec. So switch to (void *)(uintptr_t) instead Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2021-04-10efi_loader: esrt: wrong type for LocateHandleBuffer()Heinrich Schuchardt1-1/+1
efi_locate_handle_buffer() expects no_handles to be of type efi_uintn_t *. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-04-10efi_loader: use correct printf codesHeinrich Schuchardt1-7/+7
For printing u32 use %u not %d. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-04-10efi_loader: efi_esrt: Fix the build warning for 32 bit systemsSughosh Ganu1-1/+1
Fix the build warning when building for 32 bit systems by using the length modifier for size_t. lib/efi_loader/efi_esrt.c: In function ‘efi_esrt_populate’: include/efi_loader.h:126:8: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 8 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=] Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-04-10efi_loader: Kconfig: Select IMAGE_SIGN_INFO when capsule authentication is ↵Sughosh Ganu1-0/+1
enabled Enable building of the crypto helper functions used during capsule authentication by selecting IMAGE_SIGN_INFO. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-04-10efi_loader: Cleanup get_var duplicationIlias Apalodimas1-34/+2
get_var() is defined statically in efi_bootmgr.c and doesn't properly check a buffer allocation. Remove it completely and use the exported function from efi_var_common.c that does the same thing Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-04-05Merge branch 'next'Tom Rini26-211/+1905
2021-03-31efi_loader: typo 'devide path'Heinrich Schuchardt1-1/+1
Fix a typo in helloworld.efi. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-31efi_loader: Uart device path missing breakHeinrich Schuchardt1-0/+2
In the devicepath node to text conversion for Uart nodes a break statement is missing. Indicated by Coverity Scan CID 330038 Fixes: 62df6e9c9994 ("efi_loader: Uart device path") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-27bloblist: Make BLOBLIST_TABLES depend on BLOBLISTSimon Glass1-1/+1
Add an extra condition here since we cannot put x86 tables in a bloblist when bloblists are not supported. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-27binman: Show a message when changing subnodesSimon Glass1-2/+2
This change seems important enough to warrant a visible message. Change the log_debug() to log_info(). Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-27smbios: Allow writing to the coreboot version stringSimon Glass2-4/+38
When U-Boot is booted from coreboot the SMBIOS tables are written by coreboot, not U-Boot. The existing method of updating the BIOS version string does not work in that case, since gd->smbios_version is only set when U-Boot writes the tables. Add a new function which allows the version to be updated by parsing the tables and writing the string in the correct place. Since coreboot provides a pointer to the SMBIOS tables in its sysinfo structure, this makes it easy to do the update. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-25efi_loader: Clean up file size calculationsIlias Apalodimas1-15/+1
We recently added a common function for calculating file size, instead of copy pasting the code around. Switch one of the occurences over to the common function Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviwed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-25efi_selfest: redefine enum efi_test_phaseHeinrich Schuchardt2-6/+7
Setup will always occur before ExitBootServices(). So eliminate EFI_SETUP_AFTER_BOOTTIME_EXIT. Put the SetVirtualAddressMap() test into a separate class so that we can execute it last. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-25efi_loader: Add an S-CRTM even for firmware versionIlias Apalodimas1-0/+35
TCG PC Client Platform Firmware Profile Spec mandates that an S-CRTM event for the version identifier using the event type EV_S_CRTM_VERSION must be measured. So since we are trying to add more conformance into U-Boot, let's add the event using U_BOOT_VERSION_STRING, extend PCR[0] accordingly and log it in the EventLog Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-03-25efi_loader: EFI TCG2 free efi memory on protocol failureIlias Apalodimas1-8/+32
Current code doesn't free the efi allocated memory in case the protocol failed to install Fixes: c8d0fd582576 ("efi_loader: Introduce eventlog support for TCG2_PROTOCOL") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-03-25efi: ESRT creation testsJose Marinho2-0/+293
This commmit exercises the ESRT creation in a EFI selftest. A fake FMP, with TEST_ESRT_NUM_ENTRIES FW images, is installed in the system leading to the corresponding ESRT entries being populated. The ESRT entries are checked against the datastructure used to initialize the FMP. Invocation from the sandbox platform: add to sandbox_defconfig: +CONFIG_CMD_BOOTEFI_SELFTEST=y make sandbox_capsule_defconfig all ./u-boot -d arch/sandbox/dts/test.dtb bootefi selftest CC: Heinrich Schuchardt <xypron.glpk@gmx.de> CC: Sughosh Ganu <sughosh.ganu@linaro.org> CC: AKASHI Takahiro <takahiro.akashi@linaro.org> CC: Ilias Apalodimas <ilias.apalodimas@linaro.org> CC: Andre Przywara <andre.przywara@arm.com> CC: Alexander Graf <agraf@csgraf.de> CC: nd@arm.com Signed-off-by: Jose Marinho <jose.marinho@arm.com> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-25efi: Add ESRT to the EFI system tableJose Marinho6-4/+535
The ESRT is initialised during efi_init_objlist after efi_initialize_system_table(). The ESRT is recreated from scratch at the following events: - successful UpdateCapsule; - FMP instance install. The code ensures that every ESRT entry has a unique fw_class value. Limitations: - The ESRT is not updated if an FMP instance is uninstalled; - the fields image_type and flags are in the current implementation left undefined. Setting these values will require a per-platform function that returns the image_type/flags as a function of the image fw_class. CC: Heinrich Schuchardt <xypron.glpk@gmx.de> CC: Sughosh Ganu <sughosh.ganu@linaro.org> CC: AKASHI Takahiro <takahiro.akashi@linaro.org> CC: Ilias Apalodimas <ilias.apalodimas@linaro.org> CC: Andre Przywara <andre.przywara@arm.com> CC: Alexander Graf <agraf@csgraf.de> CC: nd@arm.com Signed-off-by: Jose Marinho <jose.marinho@arm.com> Remove two EFI_CALL() indirections. Move ESRT GUID in efidebug's list of GUIDs. Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-25efi_loader: Replace config option for initrd loadingIlias Apalodimas3-98/+140
Up to now we install EFI_LOAD_FILE2_PROTOCOL to load an initrd unconditionally. Although we correctly return various EFI exit codes depending on the file status (i.e EFI_NO_MEDIA, EFI_NOT_FOUND etc), the kernel loader, only falls back to the cmdline interpreted initrd if the protocol is not installed. This creates a problem for EFI installers, since they won't be able to load their own initrd and continue the installation. It also makes the feature hard to use, since we can either have a single initrd or we have to recompile u-boot if the filename changes. So let's introduce a different logic that will decouple the initrd path from the config option we currently have. When defining a UEFI BootXXXX we can use the filepathlist and store a file path pointing to our initrd. Specifically the EFI spec describes: "The first element of the array is a device path that describes the device and location of the Image for this load option. Other device paths may optionally exist in the FilePathList, but their usage is OSV specific" When the EFI application is launched through the bootmgr, we'll try to interpret the extra device path. If that points to a file that exists on our disk, we'll now install the load_file2 and the efi-stub will be able to use it. This opens up another path using U-Boot and defines a new boot flow. A user will be able to control the kernel/initrd pairs without explicit cmdline args or GRUB. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-25efi_loader: Add helper functions for EFIIlias Apalodimas4-0/+171
A following patch introduces a different logic for loading initrd's based on the EFI_LOAD_FILE2_PROTOCOL. Since similar logic can be applied in the future for other system files (i.e DTBs), let's add some helper functions which will retrieve and parse file paths stored in EFI variables. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-03-25efi_loader: Add device path related functions for initrd via Boot####Ilias Apalodimas1-5/+105
On the following patches we allow for an initrd path to be stored in Boot#### variables. Specifically we encode in the FIlePathList[] of the EFI_LOAD_OPTIONS for each Boot#### variable. The FilePathList[] array looks like this: kernel - 0xff - VenMedia(initrd GUID) - initrd1 - 0x01 initrd2 - 0xff So let's add the relevant functions to concatenate and retrieve a device path based on a Vendor GUID. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reformat function descriptions. Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-25efi_loader: Uart device pathHeinrich Schuchardt2-9/+45
When uploading an EFI binary via the UART we need to assign a device path. * Provide devicepath node to text conversion for Uart() node. * Provide function to create Uart() device path. * Add UART support to efi_dp_from_name(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-25efi_loader: NULL dereference in EFI consoleHeinrich Schuchardt1-13/+38
Even if CONFIG_DM_VIDEO=y and stdout="vidconsole", a video device may not be available. Check the return values of the relevant functions. If no video output device is available, assume that the serial console is in use. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-25efi: Fix compiler warningsSimon Glass2-4/+4
This occur when building on Raspberry Pi 400 (32-bit ARM). Fix them. Examples: cmd/efidebug.c: In function ‘do_efi_capsule_update’: cmd/efidebug.c:75:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] ret = EFI_CALL(RT->update_capsule(&capsule, 1, (u64)NULL)); ^ include/efi_loader.h:104:9: note: in definition of macro ‘EFI_CALL’ typeof(exp) _r = exp; \ ^~~ cmd/efidebug.c:75:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] ret = EFI_CALL(RT->update_capsule(&capsule, 1, (u64)NULL)); ^ include/efi_loader.h:104:19: note: in definition of macro ‘EFI_CALL’ typeof(exp) _r = exp; \ ^~~ In file included from include/common.h:20, from lib/efi_loader/efi_capsule.c:9: lib/efi_loader/efi_capsule.c: In function ‘efi_update_capsule’: include/efi_loader.h:83:8: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 10 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=] debug("%sEFI: Entry %s(" format ")\n", __efi_nesting_inc(), \ ^~~~~~~~~~~~~~~~~~ include/linux/printk.h:37:21: note: in definition of macro ‘pr_fmt’ #define pr_fmt(fmt) fmt ^~~ include/log.h:229:2: note: in expansion of macro ‘log’ log(LOG_CATEGORY, LOGL_DEBUG, fmt, ##args); \ ^~~ include/log.h:249:2: note: in expansion of macro ‘debug_cond’ debug_cond(_DEBUG, fmt, ##args) ^~~~~~~~~~ include/efi_loader.h:83:2: note: in expansion of macro ‘debug’ debug("%sEFI: Entry %s(" format ")\n", __efi_nesting_inc(), \ ^~~~~ lib/efi_loader/efi_capsule.c:444:2: note: in expansion of macro ‘EFI_ENTRY’ EFI_ENTRY("%p, %lu, %llu\n", capsule_header_array, capsule_count, ^~~~~~~~~ lib/efi_loader/efi_capsule.c:444:19: note: format string is defined here EFI_ENTRY("%p, %lu, %llu\n", capsule_header_array, capsule_count, ~~^ %u Signed-off-by: Simon Glass <sjg@chromium.org> Replace (uintptr_t)NULL by 0. Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-25efi_selftest: Remove loadfile2 for initrd selftestsIlias Apalodimas2-222/+0
We are redefining how u-boot locates the initrd to load via the kernel LoadFile2 protocol. This selftest is not relevant any more, so remove it. A new one will be added later Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-25efi_selftest: illegal cast to pointer in initrddumpHeinrich Schuchardt1-1/+1
On 32bit systems u64 cannot directly be cast to void *. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-25efi_loader: fix memory type for memory reservation blockMark Kettenis1-1/+1
The (yet unreleased version of the) devicetree specification clearly states that: As with the /reserved-memory node, when booting via UEFI entries in the Memory Reservation Block must also be listed in the system memory map obtained via the GetMemoryMap() toi protect against allocations by UEFI applications. The memory reservation block entries should be listed with type EfiReservedMemoryType. This restores the behaviour that was changed by commit 4cbb2930bd8c ("efi_loader: consider no-map property of reserved memory"). Fixes: 4cbb2930bd8c ("efi_loader: consider no-map property of reserved memory") Signed-off-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-25efi_loader: disable GRUB_ARM32_WORKAROUND on ARCH_SUNXIHeinrich Schuchardt1-1/+1
GRUB_ARM32_WORKAROUND can be disabled on ARCH_SUNXI as the Allwinner SoCs only have a level 2 cache controlled via CP15 and not an architecturally defined cache. Having the cache available speeds up booting Linux. On ARCH_BCM283X it is already disabled via rpi_2_defconfig. But let's move this setting to Kconfig. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-19efi_loader: Uart device pathHeinrich Schuchardt2-9/+45
When uploading an EFI binary via the UART we need to assign a device path. * Provide devicepath node to text conversion for Uart() node. * Provide function to create Uart() device path. * Add UART support to efi_dp_from_name(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-19efi_loader: NULL dereference in EFI consoleHeinrich Schuchardt1-13/+38
Even if CONFIG_DM_VIDEO=y and stdout="vidconsole", a video device may not be available. Check the return values of the relevant functions. If no video output device is available, assume that the serial console is in use. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-16efi: Fix compiler warningsSimon Glass2-4/+4
This occur when building on Raspberry Pi 400 (32-bit ARM). Fix them. Examples: cmd/efidebug.c: In function ‘do_efi_capsule_update’: cmd/efidebug.c:75:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] ret = EFI_CALL(RT->update_capsule(&capsule, 1, (u64)NULL)); ^ include/efi_loader.h:104:9: note: in definition of macro ‘EFI_CALL’ typeof(exp) _r = exp; \ ^~~ cmd/efidebug.c:75:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] ret = EFI_CALL(RT->update_capsule(&capsule, 1, (u64)NULL)); ^ include/efi_loader.h:104:19: note: in definition of macro ‘EFI_CALL’ typeof(exp) _r = exp; \ ^~~ In file included from include/common.h:20, from lib/efi_loader/efi_capsule.c:9: lib/efi_loader/efi_capsule.c: In function ‘efi_update_capsule’: include/efi_loader.h:83:8: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 10 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=] debug("%sEFI: Entry %s(" format ")\n", __efi_nesting_inc(), \ ^~~~~~~~~~~~~~~~~~ include/linux/printk.h:37:21: note: in definition of macro ‘pr_fmt’ #define pr_fmt(fmt) fmt ^~~ include/log.h:229:2: note: in expansion of macro ‘log’ log(LOG_CATEGORY, LOGL_DEBUG, fmt, ##args); \ ^~~ include/log.h:249:2: note: in expansion of macro ‘debug_cond’ debug_cond(_DEBUG, fmt, ##args) ^~~~~~~~~~ include/efi_loader.h:83:2: note: in expansion of macro ‘debug’ debug("%sEFI: Entry %s(" format ")\n", __efi_nesting_inc(), \ ^~~~~ lib/efi_loader/efi_capsule.c:444:2: note: in expansion of macro ‘EFI_ENTRY’ EFI_ENTRY("%p, %lu, %llu\n", capsule_header_array, capsule_count, ^~~~~~~~~ lib/efi_loader/efi_capsule.c:444:19: note: format string is defined here EFI_ENTRY("%p, %lu, %llu\n", capsule_header_array, capsule_count, ~~^ %u Signed-off-by: Simon Glass <sjg@chromium.org> Replace (uintptr_t)NULL by 0. Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-16efi_selftest: Remove loadfile2 for initrd selftestsIlias Apalodimas2-222/+0
We are redefining how u-boot locates the initrd to load via the kernel LoadFile2 protocol. This selftest is not relevant any more, so remove it. A new one will be added later Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-16efi_selftest: illegal cast to pointer in initrddumpHeinrich Schuchardt1-1/+1
On 32bit systems u64 cannot directly be cast to void *. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-16efi_loader: fix memory type for memory reservation blockMark Kettenis1-1/+1
The (yet unreleased version of the) devicetree specification clearly states that: As with the /reserved-memory node, when booting via UEFI entries in the Memory Reservation Block must also be listed in the system memory map obtained via the GetMemoryMap() toi protect against allocations by UEFI applications. The memory reservation block entries should be listed with type EfiReservedMemoryType. This restores the behaviour that was changed by commit 4cbb2930bd8c ("efi_loader: consider no-map property of reserved memory"). Fixes: 4cbb2930bd8c ("efi_loader: consider no-map property of reserved memory") Signed-off-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>