aboutsummaryrefslogtreecommitdiff
path: root/include/bootmeth.h
diff options
context:
space:
mode:
authorSimon Glass2022-07-30 15:52:21 -0600
committerTom Rini2022-08-12 08:17:10 -0400
commitbc06aa035d8f78a713a3d339d45f3d05ef0f0d67 (patch)
tree4869d2b427ae2bd73839b0d254f593fa3a51f744 /include/bootmeth.h
parenta18686cda14cf0281a00fe1cd44c2647d351d4aa (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 'include/bootmeth.h')
-rw-r--r--include/bootmeth.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/bootmeth.h b/include/bootmeth.h
index 4967031a0a8..c93367b0995 100644
--- a/include/bootmeth.h
+++ b/include/bootmeth.h
@@ -13,12 +13,23 @@ struct bootflow_iter;
struct udevice;
/**
+ * enum bootmeth_flags - Flags for bootmeths
+ *
+ * @BOOTMETHF_GLOBAL: bootmeth handles bootdev selection automatically
+ */
+enum bootmeth_flags {
+ BOOTMETHF_GLOBAL = BIT(0),
+};
+
+/**
* struct bootmeth_uc_plat - information the uclass keeps about each bootmeth
*
* @desc: A long description of the bootmeth
+ * @flags: Flags for this bootmeth (enum bootmeth_flags)
*/
struct bootmeth_uc_plat {
const char *desc;
+ int flags;
};
/** struct bootmeth_ops - Operations for boot methods */
@@ -267,4 +278,16 @@ int bootmeth_alloc_file(struct bootflow *bflow, uint size_limit, uint align);
int bootmeth_common_read_file(struct udevice *dev, struct bootflow *bflow,
const char *file_path, ulong addr, ulong *sizep);
+/**
+ * bootmeth_get_bootflow() - Get a bootflow from a global bootmeth
+ *
+ * Check the bootmeth for a bootflow which can be used. In this case the
+ * bootmeth handles all bootdev selection, etc.
+ *
+ * @dev: bootmeth device to read from
+ * @bflow: Bootflow information
+ * @return 0 on success, -ve if a bootflow could not be found or had an error
+ */
+int bootmeth_get_bootflow(struct udevice *dev, struct bootflow *bflow);
+
#endif