aboutsummaryrefslogtreecommitdiff
path: root/include/bootdev.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-01-17 10:48:14 -0700
committerTom Rini <trini@konsulko.com>2023-01-23 18:11:41 -0500
commit47aedc29dcb9871e076f6e4aa82004633af513ef (patch)
tree0a7d94b5f9dc82da793ec6e49388c8527754d732 /include/bootdev.h
parent18552d2a7288afd6f125b4ac99e5c27690c129b4 (diff)
downloadu-boot-47aedc29dcb9871e076f6e4aa82004633af513ef.zip
u-boot-47aedc29dcb9871e076f6e4aa82004633af513ef.tar.gz
u-boot-47aedc29dcb9871e076f6e4aa82004633af513ef.tar.bz2
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/bootdev.h')
-rw-r--r--include/bootdev.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/include/bootdev.h b/include/bootdev.h
index 4b6a8eb..8fa6748 100644
--- a/include/bootdev.h
+++ b/include/bootdev.h
@@ -265,21 +265,22 @@ int bootdev_find_by_any(const char *name, struct udevice **devp,
int *method_flagsp);
/**
- * bootdev_setup_iter_order() - Set up the ordering of bootdevs to scan
+ * bootdev_setup_iter() - Set up iteration through bootdevs
*
- * This sets up the ordering information in @iter, based on the priority of each
- * bootdev and the bootdev-order property in the bootstd node
- *
- * If a single device is requested, no ordering is needed
+ * This sets up the an interation, based on the priority of each bootdev, the
+ * bootdev-order property in the bootstd node (or the boot_targets env var).
*
* @iter: Iterator to update with the order
* @devp: On entry, *devp is NULL to scan all, otherwise this is the (single)
* device to scan. Returns the first device to use, which is the passed-in
* @devp if it was non-NULL
+ * @method_flagsp: If non-NULL, returns any flags implied by the label
+ * (enum bootflow_meth_flags_t), 0 if none
* Return: 0 if OK, -ENOENT if no bootdevs, -ENOMEM if out of memory, other -ve
* on other error
*/
-int bootdev_setup_iter_order(struct bootflow_iter *iter, struct udevice **devp);
+int bootdev_setup_iter(struct bootflow_iter *iter, struct udevice **devp,
+ int *method_flagsp);
/**
* bootdev_list_hunters() - List the available bootdev hunters