return !state->disable_eth;
}
+void sandbox_sf_set_enable_bootdevs(bool enable)
+{
+ struct sandbox_state *state = state_get_current();
+
+ state->disable_sf_bootdevs = !enable;
+}
+
+bool sandbox_sf_bootdev_enabled(void)
+{
+ struct sandbox_state *state = state_get_current();
+
+ return !state->disable_sf_bootdevs;
+}
+
int state_init(void)
{
state = &main_state;
bool handle_signals; /* Handle signals within sandbox */
bool autoboot_keyed; /* Use keyed-autoboot feature */
bool disable_eth; /* Disable Ethernet devices */
+ bool disable_sf_bootdevs; /* Don't bind SPI flash bootdevs */
/* Pointer to information for each SPI bus/cs */
struct sandbox_spi_info spi[CONFIG_SANDBOX_SPI_MAX_BUS]
*/
bool sandbox_eth_enabled(void);
+/**
+ * sandbox_sf_bootdev_enabled() - Check if SPI flash bootdevs should be bound
+ *
+ * Returns: true if sandbox should bind bootdevs for SPI flash, false if not
+ */
+bool sandbox_sf_bootdev_enabled(void);
+
+/**
+ * sandbox_sf_set_enable_bootdevs() - Enable / disable the SPI flash bootdevs
+ *
+ * @enable: true to bind the SPI flash bootdevs, false to skip
+ */
+void sandbox_sf_set_enable_bootdevs(bool enable);
+
#endif
*/
UT_TESTF_MANUAL = BIT(8),
UT_TESTF_ETH_BOOTDEV = BIT(9), /* enable Ethernet bootdevs */
+ UT_TESTF_SF_BOOTDEV = BIT(10), /* enable SPI flash bootdevs */
};
/**
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 */
* only set this if we know the ethernet uclass will be created
*/
eth_set_enable_bootdevs(test->flags & UT_TESTF_ETH_BOOTDEV);
+ test_sf_set_enable_bootdevs(test->flags & UT_TESTF_SF_BOOTDEV);
ut_assertok(dm_extended_scan(false));
}