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 | |
| 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')
| -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 | ||||
| -rw-r--r-- | lib/efi_selftest/efi_selftest_hii.c | 2 | ||||
| -rw-r--r-- | lib/efi_selftest/efi_selftest_hii_data.c | 28 |
11 files changed, 27 insertions, 49 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; diff --git a/lib/efi_selftest/efi_selftest_hii.c b/lib/efi_selftest/efi_selftest_hii.c index f219c0120a3..c363df466dc 100644 --- a/lib/efi_selftest/efi_selftest_hii.c +++ b/lib/efi_selftest/efi_selftest_hii.c @@ -913,7 +913,7 @@ static int test_hii_string_get_languages(void) goto out; } - efi_st_printf("got languages are %s\n", languages); + efi_st_printf("Available languages: %s\n", languages); result = EFI_ST_SUCCESS; diff --git a/lib/efi_selftest/efi_selftest_hii_data.c b/lib/efi_selftest/efi_selftest_hii_data.c index d19f0682afd..5fc890112b4 100644 --- a/lib/efi_selftest/efi_selftest_hii_data.c +++ b/lib/efi_selftest/efi_selftest_hii_data.c @@ -39,7 +39,7 @@ /* HII keyboard layout */ #define EFI_NULL_MODIFIER 0x0000 -u8 packagelist1[] = { +static u8 packagelist1[] = { // EFI_HII_PACKAGE_LIST_HEADER, length = 20 // SimpleFont, Font, GUID, Form, String, Image, DevicePath, // (74) (110) 20 (8) 78 (67) (8) @@ -262,7 +262,7 @@ u8 packagelist1[] = { EFI_HII_PACKAGE_END }; -u8 packagelist2[] = { +static u8 packagelist2[] = { // EFI_HII_PACKAGE_LIST_HEADER, length = 20 // SimpleFont, Font, GUID, KeyboardLayout, Form, End // (74) (122) 20 192 (8) 4 @@ -424,30 +424,10 @@ u8 packagelist2[] = { EFI_HII_PACKAGE_END // 1 }; -efi_guid_t packagelist_guid1 = - EFI_GUID(0x03abcd89, 0x03f4, 0x7044, - 0x81, 0xde, 0x99, 0xb1, 0x81, 0x20, 0xf7, 0x68); - -efi_guid_t packagelist_guid2 = - EFI_GUID(0x8685ded3, 0x1bce, 0x43f3, - 0xa2, 0x0c, 0xa3, 0x06, 0xec, 0x69, 0x72, 0xdd); - -efi_guid_t kb_layout_guid11 = +static efi_guid_t kb_layout_guid11 = EFI_GUID(0x8d40e495, 0xe2aa, 0x4c6f, 0x89, 0x70, 0x68, 0x85, 0x09, 0xee, 0xc7, 0xd2); -efi_guid_t kb_layout_guid12 = - EFI_GUID(0x2ae60b3e, 0xb9d6, 0x49d8, - 0x9a, 0x16, 0xc2, 0x48, 0xf1, 0xeb, 0xa8, 0xdb); - -efi_guid_t kb_layout_guid21 = - EFI_GUID(0xe0f56a1f, 0xdf6b, 0x4a7e, - 0xa3, 0x9a, 0xe7, 0xa5, 0x19, 0x15, 0x45, 0xd6); - -efi_guid_t kb_layout_guid22 = - EFI_GUID(0x47be6ac9, 0x54cc, 0x46f9, - 0xa2, 0x62, 0xd5, 0x3b, 0x25, 0x6a, 0x0c, 0x34); - -efi_guid_t package_guid = +static efi_guid_t package_guid = EFI_GUID(0x0387c95a, 0xd703, 0x2346, 0xb2, 0xab, 0xd0, 0xc7, 0xdd, 0x90, 0x44, 0xf8); |
