aboutsummaryrefslogtreecommitdiff
path: root/test/boot
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-09-23 14:50:15 -0600
committerSimon Glass <sjg@chromium.org>2023-10-13 10:15:41 -0700
commite824d0d0c219bc6da767f13f90c5b00eefe929f0 (patch)
tree9fcc524f96e053a341f09cbac5bed17008dd697e /test/boot
parentd5d24e2e0a3f54175e458d89acd626da939e1130 (diff)
downloadu-boot-e824d0d0c219bc6da767f13f90c5b00eefe929f0.tar.gz
bootstd: Scan all bootdevs in a boot_targets entry
When the boot_targets environment variable is used with the distro-boot scripts, each device is included individually. For example, if there are three mmc devices, then we will have something like: boot_targets="mmc0 mmc1 mmc2" In contrast, standard boot supports specifying just the uclass, i.e.: boot_targets="mmc" The intention is that this should scan all MMC devices, but in fact it currently only scans the first. Update the logic to handle this case, without required BOOTSTD_FULL to be enabled. I believe at least three people reported this, but I found two. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Date Huang <tjjh89017@hotmail.com> Reported-by: Vincent Stehlé <vincent.stehle@arm.com>
Diffstat (limited to 'test/boot')
-rw-r--r--test/boot/bootdev.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/boot/bootdev.c b/test/boot/bootdev.c
index 6b29213416..c5f14a7a13 100644
--- a/test/boot/bootdev.c
+++ b/test/boot/bootdev.c
@@ -221,6 +221,16 @@ static int bootdev_test_order(struct unit_test_state *uts)
ut_asserteq_str("mmc2.bootdev", iter.dev_used[1]->name);
bootflow_iter_uninit(&iter);
+ /* Make sure it scans a bootdevs in each target */
+ ut_assertok(env_set("boot_targets", "mmc spi"));
+ ut_asserteq(0, bootflow_scan_first(NULL, NULL, &iter, 0, &bflow));
+ ut_asserteq(-ENODEV, bootflow_scan_next(&iter, &bflow));
+ ut_asserteq(3, iter.num_devs);
+ ut_asserteq_str("mmc2.bootdev", iter.dev_used[0]->name);
+ ut_asserteq_str("mmc1.bootdev", iter.dev_used[1]->name);
+ ut_asserteq_str("mmc0.bootdev", iter.dev_used[2]->name);
+ bootflow_iter_uninit(&iter);
+
return 0;
}
BOOTSTD_TEST(bootdev_test_order, UT_TESTF_DM | UT_TESTF_SCAN_FDT);