From af6bbd4daefc314cc422381580f11fabc9cb222f Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 19 Oct 2015 06:49:56 -0600 Subject: Move board_init_f_mem() into a common location This function will be used by both SPL and U-Boot proper. So move it into a common place. Also change the #ifdef so that the early malloc() area is not set up in SPL if CONFIG_SYS_SPL_MALLOC_START is defined. In that case it would never actually be used, and just chews up stack space. Signed-off-by: Simon Glass --- common/board_f.c | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'common/board_f.c') diff --git a/common/board_f.c b/common/board_f.c index 613332e..62570ab 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -1030,32 +1030,3 @@ void board_init_f_r(void) hang(); } #endif /* CONFIG_X86 */ - -/* Unfortunately x86 can't compile this code as gd cannot be assigned */ -#ifndef CONFIG_X86 -__weak void arch_setup_gd(struct global_data *gd_ptr) -{ - gd = gd_ptr; -} -#endif /* !CONFIG_X86 */ - -ulong board_init_f_mem(ulong top) -{ - struct global_data *gd_ptr; - - /* Leave space for the stack we are running with now */ - top -= 0x40; - - top -= sizeof(struct global_data); - top = ALIGN(top, 16); - gd_ptr = (struct global_data *)top; - memset(gd_ptr, '\0', sizeof(*gd)); - arch_setup_gd(gd_ptr); - -#ifdef CONFIG_SYS_MALLOC_F_LEN - top -= CONFIG_SYS_MALLOC_F_LEN; - gd->malloc_base = top; -#endif - - return top; -} -- cgit v1.1