summaryrefslogtreecommitdiff
path: root/arch/sandbox/cpu/start.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-04-24 12:27:29 -0400
committerTom Rini <trini@konsulko.com>2019-04-24 12:27:29 -0400
commit7d994067424776b6184872b82fcaf4c0b95528f9 (patch)
treef8aaab8764ad4bc88c6389f8ee6b1ee75360b7a6 /arch/sandbox/cpu/start.c
parent180e38ad2dbb3340cc71fb4fa335a68f2a4122ef (diff)
parent8781d04f422e110fef864dd849085054fe5b0e65 (diff)
Merge tag 'pull-24apr19' of git://git.denx.de/u-boot-dm
Various minor sandbox iumprovements Fixes for tracing with sandbox Refactoring for boot_get_fdt()
Diffstat (limited to 'arch/sandbox/cpu/start.c')
-rw-r--r--arch/sandbox/cpu/start.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
index 2f5e6e9518..82828f0c1d 100644
--- a/arch/sandbox/cpu/start.c
+++ b/arch/sandbox/cpu/start.c
@@ -303,10 +303,8 @@ int board_run_command(const char *cmdline)
static void setup_ram_buf(struct sandbox_state *state)
{
/* Zero the RAM buffer if we didn't read it, to keep valgrind happy */
- if (!state->ram_buf_read) {
+ if (!state->ram_buf_read)
memset(state->ram_buf, '\0', state->ram_size);
- printf("clear %p %x\n", state->ram_buf, state->ram_size);
- }
gd->arch.ram_buf = state->ram_buf;
gd->ram_size = state->ram_size;
@@ -328,6 +326,10 @@ int main(int argc, char *argv[])
gd_t data;
int ret;
+ memset(&data, '\0', sizeof(data));
+ gd = &data;
+ gd->arch.text_base = os_find_text_base();
+
ret = state_init();
if (ret)
goto err;
@@ -340,8 +342,6 @@ int main(int argc, char *argv[])
if (ret)
goto err;
- memset(&data, '\0', sizeof(data));
- gd = &data;
#if CONFIG_VAL(SYS_MALLOC_F_LEN)
gd->malloc_base = CONFIG_MALLOC_F_ADDR;
#endif
@@ -350,6 +350,12 @@ int main(int argc, char *argv[])
#endif
setup_ram_buf(state);
+ /*
+ * Set up the relocation offset here, since sandbox symbols are always
+ * relocated by the OS before sandbox is entered.
+ */
+ gd->reloc_off = (ulong)gd->arch.text_base;
+
/* Do pre- and post-relocation init */
board_init_f(0);