From 66e3dce78750f6fc4f6a402ce62c20ba95976dd1 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 17 Jan 2023 10:48:09 -0700 Subject: bootstd: Allow hunting for a bootdev by label Add a function to hunt for a bootdev label and find the bootdev produced by the hunter (or already present). Add a few extra flags so that we can distinguish between "mmc1", "mmc" and "1" which all need to be handled differently. Signed-off-by: Simon Glass --- test/boot/bootstd_common.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/boot/bootstd_common.h') diff --git a/test/boot/bootstd_common.h b/test/boot/bootstd_common.h index c5e0fd1ceab..0eb48fa1537 100644 --- a/test/boot/bootstd_common.h +++ b/test/boot/bootstd_common.h @@ -40,4 +40,12 @@ int bootstd_test_drop_bootdev_order(struct unit_test_state *uts); */ int bootstd_setup_for_tests(void); +/** + * bootstd_test_check_mmc_hunter() - Check that the mmc bootdev hunter was used + * + * @uts: Unit test state to use for ut_assert...() functions + * Returns: 0 if OK (used), other value on error (not used) + */ +int bootstd_test_check_mmc_hunter(struct unit_test_state *uts); + #endif -- cgit v1.2.3 From 18552d2a7288afd6f125b4ac99e5c27690c129b4 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 17 Jan 2023 10:48:13 -0700 Subject: bootstd: Add a hunter for the extension feature This needs to run before any bootdev is used, so add a hunter for it. Signed-off-by: Simon Glass --- test/boot/bootstd_common.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/boot/bootstd_common.h') diff --git a/test/boot/bootstd_common.h b/test/boot/bootstd_common.h index 0eb48fa1537..136a79b5178 100644 --- a/test/boot/bootstd_common.h +++ b/test/boot/bootstd_common.h @@ -20,6 +20,11 @@ #define TEST_VERSION "U-Boot v2022.04-local2" #define TEST_VERNUM 0x00010002 +enum { + MAX_HUNTER = 8, + MMC_HUNTER = 3, /* ID of MMC hunter */ +}; + struct unit_test_state; /** -- cgit v1.2.3