diff options
| author | Tom Rini <[email protected]> | 2024-10-31 08:33:24 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2024-10-31 08:33:24 -0600 |
| commit | d4c8b8750b564ee83303160414607e17b6873fe2 (patch) | |
| tree | 39965f9fb950418d2d1cd08937690e632e14fa50 /lib/efi_loader | |
| parent | 89bdd752b91764b65c713c47e87628b5680fb18f (diff) | |
| parent | 7596d77bc1b6be838e38af3fb4e73dbd0a0a078e (diff) | |
Merge tag 'efi-2025-01-rc2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request efi-2025-01-rc2
Documentation:
* include semihosting and K3 boards only once in table of contents
* include file-system API into HTML docs
* describe struct ext2_inode
* update Python requirements
UEFI:
* mark local functions static
* simplify efi_free_pages()
* pass correct end address value to efi_dp_from_mem()
* fix typos in HII test and eficonfig command
Diffstat (limited to 'lib/efi_loader')
| -rw-r--r-- | lib/efi_loader/Kconfig | 2 | ||||
| -rw-r--r-- | lib/efi_loader/dtbdump.c | 12 | ||||
| -rw-r--r-- | lib/efi_loader/efi_bootbin.c | 1 | ||||
| -rw-r--r-- | lib/efi_loader/efi_bootmgr.c | 2 | ||||
| -rw-r--r-- | lib/efi_loader/efi_device_path.c | 3 | ||||
| -rw-r--r-- | lib/efi_loader/efi_disk.c | 4 | ||||
| -rw-r--r-- | lib/efi_loader/efi_memory.c | 14 | ||||
| -rw-r--r-- | lib/efi_loader/efi_tcg2.c | 2 | ||||
| -rw-r--r-- | lib/efi_loader/smbiosdump.c | 6 |
9 files changed, 22 insertions, 24 deletions
diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index 69b2c9360d8..066f0ca0da7 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -545,6 +545,8 @@ config EFI_BOOTMGR config EFI_HTTP_BOOT bool "EFI HTTP Boot support" + depends on NET || NET_LWIP + select CMD_NET select CMD_DNS select CMD_WGET select BLKMAP diff --git a/lib/efi_loader/dtbdump.c b/lib/efi_loader/dtbdump.c index 9f1d8fb82cb..a3d59a2fd3b 100644 --- a/lib/efi_loader/dtbdump.c +++ b/lib/efi_loader/dtbdump.c @@ -225,7 +225,7 @@ static u32 f2h(fdt32_t val) * @systable: system table * Return: device tree or NULL */ -void *get_dtb(struct efi_system_table *systable) +static void *get_dtb(struct efi_system_table *systable) { void *dtb = NULL; efi_uintn_t i; @@ -246,7 +246,7 @@ void *get_dtb(struct efi_system_table *systable) * @pos: UTF-16 string * Return: pointer to first non-whitespace */ -u16 *skip_whitespace(u16 *pos) +static u16 *skip_whitespace(u16 *pos) { for (; *pos && *pos <= 0x20; ++pos) ; @@ -260,7 +260,7 @@ u16 *skip_whitespace(u16 *pos) * @keyword: keyword to be searched * Return: true fi @string starts with the keyword */ -bool starts_with(u16 *string, u16 *keyword) +static bool starts_with(u16 *string, u16 *keyword) { for (; *keyword; ++string, ++keyword) { if (*string != *keyword) @@ -272,7 +272,7 @@ bool starts_with(u16 *string, u16 *keyword) /** * do_help() - print help */ -void do_help(void) +static void do_help(void) { error(u"dump - print device-tree\r\n"); error(u"load <dtb> - load device-tree from file\r\n"); @@ -332,7 +332,7 @@ open_file_system(struct efi_simple_file_system_protocol **file_system) * @filename: file name * Return: status code */ -efi_status_t do_load(u16 *filename) +static efi_status_t do_load(u16 *filename) { struct efi_dt_fixup_protocol *dt_fixup_prot; struct efi_simple_file_system_protocol *file_system; @@ -469,7 +469,7 @@ out: * @filename: file name * Return: status code */ -efi_status_t do_save(u16 *filename) +static efi_status_t do_save(u16 *filename) { struct efi_simple_file_system_protocol *file_system; efi_uintn_t dtb_size; diff --git a/lib/efi_loader/efi_bootbin.c b/lib/efi_loader/efi_bootbin.c index a87006b3c0e..bf38392fac3 100644 --- a/lib/efi_loader/efi_bootbin.c +++ b/lib/efi_loader/efi_bootbin.c @@ -137,6 +137,7 @@ efi_status_t efi_run_image(void *source_buffer, efi_uintn_t source_size) */ file_path = efi_dp_from_mem(EFI_RESERVED_MEMORY_TYPE, (uintptr_t)source_buffer, + (uintptr_t)source_buffer + source_size); /* * Make sure that device for device_path exist diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c index a3aa2b8d1b9..f9b5988a06e 100644 --- a/lib/efi_loader/efi_bootmgr.c +++ b/lib/efi_loader/efi_bootmgr.c @@ -385,7 +385,7 @@ err: * @ctx: event context * Return: status code */ -efi_status_t efi_bootmgr_release_uridp(struct uridp_context *ctx) +static efi_status_t efi_bootmgr_release_uridp(struct uridp_context *ctx) { efi_status_t ret = EFI_SUCCESS; efi_status_t ret2 = EFI_SUCCESS; diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c index 9de3b95d073..d7444588aa0 100644 --- a/lib/efi_loader/efi_device_path.c +++ b/lib/efi_loader/efi_device_path.c @@ -1073,7 +1073,8 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr, efi_get_image_parameters(&image_addr, &image_size); dp = efi_dp_from_mem(EFI_RESERVED_MEMORY_TYPE, - (uintptr_t)image_addr, image_size); + (uintptr_t)image_addr, + (uintptr_t)image_addr + image_size); } else if (IS_ENABLED(CONFIG_NETDEVICES) && !strcmp(dev, "Net")) { dp = efi_dp_from_eth(); } else if (!strcmp(dev, "Uart")) { diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c index 93a9a5ac025..1f3de0a2339 100644 --- a/lib/efi_loader/efi_disk.c +++ b/lib/efi_loader/efi_disk.c @@ -561,11 +561,9 @@ static int efi_disk_create_raw(struct udevice *dev, efi_handle_t agent_handle) { struct efi_disk_obj *disk; struct blk_desc *desc; - int diskid; efi_status_t ret; desc = dev_get_uclass_plat(dev); - diskid = desc->devnum; ret = efi_disk_add_dev(NULL, NULL, desc, NULL, 0, &disk, agent_handle); @@ -608,7 +606,6 @@ static int efi_disk_create_part(struct udevice *dev, efi_handle_t agent_handle) struct disk_part *part_data; struct disk_partition *info; unsigned int part; - int diskid; struct efi_handler *handler; struct efi_device_path *dp_parent; struct efi_disk_obj *disk; @@ -618,7 +615,6 @@ static int efi_disk_create_part(struct udevice *dev, efi_handle_t agent_handle) return -1; desc = dev_get_uclass_plat(dev_get_parent(dev)); - diskid = desc->devnum; part_data = dev_get_uclass_plat(dev); part = part_data->partnum; diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c index 9f3f0876997..d2f5d563f2a 100644 --- a/lib/efi_loader/efi_memory.c +++ b/lib/efi_loader/efi_memory.c @@ -521,7 +521,6 @@ efi_status_t efi_allocate_pages(enum efi_allocate_type type, efi_status_t efi_free_pages(uint64_t memory, efi_uintn_t pages) { u64 len; - uint flags; long status; efi_status_t ret; @@ -536,18 +535,17 @@ efi_status_t efi_free_pages(uint64_t memory, efi_uintn_t pages) return EFI_INVALID_PARAMETER; } - flags = LMB_NOOVERWRITE | LMB_NONOTIFY; len = (u64)pages << EFI_PAGE_SHIFT; + /* + * The 'memory' variable for sandbox holds a pointer which has already + * been mapped with map_sysmem() from efi_allocate_pages(). Convert + * it back to an address LMB understands + */ status = lmb_free_flags(map_to_sysmem((void *)(uintptr_t)memory), len, - flags); + LMB_NOOVERWRITE); if (status) return EFI_NOT_FOUND; - ret = efi_add_memory_map_pg(memory, pages, EFI_CONVENTIONAL_MEMORY, - false); - if (ret != EFI_SUCCESS) - return EFI_NOT_FOUND; - return ret; } diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c index 45f451ef6b6..866a529857e 100644 --- a/lib/efi_loader/efi_tcg2.c +++ b/lib/efi_loader/efi_tcg2.c @@ -789,7 +789,7 @@ static const struct efi_tcg2_protocol efi_tcg2_protocol = { /** * tcg2_uninit - remove the final event table and free efi memory on failures */ -void tcg2_uninit(void) +static void tcg2_uninit(void) { efi_status_t ret; diff --git a/lib/efi_loader/smbiosdump.c b/lib/efi_loader/smbiosdump.c index 2f0b91a353d..d7f2ba30a95 100644 --- a/lib/efi_loader/smbiosdump.c +++ b/lib/efi_loader/smbiosdump.c @@ -289,7 +289,7 @@ static void *get_config_table(const efi_guid_t *guid) * @len: length of buffer * Return: checksum */ -u8 checksum(void *buf, int len) +static u8 checksum(void *buf, int len) { u8 ret = 0; @@ -304,7 +304,7 @@ u8 checksum(void *buf, int len) * * Return: status code */ -efi_status_t do_check(void) +static efi_status_t do_check(void) { struct smbios3_entry *smbios3_anchor; void *table, *table_end; @@ -401,7 +401,7 @@ efi_status_t do_check(void) * @buf: buffer to write * @size: size of the buffer */ -efi_status_t save_file(u16 *filename, void *buf, efi_uintn_t size) +static efi_status_t save_file(u16 *filename, void *buf, efi_uintn_t size) { efi_uintn_t ret; struct efi_simple_file_system_protocol *file_system; |
