diff options
author | Simon Glass | 2023-01-17 10:48:14 -0700 |
---|---|---|
committer | Tom Rini | 2023-01-23 18:11:41 -0500 |
commit | 47aedc29dcb9871e076f6e4aa82004633af513ef (patch) | |
tree | 0a7d94b5f9dc82da793ec6e49388c8527754d732 /include/bootflow.h | |
parent | 18552d2a7288afd6f125b4ac99e5c27690c129b4 (diff) |
bootstd: Switch bootdev scanning to use labels
At present we set up the bootdev order at the start, then scan the
bootdevs one by one.
However this approach cannot be used with hunters, since the bootdevs may
not exist until the hunter is used. Nor can we just run all the hunters at
the start, since that violate's U-Boot's 'lazy init' requirement. It also
increases boot time.
So we need to adjust the algorithm to scan by labels instead. As a first
step, drop the dev_order[] array in favour of a list of labels. Update the
name of bootdev_setup_iter_order() to better reflect what it does.
Update some related comments and log messages. Also disable a few tests
until a later commit where we can use them.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/bootflow.h')
-rw-r--r-- | include/bootflow.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/include/bootflow.h b/include/bootflow.h index 69ac90483c6..bdb37352ab9 100644 --- a/include/bootflow.h +++ b/include/bootflow.h @@ -163,7 +163,8 @@ enum bootflow_meth_flags_t { * @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 + * @dev: Current bootdev, NULL if none. This is only ever updated in + * bootflow_iter_set_dev() * @part: Current partition number (0 for whole device) * @method: Current bootmeth * @max_part: Maximum hardware partition number in @dev, 0 if there is no @@ -173,9 +174,6 @@ enum bootflow_meth_flags_t { * forward (e.g. to skip the current partition because it is not valid) * -ESHUTDOWN: try next bootdev * @num_devs: Number of bootdevs in @dev_order - * @cur_dev: Current bootdev number, an index into @dev_order[] - * @dev_order: List of bootdevs to scan, in order of priority. The scan starts - * with the first one on the list * @labels: List of labels to scan for bootdevs * @cur_label: Current label being processed * @num_methods: Number of bootmeth devices in @method_order @@ -198,8 +196,6 @@ struct bootflow_iter { int first_bootable; int err; int num_devs; - int cur_dev; - struct udevice **dev_order; const char *const *labels; int cur_label; int num_methods; |