diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sandbox/cpu/state.c | 14 | ||||
-rw-r--r-- | arch/sandbox/include/asm/state.h | 1 | ||||
-rw-r--r-- | arch/sandbox/include/asm/test.h | 14 |
3 files changed, 29 insertions, 0 deletions
diff --git a/arch/sandbox/cpu/state.c b/arch/sandbox/cpu/state.c index 267f280df1..69da378ab5 100644 --- a/arch/sandbox/cpu/state.c +++ b/arch/sandbox/cpu/state.c @@ -460,6 +460,20 @@ bool sandbox_eth_enabled(void) 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; diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h index f125fb87af..59a20595f5 100644 --- a/arch/sandbox/include/asm/state.h +++ b/arch/sandbox/include/asm/state.h @@ -97,6 +97,7 @@ struct sandbox_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] diff --git a/arch/sandbox/include/asm/test.h b/arch/sandbox/include/asm/test.h index 1c522e38f3..4853dc948f 100644 --- a/arch/sandbox/include/asm/test.h +++ b/arch/sandbox/include/asm/test.h @@ -360,4 +360,18 @@ void sandbox_set_eth_enable(bool enable); */ 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 |