diff options
author | Simon Glass <sjg@chromium.org> | 2022-07-30 15:52:21 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-08-12 08:17:10 -0400 |
commit | bc06aa035d8f78a713a3d339d45f3d05ef0f0d67 (patch) | |
tree | 4869d2b427ae2bd73839b0d254f593fa3a51f744 /boot/bootmeth-uclass.c | |
parent | a18686cda14cf0281a00fe1cd44c2647d351d4aa (diff) |
bootstd: Allow bootmeths to be marked as global
The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.
Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot/bootmeth-uclass.c')
-rw-r--r-- | boot/bootmeth-uclass.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/boot/bootmeth-uclass.c b/boot/bootmeth-uclass.c index 1e276c0f26..88bbb32c47 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 * |