summaryrefslogtreecommitdiff
path: root/include/bootflow.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-07-30 15:52:25 -0600
committerTom Rini <trini@konsulko.com>2022-08-12 08:17:11 -0400
commit2b80bc1eee28c20173c09ee5d887cce02097552f (patch)
tree5e83bafebd8fbc218b0d5180075ef2354dcf26f4 /include/bootflow.h
parentee47d4af059aec024d2ac374e93089daa4bee324 (diff)
downloadu-boot-2b80bc1eee28c20173c09ee5d887cce02097552f.tar.gz
bootstd: Support bootflows with global bootmeths
Add support for handling this concept in bootflows. Update the 'bootflow' command to allow only the normal bootmeths to be used. This alllows skipping EFI bootmgr and VBE, for example. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/bootflow.h')
-rw-r--r--include/bootflow.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/bootflow.h b/include/bootflow.h
index 4fa482a678..6aa3d1fff8 100644
--- a/include/bootflow.h
+++ b/include/bootflow.h
@@ -77,12 +77,14 @@ struct bootflow {
* @BOOTFLOWF_SHOW: Show each bootdev before scanning it
* @BOOTFLOWF_ALL: Return bootflows with errors as well
* @BOOTFLOWF_SINGLE_DEV: Just scan one bootmeth
+ * @BOOTFLOWF_SKIP_GLOBAL: Don't scan global bootmeths
*/
enum bootflow_flags_t {
BOOTFLOWF_FIXED = 1 << 0,
BOOTFLOWF_SHOW = 1 << 1,
BOOTFLOWF_ALL = 1 << 2,
BOOTFLOWF_SINGLE_DEV = 1 << 3,
+ BOOTFLOWF_SKIP_GLOBAL = 1 << 4,
};
/**
@@ -102,8 +104,10 @@ enum bootflow_flags_t {
* updated to a larger value, no less than the number of available partitions.
* This ensures that iteration works through all partitions on the bootdev.
*
- * @flags: Flags to use (see enum bootflow_flags_t)
- * @dev: Current bootdev
+ * @flags: Flags to use (see enum bootflow_flags_t). If BOOTFLOWF_GLOBAL_FIRST is
+ * enabled then the global bootmeths are being scanned, otherwise we have
+ * moved onto the bootdevs
+ * @dev: Current bootdev, NULL if none
* @part: Current partition number (0 for whole device)
* @method: Current bootmeth
* @max_part: Maximum hardware partition number in @dev, 0 if there is no
@@ -117,7 +121,11 @@ enum bootflow_flags_t {
* with the first one on the list
* @num_methods: Number of bootmeth devices in @method_order
* @cur_method: Current method number, an index into @method_order
- * @method_order: List of bootmeth devices to use, in order
+ * @first_glob_method: First global method, if any, else -1
+ * @method_order: List of bootmeth devices to use, in order. The normal methods
+ * appear first, then the global ones, if any
+ * @doing_global: true if we are iterating through the global bootmeths (which
+ * happens before the normal ones)
*/
struct bootflow_iter {
int flags;
@@ -131,7 +139,9 @@ struct bootflow_iter {
struct udevice **dev_order;
int num_methods;
int cur_method;
+ int first_glob_method;
struct udevice **method_order;
+ bool doing_global;
};
/**