The EFI boot manager requires access to all block devices and to network.
So hunting of bootdevs must have been completed. It does not require
DHCP to have completed. So priority-wise it fits best after all bootdevs
except for the 'dummy' network boot devices used for PXE booting.

Create a new bootdev priority for the EFI boot manager which is sorted
after all other bootdevs except network.

Signed-off-by: Heinrich Schuchardt <heinrich.schucha...@canonical.com>
---
 include/bootdev.h | 10 ++++++----
 net/eth_bootdev.c |  4 ++--
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/include/bootdev.h b/include/bootdev.h
index 12c90c4ec1b..6f46451da73 100644
--- a/include/bootdev.h
+++ b/include/bootdev.h
@@ -36,9 +36,10 @@ struct udevice;
  * @BOOTDEVP_5_SCAN_SLOW: Extenal devices which need scanning or bus
  * enumeration to find. The enumeration takes significant fraction of a second
  * to complete
- * @BOOTDEVP_6_NET_BASE: Basic network devices which are quickly and easily
+ * @BOOTDEVP_6_EFI: EFI boot manager
+ * @BOOTDEVP_7_NET_BASE: Basic network devices which are quickly and easily
  * available. Typically used for an internal Ethernet device
- * @BOOTDEVP_7_NET_FALLBACK: Secondary network devices which require extra time
+ * @BOOTDEVP_8_NET_FALLBACK: Secondary network devices which require extra time
  * to start up, or are less desirable. Typically used for secondary Ethernet
  * devices. Note that USB ethernet devices are found during USB enumeration,
  * so do not use this priority
@@ -50,8 +51,9 @@ enum bootdev_prio_t {
        BOOTDEVP_3_INTERNAL_SLOW,
        BOOTDEVP_4_SCAN_FAST,
        BOOTDEVP_5_SCAN_SLOW,
-       BOOTDEVP_6_NET_BASE,
-       BOOTDEVP_7_NET_FALLBACK,
+       BOOTDEVP_6_EFI,
+       BOOTDEVP_7_NET_BASE,
+       BOOTDEVP_8_NET_FALLBACK,
 
        BOOTDEVP_COUNT,
 };
diff --git a/net/eth_bootdev.c b/net/eth_bootdev.c
index b0fca6e8313..dd071853886 100644
--- a/net/eth_bootdev.c
+++ b/net/eth_bootdev.c
@@ -59,7 +59,7 @@ static int eth_bootdev_bind(struct udevice *dev)
 {
        struct bootdev_uc_plat *ucp = dev_get_uclass_plat(dev);
 
-       ucp->prio = BOOTDEVP_6_NET_BASE;
+       ucp->prio = BOOTDEVP_7_NET_BASE;
 
        return 0;
 }
@@ -117,7 +117,7 @@ U_BOOT_DRIVER(eth_bootdev) = {
 };
 
 BOOTDEV_HUNTER(eth_bootdev_hunt) = {
-       .prio           = BOOTDEVP_6_NET_BASE,
+       .prio           = BOOTDEVP_7_NET_BASE,
        .uclass         = UCLASS_ETH,
        .hunt           = eth_bootdev_hunt,
        .drv            = DM_DRIVER_REF(eth_bootdev),
-- 
2.48.1

Reply via email to