diff options
author | Tom Rini <trini@konsulko.com> | 2025-03-10 07:49:17 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2025-03-10 07:49:33 -0600 |
commit | 42fd94893e7e0fe4ee1e8c5efa35958459842da6 (patch) | |
tree | 50afa0a3327489e9e9ed4c54087b608301b2c9ce /lib/efi_loader/efi_device_path.c | |
parent | 743c15b9fdd2f639012a2c26734dc146dc568218 (diff) | |
parent | cb21476496d6f48712b24045aa7cd3299ad65d99 (diff) |
Merge tag 'efi-next-20250310' of https://source.denx.de/u-boot/custodians/u-boot-efi into next
Pull request efi-next-20250310
CI:
* https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/25043
UEFI:
* Clean up usage of structure jmp_buf_data
* Refactor EFI network protocol implementation for future support
of multiple network interfaces.
- efi_net: let efi_net_set_dp properly update the device path
- expose symbols to be used by the EFI network stack
- efi_setup: Add efi_start_obj_list() to efi_setup.c
- efi_net: Add efi_net_do_start() to efi_net.c
- efi_device_path: Pass net udevice as argument
- efi_net: Add device path cache
- efi_net: Add dhcp cache
- efi_net: Add support for multiple efi_net_obj
Others:
* legacy-net: wget: fix wget_info handling after new tcp legacy stack
* lib: correct description of CONFIG_SYS_FDT_PAD
* Separate setjmp.h into architecture dependent and independent parts
- sandbox: remove linux/types.h dependency in setjmp.h
- arm: include asm-generic/int-ll64.h in setjmp.h
- common: clean up setjmp.h
* arm: use type jmp_buf instead of struct jmp_buf_data
Diffstat (limited to 'lib/efi_loader/efi_device_path.c')
-rw-r--r-- | lib/efi_loader/efi_device_path.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c index c0633a736b6..c9bf2726fe2 100644 --- a/lib/efi_loader/efi_device_path.c +++ b/lib/efi_loader/efi_device_path.c @@ -954,20 +954,20 @@ struct efi_device_path *efi_dp_from_uart(void) return buf; } -struct efi_device_path __maybe_unused *efi_dp_from_eth(void) +struct efi_device_path __maybe_unused *efi_dp_from_eth(struct udevice *dev) { void *buf, *start; unsigned dpsize = 0; - assert(eth_get_dev()); + assert(dev); - dpsize += dp_size(eth_get_dev()); + dpsize += dp_size(dev); start = buf = efi_alloc(dpsize + sizeof(END)); if (!buf) return NULL; - buf = dp_fill(buf, eth_get_dev()); + buf = dp_fill(buf, dev); *((struct efi_device_path *)buf) = END; @@ -984,11 +984,13 @@ struct efi_device_path __maybe_unused *efi_dp_from_eth(void) * @ip: IPv4 local address * @mask: network mask * @srv: IPv4 remote/server address + * @dev: net udevice * Return: pointer to device path, NULL on error */ static struct efi_device_path *efi_dp_from_ipv4(struct efi_ipv4_address *ip, struct efi_ipv4_address *mask, - struct efi_ipv4_address *srv) + struct efi_ipv4_address *srv, + struct udevice *dev) { struct efi_device_path *dp1, *dp2, *pos; struct { @@ -1010,7 +1012,7 @@ static struct efi_device_path *efi_dp_from_ipv4(struct efi_ipv4_address *ip, pos = &dp.end; memcpy(pos, &END, sizeof(END)); - dp1 = efi_dp_from_eth(); + dp1 = efi_dp_from_eth(dev); if (!dp1) return NULL; @@ -1029,9 +1031,10 @@ static struct efi_device_path *efi_dp_from_ipv4(struct efi_ipv4_address *ip, * and an END node. * * @server: URI of remote server + * @dev: net udevice * Return: pointer to HTTP device path, NULL on error */ -struct efi_device_path *efi_dp_from_http(const char *server) +struct efi_device_path *efi_dp_from_http(const char *server, struct udevice *dev) { struct efi_device_path *dp1, *dp2; struct efi_device_path_uri *uridp; @@ -1045,12 +1048,13 @@ struct efi_device_path *efi_dp_from_http(const char *server) (!server && IS_ENABLED(CONFIG_NET_LWIP))) return NULL; - efi_net_get_addr(&ip, &mask, NULL); + efi_net_get_addr(&ip, &mask, NULL, dev); - dp1 = efi_dp_from_ipv4(&ip, &mask, NULL); + dp1 = efi_dp_from_ipv4(&ip, &mask, NULL, dev); if (!dp1) return NULL; + strcpy(tmp, "http://"); if (server) { @@ -1185,8 +1189,8 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr, dp = efi_dp_from_mem(EFI_RESERVED_MEMORY_TYPE, (uintptr_t)image_addr, image_size); } else if (IS_ENABLED(CONFIG_NETDEVICES) && - (!strcmp(dev, "Net") || !strcmp(dev, "Http"))) { - efi_net_get_dp(&dp); + (!strcmp(dev, "Net") || !strcmp(dev, "Http"))) { + efi_net_dp_from_dev(&dp, eth_get_dev(), false); } else if (!strcmp(dev, "Uart")) { dp = efi_dp_from_uart(); } else { |