1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-27 05:21:16 +02:00

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>
This commit is contained in:
Simon Glass
2023-08-10 19:33:18 -06:00
parent cbb607d2d9
commit c279224ea6
7 changed files with 197 additions and 6 deletions

View File

@@ -119,7 +119,16 @@ struct bootmeth_ops {
*/
int (*read_file)(struct udevice *dev, struct bootflow *bflow,
const char *file_path, ulong addr, ulong *sizep);
#if CONFIG_IS_ENABLED(BOOTSTD_FULL)
/**
* readall() - read all files for a bootflow
*
* @dev: Bootmethod device to boot
* @bflow: Bootflow to read
* Return: 0 if OK, -EIO on I/O error, other -ve on other error
*/
int (*read_all)(struct udevice *dev, struct bootflow *bflow);
#endif /* BOOTSTD_FULL */
/**
* boot() - boot a bootflow
*
@@ -223,6 +232,20 @@ int bootmeth_set_bootflow(struct udevice *dev, struct bootflow *bflow,
int bootmeth_read_file(struct udevice *dev, struct bootflow *bflow,
const char *file_path, ulong addr, ulong *sizep);
/**
* bootmeth_read_all() - read all bootflow files
*
* Some bootmeths delay reading of large files until booting is requested. This
* causes those files to be read.
*
* @dev: Bootmethod device to use
* @bflow: Bootflow to read
* Return: does not return on success, since it should boot the
* Operating Systemn. Returns -EFAULT if that fails, other -ve on
* other error
*/
int bootmeth_read_all(struct udevice *dev, struct bootflow *bflow);
/**
* bootmeth_boot() - boot a bootflow
*