]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/sandbox/cpu/state.c
karo: fdt: fix panel-dpi support
[karo-tx-uboot.git] / arch / sandbox / cpu / state.c
index ba73b7e251040831f45a38d29132479b605c0abc..7e5d03e8460bf945b40577bd40c4b9cb3fd85fbf 100644 (file)
 static struct sandbox_state main_state;
 static struct sandbox_state *state;    /* Pointer to current state record */
 
-void state_record_exit(enum exit_type_id exit_type)
-{
-       state->exit_type = exit_type;
-}
-
 static int state_ensure_space(int extra_size)
 {
        void *blob = state->state_fdt;
@@ -56,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) {
@@ -350,6 +345,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:
         *