SECURE_BOOT: Use default bootargs
[oweals/u-boot.git] / arch / sandbox / cpu / state.c
index 033958ce74235b26ecf374a69c83b11175c7b56c..d2a7dc9b450f8845811c9575a5731b0557c959c0 100644 (file)
@@ -51,7 +51,7 @@ static int state_read_file(struct sandbox_state *state, const char *fname)
        ret = os_get_filesize(fname, &size);
        if (ret < 0) {
                printf("Cannot find sandbox state file '%s'\n", fname);
-               return ret;
+               return -ENOENT;
        }
        state->state_fdt = os_malloc(size);
        if (!state->state_fdt) {
@@ -337,6 +337,20 @@ struct sandbox_state *state_get_current(void)
        return state;
 }
 
+void state_set_skip_delays(bool skip_delays)
+{
+       struct sandbox_state *state = state_get_current();
+
+       state->skip_delays = skip_delays;
+}
+
+bool state_get_skip_delays(void)
+{
+       struct sandbox_state *state = state_get_current();
+
+       return state->skip_delays;
+}
+
 int state_init(void)
 {
        state = &main_state;
@@ -345,6 +359,10 @@ int state_init(void)
        state->ram_buf = os_malloc(state->ram_size);
        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:
         *