summaryrefslogtreecommitdiff
path: root/arch/sandbox
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-07-10 16:22:57 -0400
committerTom Rini <trini@konsulko.com>2020-07-10 16:22:57 -0400
commit4a9146c29573dbfa661918280d9522a01f6ca919 (patch)
treeb1b135237dcfee94a27e8df7ce2208230c28b894 /arch/sandbox
parentf30924739975b4f60c0862b539790fdcdb7da20c (diff)
parent6c3fc50ee59366df62e8345ea9fd86c3ace0c3f1 (diff)
Merge tag 'dm-pull-10jul20' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
of-platdata: better phandle and compatible-string support patman support for Python3 on Ubuntu 14.04 new checkpatch check to avoid #ifdefs
Diffstat (limited to 'arch/sandbox')
-rw-r--r--arch/sandbox/Kconfig10
-rw-r--r--arch/sandbox/cpu/state.c5
-rw-r--r--arch/sandbox/cpu/u-boot-spl.lds2
-rw-r--r--arch/sandbox/include/asm/state.h2
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 */