From 3e468e6896aea45df1b8f6dbc9ebf5c3589c680a Mon Sep 17 00:00:00 2001 From: Thomas Chou Date: Wed, 9 Sep 2015 15:09:43 +0800 Subject: nios2: call board_init_f_mem We will need CONFIG_SYS_MALLOC_F_LEN to use serial uclass. So we shall undefine CONFIG_SYS_GENERIC_GLOBAL_DATA, and call board_init_f_mem() to allocates early malloc() memory with size of CONFIG_SYS_MALLOC_F_LEN in board_f.c. Signed-off-by: Thomas Chou Reviewed-by: Marek Vasut --- arch/nios2/cpu/start.S | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'arch/nios2/cpu') diff --git a/arch/nios2/cpu/start.S b/arch/nios2/cpu/start.S index 5c7074e09c..6c7c777044 100644 --- a/arch/nios2/cpu/start.S +++ b/arch/nios2/cpu/start.S @@ -120,6 +120,16 @@ _reloc: stw r0, 4(sp) mov fp, sp + /* Allocate and zero GD, update SP */ + mov r4, sp + movhi r2, %hi(board_init_f_mem@h) + ori r2, r2, %lo(board_init_f_mem@h) + callr r2 + + /* Update stack- and frame-pointers */ + mov sp, r2 + mov fp, sp + /* * Call board_init_f -- never returns */ -- cgit v1.2.1