]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
sandbox: Add a -N flag to control on-host behaviour
authorSimon Glass <sjg@chromium.org>
Thu, 7 Nov 2024 21:31:42 +0000 (14:31 -0700)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 9 Nov 2024 09:00:15 +0000 (10:00 +0100)
Sandbox is its own architecture, but sometimes we want to mimic the host
architecture, e.g. when running an EFI app not built by U-Boot.

Add a -N/--native flag which tells sandbox to reflect the architecture
of the host.

Signed-off-by: Simon Glass <sjg@chromium.org>
arch/sandbox/cpu/start.c
arch/sandbox/include/asm/state.h

index 81752edc9f8d6e36f08d5ccceee2854dc10004f4..2940768cd1c3bb73b20e4ff6a9d1ffd02cd77179 100644 (file)
@@ -449,6 +449,16 @@ static void setup_ram_buf(struct sandbox_state *state)
        gd->ram_size = state->ram_size;
 }
 
+static int sandbox_cmdline_cb_native(struct sandbox_state *state,
+                                    const char *arg)
+{
+       state->native = true;
+
+       return 0;
+}
+SANDBOX_CMDLINE_OPT_SHORT(native, 'N', 0,
+                         "Use native mode (host-based EFI boot filename)");
+
 void state_show(struct sandbox_state *state)
 {
        char **p;
index e7dc01759e8e93814eb88bd46707d829f9d5ac05..dc21a6231061841a47af95fe14e09944f5abc1e9 100644 (file)
@@ -101,6 +101,7 @@ struct sandbox_state {
        bool disable_eth;               /* Disable Ethernet devices */
        bool disable_sf_bootdevs;       /* Don't bind SPI flash bootdevs */
        bool upl;                       /* Enable Universal Payload (UPL) */
+       bool native;                    /* Adjust to reflect host arch */
 
        /* Pointer to information for each SPI bus/cs */
        struct sandbox_spi_info spi[CONFIG_SANDBOX_SPI_MAX_BUS]