diff options
author | Simon Glass <sjg@chromium.org> | 2023-08-10 19:33:18 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2023-08-11 07:33:38 -0600 |
commit | c279224ea6686a992b258b01e07fcadb7f0c7ecb (patch) | |
tree | 48273b66cf481b328b6a8871e14cafaedaf87123 /boot/bootmeth-uclass.c | |
parent | cbb607d2d9be44a5ded7a652e8e7646925adc1e0 (diff) |
bootstd: Add a command to read all files for a bootflow
Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.
To permit reading of these files, add a new 'bootflow read' command.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot/bootmeth-uclass.c')
-rw-r--r-- | boot/bootmeth-uclass.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/boot/bootmeth-uclass.c b/boot/bootmeth-uclass.c index 175eb1de5e..1d157d54db 100644 --- a/boot/bootmeth-uclass.c +++ b/boot/bootmeth-uclass.c @@ -61,6 +61,18 @@ int bootmeth_set_bootflow(struct udevice *dev, struct bootflow *bflow, return ops->set_bootflow(dev, bflow, buf, size); } +#if CONFIG_IS_ENABLED(BOOTSTD_FULL) +int bootmeth_read_all(struct udevice *dev, struct bootflow *bflow) +{ + const struct bootmeth_ops *ops = bootmeth_get_ops(dev); + + if (!ops->read_all) + return -ENOSYS; + + return ops->read_all(dev, bflow); +} +#endif /* BOOTSTD_FULL */ + int bootmeth_boot(struct udevice *dev, struct bootflow *bflow) { const struct bootmeth_ops *ops = bootmeth_get_ops(dev); |