Skip to content
Snippets Groups Projects
Commit dc6f4d3a authored by Simon Glass's avatar Simon Glass
Browse files

sandbox: Support multiple reset types


Add settings for the last reset generated, and the types of resets which
are permitted. This will be used for testing.

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
parent 6a1c7cef
No related branches found
No related tags found
No related merge requests found
...@@ -345,6 +345,10 @@ int state_init(void) ...@@ -345,6 +345,10 @@ int state_init(void)
state->ram_buf = os_malloc(state->ram_size); state->ram_buf = os_malloc(state->ram_size);
assert(state->ram_buf); assert(state->ram_buf);
/* No reset yet, so mark it as such. Always allow power reset */
state->last_reset = RESET_COUNT;
state->reset_allowed[RESET_POWER] = true;
/* /*
* Example of how to use GPIOs: * Example of how to use GPIOs:
* *
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#define __SANDBOX_STATE_H #define __SANDBOX_STATE_H
#include <config.h> #include <config.h>
#include <reset.h>
#include <stdbool.h> #include <stdbool.h>
#include <linux/stringify.h> #include <linux/stringify.h>
...@@ -59,6 +60,8 @@ struct sandbox_state { ...@@ -59,6 +60,8 @@ struct sandbox_state {
bool write_state; /* Write sandbox state on exit */ bool write_state; /* Write sandbox state on exit */
bool ignore_missing_state_on_read; /* No error if state missing */ bool ignore_missing_state_on_read; /* No error if state missing */
bool show_lcd; /* Show LCD on start-up */ bool show_lcd; /* Show LCD on start-up */
enum reset_t last_reset; /* Last reset type */
bool reset_allowed[RESET_COUNT]; /* Allowed reset types */
enum state_terminal_raw term_raw; /* Terminal raw/cooked */ enum state_terminal_raw term_raw; /* Terminal raw/cooked */
/* Pointer to information for each SPI bus/cs */ /* Pointer to information for each SPI bus/cs */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment