diff options
author | Simon Glass <sjg@chromium.org> | 2014-07-11 08:23:27 +0400 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2014-07-23 17:05:39 +0400 |
commit | 4d94dfa0594260245813ea150e276908cc677199 (patch) | |
tree | dd76c6a8cfeb5daee2b8ede36804aa9034696e44 /arch/sandbox | |
parent | d93041a4ca0e421dd2a5683563de10e4694e6394 (diff) | |
download | u-boot-4d94dfa0594260245813ea150e276908cc677199.tar.xz |
sandbox: Set up global data before board_init_f()
At present sandbox defines CONFIG_SYS_GENERIC_GLOBAL_DATA, meaning that
the global_data pointer is set up in board_init_f().
If we set up and zero the global data before calling board_init_f() then we
don't need to define CONFIG_SYS_GENERIC_GLOBAL_DATA.
Make this change to simplify the init process.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/sandbox')
-rw-r--r-- | arch/sandbox/cpu/start.c | 5 | ||||
-rw-r--r-- | arch/sandbox/include/asm/config.h | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c index aad3b8b147..5289291bc8 100644 --- a/arch/sandbox/cpu/start.c +++ b/arch/sandbox/cpu/start.c @@ -6,6 +6,7 @@ #include <common.h> #include <os.h> #include <asm/getopt.h> +#include <asm/io.h> #include <asm/sections.h> #include <asm/state.h> @@ -218,6 +219,7 @@ SANDBOX_CMDLINE_OPT_SHORT(terminal, 't', 1, int main(int argc, char *argv[]) { struct sandbox_state *state; + gd_t data; int ret; ret = state_init(); @@ -236,6 +238,9 @@ int main(int argc, char *argv[]) if (state->ram_buf_rm && state->ram_buf_fname) os_unlink(state->ram_buf_fname); + memset(&data, '\0', sizeof(data)); + gd = &data; + /* Do pre- and post-relocation init */ board_init_f(0); diff --git a/arch/sandbox/include/asm/config.h b/arch/sandbox/include/asm/config.h index 6c1bff99c2..ec7729eb4c 100644 --- a/arch/sandbox/include/asm/config.h +++ b/arch/sandbox/include/asm/config.h @@ -7,7 +7,6 @@ #ifndef _ASM_CONFIG_H_ #define _ASM_CONFIG_H_ -#define CONFIG_SYS_GENERIC_GLOBAL_DATA #define CONFIG_SANDBOX_ARCH /* Used by drivers/spi/sandbox_spi.c and arch/sandbox/include/asm/state.h */ |