summaryrefslogtreecommitdiff
path: root/arch/sandbox/include/asm/state.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-11-08 23:47:43 -0700
committerSimon Glass <sjg@chromium.org>2015-11-19 20:27:50 -0700
commit9723563aa821e9c9b881dfe6a082f6301ca69826 (patch)
tree78f9a58eab57b388dbadc8e453513b6dae42e989 /arch/sandbox/include/asm/state.h
parent3f51a772d4b7dccc2d379762a03535408b602e54 (diff)
sandbox: Add a way to skip time delays
Some tests are slow due to delays which are unnecessary on sandbox. The worst offender is USB where we lose two seconds. Add a way to disable time delays. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/sandbox/include/asm/state.h')
-rw-r--r--arch/sandbox/include/asm/state.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h
index 2bd28f6b1c..e876ba2978 100644
--- a/arch/sandbox/include/asm/state.h
+++ b/arch/sandbox/include/asm/state.h
@@ -63,6 +63,7 @@ struct sandbox_state {
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 */
+ bool skip_delays; /* Ignore any time delays (for test) */
/* Pointer to information for each SPI bus/cs */
struct sandbox_spi_info spi[CONFIG_SANDBOX_SPI_MAX_BUS]
@@ -185,6 +186,24 @@ int sandbox_write_state(struct sandbox_state *state, const char *fname);
int state_setprop(int node, const char *prop_name, const void *data, int size);
/**
+ * Control skipping of time delays
+ *
+ * Some tests have unnecessay time delays (e.g. USB). Allow these to be
+ * skipped to speed up testing
+ *
+ * @param skip_delays true to skip delays from now on, false to honour delay
+ * requests
+ */
+void state_set_skip_delays(bool skip_delays);
+
+/**
+ * See if delays should be skipped
+ *
+ * @return true if delays should be skipped, false if they should be honoured
+ */
+bool state_get_skip_delays(void);
+
+/**
* Initialize the test system state
*/
int state_init(void);