aboutsummaryrefslogtreecommitdiff
path: root/include/test
diff options
context:
space:
mode:
authorSimon Glass2023-01-17 10:48:02 -0700
committerTom Rini2023-01-23 18:11:41 -0500
commit081bdc52c158dd3a4f73910cde3d7e70a5932d56 (patch)
tree9698094a3e2a36c06e054c17d9e820d0cb11017f /include/test
parent22061d3d2ad10e1c67e36282a8c97f505a62c252 (diff)
sandbox: Allow SPI flash bootdevs to be disabled for tests
Most tests don't want these and they can create a lot of noise. Add a way to disable them. Use that in tests, with a flag provided to enable them for tests that need this feature. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/test')
-rw-r--r--include/test/test.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/test/test.h b/include/test/test.h
index 752897cf06f..838e3ce8a8f 100644
--- a/include/test/test.h
+++ b/include/test/test.h
@@ -72,6 +72,7 @@ enum {
*/
UT_TESTF_MANUAL = BIT(8),
UT_TESTF_ETH_BOOTDEV = BIT(9), /* enable Ethernet bootdevs */
+ UT_TESTF_SF_BOOTDEV = BIT(10), /* enable SPI flash bootdevs */
};
/**
@@ -222,4 +223,22 @@ static inline bool test_eth_bootdev_enabled(void)
return enabled;
}
+/* Allow SPI flash bootdev to be ignored for testing purposes */
+static inline bool test_sf_bootdev_enabled(void)
+{
+ bool enabled = true;
+
+#ifdef CONFIG_SANDBOX
+ enabled = sandbox_sf_bootdev_enabled();
+#endif
+ return enabled;
+}
+
+static inline void test_sf_set_enable_bootdevs(bool enable)
+{
+#ifdef CONFIG_SANDBOX
+ sandbox_sf_set_enable_bootdevs(enable);
+#endif
+}
+
#endif /* __TEST_TEST_H */