aboutsummaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-01-17 10:48:17 -0700
committerTom Rini <trini@konsulko.com>2023-01-23 18:11:41 -0500
commita950f2855a5fcc1e550aa6786720a3a995b1ceda (patch)
treedc3e9babc6e6bbbaa5e4841cffab95f7fb4bcdbf /boot
parent4b7cb058df35222632efa3f71aad63757b226440 (diff)
downloadu-boot-a950f2855a5fcc1e550aa6786720a3a995b1ceda.zip
u-boot-a950f2855a5fcc1e550aa6786720a3a995b1ceda.tar.gz
u-boot-a950f2855a5fcc1e550aa6786720a3a995b1ceda.tar.bz2
bootstd: Record the bootdevs used during scanning
Add a way to record the bootdevs used when scanning for bootflows. This is useful for testing. Enable this only with BOOTSTD_FULL and do the same for the progress reporting. Re-enable and update the affected tests now that we have this feature. For bootdev_test_order_default() there is no-longer any support for using the bootdev aliases to specify an ordering, so drop that part of the test. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot')
-rw-r--r--boot/bootflow.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/boot/bootflow.c b/boot/bootflow.c
index 750732f..03a180b 100644
--- a/boot/bootflow.c
+++ b/boot/bootflow.c
@@ -88,6 +88,9 @@ void bootflow_iter_init(struct bootflow_iter *iter, int flags)
memset(iter, '\0', sizeof(*iter));
iter->first_glob_method = -1;
iter->flags = flags;
+
+ /* remember the first bootdevs we see */
+ iter->max_devs = BOOTFLOW_MAX_USED_DEVS;
}
void bootflow_iter_uninit(struct bootflow_iter *iter)
@@ -131,16 +134,22 @@ static void bootflow_iter_set_dev(struct bootflow_iter *iter,
iter->dev = dev;
iter->method_flags = method_flags;
- if ((iter->flags & (BOOTFLOWF_SHOW | BOOTFLOWF_SINGLE_DEV)) ==
- BOOTFLOWF_SHOW) {
- if (dev)
- printf("Scanning bootdev '%s':\n", dev->name);
- else if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL) &&
- ucp->flags & BOOTMETHF_GLOBAL)
- printf("Scanning global bootmeth '%s':\n",
- iter->method->name);
- else
- printf("No more bootdevs\n");
+ if (IS_ENABLED(CONFIG_BOOTSTD_FULL)) {
+ /* record the device for later */
+ if (dev && iter->num_devs < iter->max_devs)
+ iter->dev_used[iter->num_devs++] = dev;
+
+ if ((iter->flags & (BOOTFLOWF_SHOW | BOOTFLOWF_SINGLE_DEV)) ==
+ BOOTFLOWF_SHOW) {
+ if (dev)
+ printf("Scanning bootdev '%s':\n", dev->name);
+ else if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL) &&
+ ucp->flags & BOOTMETHF_GLOBAL)
+ printf("Scanning global bootmeth '%s':\n",
+ iter->method->name);
+ else
+ printf("No more bootdevs\n");
+ }
}
}