summaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
Diffstat (limited to 'boot')
-rw-r--r--boot/Kconfig7
-rw-r--r--boot/bootmeth-uclass.c14
-rw-r--r--boot/bootmeth_efi_mgr.c3
3 files changed, 23 insertions, 1 deletions
diff --git a/boot/Kconfig b/boot/Kconfig
index a294ad769ed..b8db8cd7961 100644
--- a/boot/Kconfig
+++ b/boot/Kconfig
@@ -349,6 +349,13 @@ config BOOTSTD_BOOTCOMMAND
standard boot does not support all of the features of distro boot
yet.
+config BOOTMETH_GLOBAL
+ bool
+ help
+ Add support for global bootmeths. This feature is used by VBE and
+ EFI bootmgr, since they take full control over which bootdevs are
+ selected to boot.
+
config BOOTMETH_DISTRO
bool "Bootdev support for distro boot"
select PXE_UTILS
diff --git a/boot/bootmeth-uclass.c b/boot/bootmeth-uclass.c
index 1e276c0f26b..88bbb32c47f 100644
--- a/boot/bootmeth-uclass.c
+++ b/boot/bootmeth-uclass.c
@@ -71,6 +71,20 @@ int bootmeth_read_file(struct udevice *dev, struct bootflow *bflow,
return ops->read_file(dev, bflow, file_path, addr, sizep);
}
+int bootmeth_get_bootflow(struct udevice *dev, struct bootflow *bflow)
+{
+ const struct bootmeth_ops *ops = bootmeth_get_ops(dev);
+
+ if (!ops->read_bootflow)
+ return -ENOSYS;
+ memset(bflow, '\0', sizeof(*bflow));
+ bflow->dev = NULL;
+ bflow->method = dev;
+ bflow->state = BOOTFLOWST_BASE;
+
+ return ops->read_bootflow(dev, bflow);
+}
+
/**
* bootmeth_setup_iter_order() - Set up the ordering of bootmeths to scan
*
diff --git a/boot/bootmeth_efi_mgr.c b/boot/bootmeth_efi_mgr.c
index a6914466db7..08d9328af4e 100644
--- a/boot/bootmeth_efi_mgr.c
+++ b/boot/bootmeth_efi_mgr.c
@@ -61,6 +61,7 @@ static int bootmeth_efi_mgr_bind(struct udevice *dev)
struct bootmeth_uc_plat *plat = dev_get_uclass_plat(dev);
plat->desc = "EFI bootmgr flow";
+ plat->flags = BOOTMETHF_GLOBAL;
return 0;
}
@@ -77,7 +78,7 @@ static const struct udevice_id efi_mgr_bootmeth_ids[] = {
{ }
};
-U_BOOT_DRIVER(bootmeth_zefi_mgr) = {
+U_BOOT_DRIVER(bootmeth_efi_mgr) = {
.name = "bootmeth_efi_mgr",
.id = UCLASS_BOOTMETH,
.of_match = efi_mgr_bootmeth_ids,