summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTekkaman Ninja <tekkamanninja@163.com>2021-10-24 09:32:36 +0300
committerTekkaman Ninja <tekkamanninja@163.com>2022-02-15 12:48:25 +0300
commit0b5dbb97f160cf84c64f31310e4e7e6e4297a7ca (patch)
tree580af39f12e27213a3ce5538d57002f48cbfcb6f
parent73009927d3885f533d500069159dc03925705d2d (diff)
downloadu-boot-0b5dbb97f160cf84c64f31310e4e7e6e4297a7ca.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/Kconfig2
-rw-r--r--lib/efi_loader/efi_device_path.c23
2 files changed, 23 insertions, 2 deletions
diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
index e5e35fe51f..8065b0782d 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 dc787b4d3d..7cd9a51b59 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);
@@ -1008,18 +1008,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;