SHA256
1
0
forked from pool/u-boot
u-boot/0019-bootstd-Expand-boot-ordering-test-t.patch
Dirk Mueller f39b767ea5 Accepting request 1120007 from home:mbrugger:branches:hardware:boot
Fix boo#1216036. Tested on RPi4. Boot from USB and uSD fine.
For details see: https://lore.kernel.org/u-boot/20231023070216.394709-1-sjg@chromium.org/#t
* Patches added:
  0018-Revert-bootstd-Scan-all-bootdevs-in.patch
  0019-bootstd-Expand-boot-ordering-test-t.patch
  0020-bootstd-Correct-logic-for-single-uc.patch
  0021-bootstd-Scan-all-bootdevs-in-a-boot.patch

OBS-URL: https://build.opensuse.org/request/show/1120007
OBS-URL: https://build.opensuse.org/package/show/hardware:boot/u-boot?expand=0&rev=201
2023-10-26 06:37:38 +00:00

60 lines
2.1 KiB
Diff

From 7d7d42a872edc05d43089d0e4e8540fd4948d515 Mon Sep 17 00:00:00 2001
From: Simon Glass <sjg@chromium.org>
Date: Mon, 23 Oct 2023 00:02:11 -0700
Subject: [PATCH] bootstd: Expand boot-ordering test to include USB
Scan the USB bus as well, so we can check that different uclasses work
correctly in boot_targets
update the function comment with more detail.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
test/boot/bootdev.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/test/boot/bootdev.c b/test/boot/bootdev.c
index 6b29213416d..7228f545e9e 100644
--- a/test/boot/bootdev.c
+++ b/test/boot/bootdev.c
@@ -190,12 +190,21 @@ static int bootdev_test_any(struct unit_test_state *uts)
BOOTSTD_TEST(bootdev_test_any, UT_TESTF_DM | UT_TESTF_SCAN_FDT |
UT_TESTF_ETH_BOOTDEV);
-/* Check bootdev ordering with the bootdev-order property */
+/*
+ * Check bootdev ordering with the bootdev-order property and boot_targets
+ * environment variable
+ */
static int bootdev_test_order(struct unit_test_state *uts)
{
struct bootflow_iter iter;
struct bootflow bflow;
+ test_set_skip_delays(true);
+
+ /* Start up USB which gives us three additional bootdevs */
+ usb_started = false;
+ ut_assertok(run_command("usb start", 0));
+
/*
* First try the order set by the bootdev-order property
* Like all sandbox unit tests this relies on the devicetree setting up
@@ -213,12 +222,14 @@ static int bootdev_test_order(struct unit_test_state *uts)
bootflow_iter_uninit(&iter);
/* Use the environment variable to override it */
- ut_assertok(env_set("boot_targets", "mmc1 mmc2"));
+ ut_assertok(env_set("boot_targets", "mmc1 mmc2 usb"));
ut_assertok(bootflow_scan_first(NULL, NULL, &iter, 0, &bflow));
ut_asserteq(-ENODEV, bootflow_scan_next(&iter, &bflow));
- ut_asserteq(2, iter.num_devs);
+ ut_asserteq(3, iter.num_devs);
ut_asserteq_str("mmc1.bootdev", iter.dev_used[0]->name);
ut_asserteq_str("mmc2.bootdev", iter.dev_used[1]->name);
+ ut_asserteq_str("usb_mass_storage.lun0.bootdev",
+ iter.dev_used[2]->name);
bootflow_iter_uninit(&iter);
return 0;