nios2: call board_init_f_mem
PATCH 1/2 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.
--- arch/nios2/cpu/start.S | 10 ++++++++++ arch/nios2/include/asm/config.h | 2 -- 2 files changed, 10 insertions(+), 2 deletions(-)
arch/nios2/cpu/start.S +10 -0
@@ -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 at h) + ori r2, r2, %lo(board_init_f_mem at h) + callr r2 + + /* Update stack- and frame-pointers */ + mov sp, r2 + mov fp, sp + /* * Call board_init_f -- never returns */
arch/nios2/include/asm/config.h +0 -2
@@ -7,6 +7,4 @@#ifndef _ASM_CONFIG_H_#define _ASM_CONFIG_H_ -#define CONFIG_SYS_GENERIC_GLOBAL_DATA -#endif
Signature · 1 line
2.1.4
PATCH 1/2 nios2: call board_init_f_mem
Quoted 10 lines · Thomas Chou
We will need
CONFIG_SYS_MALLOC_F_LENto use serial uclass. So we shall undefineCONFIG_SYS_GENERIC_GLOBAL_DATA, and callboard_init_f_mem()to allocates earlymalloc()memory with size ofCONFIG_SYS_MALLOC_F_LENinboard_f.c.Signed-off-by Thomas Chou <[email protected]>--- arch/nios2/cpu/start.S | 10 ++++++++++ arch/nios2/include/asm/config.h | 2 -- 2 files changed, 10 insertions(+), 2 deletions(-)
Applied to u-boot-nios.
PATCH 1/2 nios2: call board_init_f_mem
In reply to Thomas ChouQuoted 6 lines · Thomas Chou
We will need
CONFIG_SYS_MALLOC_F_LENto use serial uclass. So we shall undefineCONFIG_SYS_GENERIC_GLOBAL_DATA, and callboard_init_f_mem()to allocates earlymalloc()memory with size ofCONFIG_SYS_MALLOC_F_LENinboard_f.c.Signed-off-by Thomas Chou <[email protected]>
Best regards,
Marek Vasut
PATCH 2/2 nios2: enable malloc() pool before relocation
In reply to Thomas ChouEnable malloc() pool before relocation, because this is needed to use serial uclass.
--- configs/nios2-generic_defconfig | 1 - 1 file changed, 1 deletion(-)
configs/nios2-generic_defconfig +0 -1
@@ -1,5 +1,4 @@ CONFIG_NIOS2=y -# CONFIG_SYS_MALLOC_F is not set CONFIG_TARGET_NIOS2_GENERIC=y CONFIG_DEFAULT_DEVICE_TREE="3c120_devboard" CONFIG_HUSH_PARSER=y
Signature · 1 line
2.1.4
PATCH 2/2 nios2: enable malloc() pool before relocation
Quoted 4 lines · Thomas Chou
Enable
malloc()pool before relocation, because this is needed to use serial uclass.Signed-off-by Thomas Chou <[email protected]>
Best regards,
Marek Vasut
PATCH 2/2 nios2: enable malloc() pool before relocation
In reply to Thomas ChouQuoted 8 lines · Thomas Chou
Enable
malloc()pool before relocation, because this is needed to use serial uclass.Signed-off-by Thomas Chou <[email protected]>--- configs/nios2-generic_defconfig | 1 - 1 file changed, 1 deletion(-)
Applied to u-boot-nios.