aboutsummaryrefslogtreecommitdiff
path: root/include/bootmeth.h
diff options
context:
space:
mode:
authorSimon Glass2023-08-10 19:33:18 -0600
committerSimon Glass2023-08-11 07:33:38 -0600
commitc279224ea6686a992b258b01e07fcadb7f0c7ecb (patch)
tree48273b66cf481b328b6a8871e14cafaedaf87123 /include/bootmeth.h
parentcbb607d2d9be44a5ded7a652e8e7646925adc1e0 (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 'include/bootmeth.h')
-rw-r--r--include/bootmeth.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/include/bootmeth.h b/include/bootmeth.h
index 7cb7da33dea..d3d8d608cd7 100644
--- a/include/bootmeth.h
+++ b/include/bootmeth.h
@@ -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
*
@@ -224,6 +233,20 @@ 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
*
* @dev: Bootmethod device to boot