]> git.sur5r.net Git - u-boot/commitdiff
board_f: sandbox: Move setup_ram_buf() to private code
authorSimon Glass <sjg@chromium.org>
Tue, 28 Mar 2017 16:27:16 +0000 (10:27 -0600)
committerTom Rini <trini@konsulko.com>
Wed, 5 Apr 2017 17:52:35 +0000 (13:52 -0400)
There is no need to have this call in the generic init sequence and no
other architecture has needed it in the time it has been there. Move it
into sandbox's private code.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>
arch/sandbox/cpu/start.c
common/board_f.c

index 6e4ec017ccd98239faf8af7a9730c8bb3567cb4c..dc58fef90cc1fdcbbf4ace8c382112c928644010 100644 (file)
@@ -275,6 +275,12 @@ int board_run_command(const char *cmdline)
        return 1;
 }
 
+static void setup_ram_buf(struct sandbox_state *state)
+{
+       gd->arch.ram_buf = state->ram_buf;
+       gd->ram_size = state->ram_size;
+}
+
 int main(int argc, char *argv[])
 {
        struct sandbox_state *state;
@@ -302,6 +308,7 @@ int main(int argc, char *argv[])
 #ifdef CONFIG_SYS_MALLOC_F_LEN
        gd->malloc_base = CONFIG_MALLOC_F_ADDR;
 #endif
+       setup_ram_buf(state);
 
        /* Do pre- and post-relocation init */
        board_init_f(0);
index c4eb3ae65e536625966fcbdf42979c7d5e3383ac..0b2a325cef543c369e0ec9ae4eeae81e50ce6b08 100644 (file)
@@ -58,9 +58,6 @@
 #if defined(CONFIG_X86) || defined(CONFIG_ARC) || defined(CONFIG_XTENSA)
 #include <asm/relocate.h>
 #endif
-#ifdef CONFIG_SANDBOX
-#include <asm/state.h>
-#endif
 #include <dm/root.h>
 #include <linux/compiler.h>
 
@@ -294,18 +291,6 @@ __weak int mach_cpu_init(void)
        return 0;
 }
 
-#ifdef CONFIG_SANDBOX
-static int setup_ram_buf(void)
-{
-       struct sandbox_state *state = state_get_current();
-
-       gd->arch.ram_buf = state->ram_buf;
-       gd->ram_size = state->ram_size;
-
-       return 0;
-}
-#endif
-
 /* Get the top of usable RAM */
 __weak ulong board_get_usable_ram_top(ulong total_size)
 {
@@ -823,9 +808,6 @@ __weak int arch_cpu_init_dm(void)
 }
 
 static const init_fnc_t init_sequence_f[] = {
-#ifdef CONFIG_SANDBOX
-       setup_ram_buf,
-#endif
        setup_mon_len,
 #ifdef CONFIG_OF_CONTROL
        fdtdec_setup,