summaryrefslogtreecommitdiff
path: root/arch/sandbox/cpu/start.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2024-08-07 16:47:37 -0600
committerTom Rini <trini@konsulko.com>2024-08-09 16:03:20 -0600
commitdadd23ebab03b9ad4062a3b6af20bbcda0b05f89 (patch)
tree43a872ae7c75a0690d20a9075dc6770cf2db1cb8 /arch/sandbox/cpu/start.c
parent3a1a3d549b8f9e795af2066625d91a03c21ae322 (diff)
sandbox: Add a flag to enable UPL
UPL significantly alters the boot flow for sandbox. Add a flag to enable this so that it can be enabled only on tests which need it. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/sandbox/cpu/start.c')
-rw-r--r--arch/sandbox/cpu/start.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
index 0920ed55965..9ad5d46271a 100644
--- a/arch/sandbox/cpu/start.c
+++ b/arch/sandbox/cpu/start.c
@@ -431,6 +431,14 @@ static int sandbox_cmdline_cb_autoboot_keyed(struct sandbox_state *state,
}
SANDBOX_CMDLINE_OPT(autoboot_keyed, 0, "Allow keyed autoboot");
+static int sandbox_cmdline_cb_upl(struct sandbox_state *state, const char *arg)
+{
+ state->upl = true;
+
+ return 0;
+}
+SANDBOX_CMDLINE_OPT(upl, 0, "Enable Universal Payload (UPL)");
+
static void setup_ram_buf(struct sandbox_state *state)
{
/* Zero the RAM buffer if we didn't read it, to keep valgrind happy */
@@ -540,6 +548,9 @@ int sandbox_main(int argc, char *argv[])
goto err;
}
+ if (state->upl)
+ gd->flags |= GD_FLG_UPL;
+
#if CONFIG_IS_ENABLED(SYS_MALLOC_F)
gd->malloc_base = CFG_MALLOC_F_ADDR;
#endif
@@ -558,7 +569,7 @@ int sandbox_main(int argc, char *argv[])
log_debug("debug: %s\n", __func__);
/* Do pre- and post-relocation init */
- board_init_f(0);
+ board_init_f(gd->flags);
board_init_r(gd->new_gd, 0);