diff options
author | Tekkaman Ninja <tekkamanninja@163.com> | 2021-10-24 09:32:36 +0300 |
---|---|---|
committer | Tekkaman Ninja <tekkamanninja@163.com> | 2021-12-29 17:41:12 +0300 |
commit | 7b51fc59d48f25d2922e0db0c923566e97a00446 (patch) | |
tree | 016fccb6015e50414106621966986fc8b85198bc | |
parent | 4f647d9215b969bbea270d30f51240acfcdfaed1 (diff) | |
download | u-boot-7b51fc59d48f25d2922e0db0c923566e97a00446.tar.xz |
[TEMP]jh7100: remove "depends on DM_ETH || !NET" in EFI_LOADER
This patch reverses some part of change in:
commit eac6e0b7979440b889703196f383191c335e7599
Author: Simon Glass <sjg@chromium.org>
Date: Fri Sep 24 18:30:17 2021 -0600
efi_loader: Drop code that doesn't work with driver model
...
Since JH7100 ETH driver haven't supported DM yet.
-rw-r--r-- | lib/efi_loader/Kconfig | 2 | ||||
-rw-r--r-- | lib/efi_loader/efi_device_path.c | 23 |
2 files changed, 23 insertions, 2 deletions
diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index 24f9a2bb75..72797fbebf 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -11,7 +11,7 @@ config EFI_LOADER # We need EFI_STUB_32BIT to be set on x86_32 with EFI_STUB depends on !EFI_STUB || !X86 || X86_64 || EFI_STUB_32BIT depends on BLK - depends on DM_ETH || !NET + #depends on DM_ETH || !NET depends on !EFI_APP default y if !ARM || SYS_CPU = armv7 || SYS_CPU = armv8 select LIB_UUID diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c index 735ed0bd0f..eb884a8179 100644 --- a/lib/efi_loader/efi_device_path.c +++ b/lib/efi_loader/efi_device_path.c @@ -587,7 +587,7 @@ __maybe_unused static void *dp_fill(void *buf, struct udevice *dev) *vdp = ROOT; return &vdp[1]; } -#ifdef CONFIG_NET +#ifdef CONFIG_DM_ETH case UCLASS_ETH: { struct efi_device_path_mac_addr *dp = dp_fill(buf, dev->parent); @@ -1018,18 +1018,39 @@ struct efi_device_path *efi_dp_from_uart(void) #ifdef CONFIG_NET struct efi_device_path *efi_dp_from_eth(void) { +#ifndef CONFIG_DM_ETH + struct efi_device_path_mac_addr *ndp; +#endif void *buf, *start; unsigned dpsize = 0; assert(eth_get_dev()); +#ifdef CONFIG_DM_ETH dpsize += dp_size(eth_get_dev()); +#else + dpsize += sizeof(ROOT); + dpsize += sizeof(*ndp); +#endif start = buf = dp_alloc(dpsize + sizeof(END)); if (!buf) return NULL; +#ifdef CONFIG_DM_ETH buf = dp_fill(buf, eth_get_dev()); +#else + memcpy(buf, &ROOT, sizeof(ROOT)); + buf += sizeof(ROOT); + + ndp = buf; + ndp->dp.type = DEVICE_PATH_TYPE_MESSAGING_DEVICE; + ndp->dp.sub_type = DEVICE_PATH_SUB_TYPE_MSG_MAC_ADDR; + ndp->dp.length = sizeof(*ndp); + ndp->if_type = 1; /* Ethernet */ + memcpy(ndp->mac.addr, eth_get_ethaddr(), ARP_HLEN); + buf = &ndp[1]; +#endif *((struct efi_device_path *)buf) = END; |