summaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-01-17 10:48:07 -0700
committerTom Rini <trini@konsulko.com>2023-01-23 18:11:41 -0500
commit79a7d4a61ff34c7745811c7b3090a60b230c2ef9 (patch)
treec695ce097337e6cf870d2e013d436ed50df3e3c7 /boot
parentd73420e4fe7c7e22a41ed140c6be9c11db6b9503 (diff)
bootstd: Allow hunting for bootdevs of a given priority
Add a way to run the hunter function for a particular priority, so that new bootdevs can be found. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot')
-rw-r--r--boot/bootdev-uclass.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/boot/bootdev-uclass.c b/boot/bootdev-uclass.c
index 7ac42afd7b..e8686159f2 100644
--- a/boot/bootdev-uclass.c
+++ b/boot/bootdev-uclass.c
@@ -742,6 +742,31 @@ int bootdev_hunt(const char *spec, bool show)
return result;
}
+int bootdev_hunt_prio(enum bootdev_prio_t prio, bool show)
+{
+ struct bootdev_hunter *start;
+ int n_ent, i;
+ int result;
+
+ start = ll_entry_start(struct bootdev_hunter, bootdev_hunter);
+ n_ent = ll_entry_count(struct bootdev_hunter, bootdev_hunter);
+ result = 0;
+
+ log_debug("Hunting for priority %d\n", prio);
+ for (i = 0; i < n_ent; i++) {
+ struct bootdev_hunter *info = start + i;
+ int ret;
+
+ if (prio != info->prio)
+ continue;
+ ret = bootdev_hunt_drv(info, i, show);
+ if (ret && ret != -ENOENT)
+ result = ret;
+ }
+
+ return result;
+}
+
void bootdev_list_hunters(struct bootstd_priv *std)
{
struct bootdev_hunter *orig, *start;