diff options
Diffstat (limited to 'arch/sandbox')
-rw-r--r-- | arch/sandbox/Kconfig | 10 | ||||
-rw-r--r-- | arch/sandbox/cpu/state.c | 5 | ||||
-rw-r--r-- | arch/sandbox/cpu/u-boot-spl.lds | 2 | ||||
-rw-r--r-- | arch/sandbox/include/asm/state.h | 2 |
4 files changed, 16 insertions, 3 deletions
diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig index 2a08533c4b..65f988e736 100644 --- a/arch/sandbox/Kconfig +++ b/arch/sandbox/Kconfig @@ -15,6 +15,16 @@ config SANDBOX64 select PHYS_64BIT select HOST_64BIT +config SANDBOX_RAM_SIZE_MB + int "RAM size in MiB" + default 128 + range 64 4095 if !SANDBOX64 + range 64 268435456 if SANDBOX64 + help + Memory size of the sandbox in MiB. The default value is 128 MiB. + The minimum value is 64 MiB. The maximum value is 4095 MiB for the + 32bit sandbox. + config SANDBOX_SPL bool "Enable SPL for sandbox" select SUPPORT_SPL diff --git a/arch/sandbox/cpu/state.c b/arch/sandbox/cpu/state.c index 1f794123b3..34b6fff7e7 100644 --- a/arch/sandbox/cpu/state.c +++ b/arch/sandbox/cpu/state.c @@ -378,7 +378,10 @@ int state_init(void) state->ram_size = CONFIG_SYS_SDRAM_SIZE; state->ram_buf = os_malloc(state->ram_size); - assert(state->ram_buf); + if (!state->ram_buf) { + printf("Out of memory\n"); + os_exit(1); + } state_reset_for_test(state); /* diff --git a/arch/sandbox/cpu/u-boot-spl.lds b/arch/sandbox/cpu/u-boot-spl.lds index de65b01b33..c60eb109b1 100644 --- a/arch/sandbox/cpu/u-boot-spl.lds +++ b/arch/sandbox/cpu/u-boot-spl.lds @@ -20,4 +20,4 @@ SECTIONS __bss_start = .; } -INSERT BEFORE .data; +INSERT AFTER .data; diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h index 705645d714..1bfad305f1 100644 --- a/arch/sandbox/include/asm/state.h +++ b/arch/sandbox/include/asm/state.h @@ -73,7 +73,7 @@ struct sandbox_state { char **argv; /* Command line arguments */ const char *jumped_fname; /* Jumped from previous U_Boot */ uint8_t *ram_buf; /* Emulated RAM buffer */ - unsigned int ram_size; /* Size of RAM buffer */ + unsigned long ram_size; /* Size of RAM buffer */ const char *ram_buf_fname; /* Filename to use for RAM buffer */ bool ram_buf_rm; /* Remove RAM buffer file after read */ bool write_ram_buf; /* Write RAM buffer on exit */ |