]> git.sur5r.net Git - u-boot/commitdiff
sandbox: Don't exit when bootm completes
authorSimon Glass <sjg@chromium.org>
Sun, 3 Jul 2016 15:40:35 +0000 (09:40 -0600)
committerTom Rini <trini@konsulko.com>
Thu, 14 Jul 2016 22:22:32 +0000 (18:22 -0400)
At present sandbox exits when the 'bootm' command completes, since it is not
actually able to run the OS that is loaded. Normally 'bootm' failure is
considered a fatal error in U-Boot.

However this is annoying for tests, which may want to examine the state
after a test is complete. In any case there is a 'reset' command which can
be used to exit, if required.

Change the behaviour to return normally from the 'bootm' command on sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Teddy Reed <teddy.reed@gmail.com>
arch/sandbox/lib/bootm.c
common/bootm_os.c

index d49c927b3465b5c73956f6d312b7a8226ac2c558..0c9a7979d23142fbc3d96d1722c7d8cd4d6b3c09 100644 (file)
@@ -56,7 +56,7 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
                bootstage_mark(BOOTSTAGE_ID_RUN_OS);
                printf("## Transferring control to Linux (at address %08lx)...\n",
                       images->ep);
-               reset_cpu(0);
+               printf("sandbox: continuing, as we cannot run Linux\n");
        }
 
        return 0;
index 9ec84bd0dbe0349741b09b44010f3e4f75709be8..e3f5a4641207e41a387cbf941fb1d23afde0fdc0 100644 (file)
@@ -481,6 +481,7 @@ int boot_selected_os(int argc, char * const argv[], int state,
 
        /* Stand-alone may return when 'autostart' is 'no' */
        if (images->os.type == IH_TYPE_STANDALONE ||
+           IS_ENABLED(CONFIG_SANDBOX) ||
            state == BOOTM_STATE_OS_FAKE_GO) /* We expect to return */
                return 0;
        bootstage_error(BOOTSTAGE_ID_BOOT_OS_RETURNED);