microblaze: spl: Do not call mem_malloc_init and use early alloc
This patch has some parts connected together: - Use _gd in bss section which is automatically cleared Location at SPL_MALLOC_END wasn't cleared at all - Use MALLOC_F_LEN(early alloc) instead of FULL MALLOC (mem_malloc_init is not called at all) - Simplify malloc and stack init. At the end of SPL addr is malloc area and below is stack Signed-off-by: Michal Simek <michal.simek@xilinx.com>
This commit is contained in:
@@ -162,7 +162,11 @@ clear_bss:
|
|||||||
#endif
|
#endif
|
||||||
brai board_init_f
|
brai board_init_f
|
||||||
#else
|
#else
|
||||||
addi r31, r0, CONFIG_SYS_SPL_MALLOC_END
|
addi r31, r0, _gd
|
||||||
|
#if defined(CONFIG_SYS_MALLOC_F_LEN)
|
||||||
|
addi r6, r0, CONFIG_SPL_STACK_ADDR
|
||||||
|
swi r6, r31, GD_MALLOC_BASE
|
||||||
|
#endif
|
||||||
brai board_init_r
|
brai board_init_r
|
||||||
#endif
|
#endif
|
||||||
1: bri 1b
|
1: bri 1b
|
||||||
|
@@ -113,7 +113,12 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CONFIG_SYS_MALLOC_LEN 0xC0000
|
#define CONFIG_SYS_MALLOC_LEN 0xC0000
|
||||||
|
#ifndef CONFIG_SPL_BUILD
|
||||||
# define CONFIG_SYS_MALLOC_F_LEN 1024
|
# define CONFIG_SYS_MALLOC_F_LEN 1024
|
||||||
|
#else
|
||||||
|
# define CONFIG_SYS_MALLOC_SIMPLE
|
||||||
|
# define CONFIG_SYS_MALLOC_F_LEN 0x150
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Stack location before relocation */
|
/* Stack location before relocation */
|
||||||
#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_TEXT_BASE
|
#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_TEXT_BASE
|
||||||
@@ -426,25 +431,11 @@
|
|||||||
/* BRAM start */
|
/* BRAM start */
|
||||||
#define CONFIG_SYS_INIT_RAM_ADDR 0x0
|
#define CONFIG_SYS_INIT_RAM_ADDR 0x0
|
||||||
/* BRAM size - will be generated */
|
/* BRAM size - will be generated */
|
||||||
#define CONFIG_SYS_INIT_RAM_SIZE 0x10000
|
#define CONFIG_SYS_INIT_RAM_SIZE 0x100000
|
||||||
/* Stack pointer prior relocation, must situated at on-chip RAM */
|
|
||||||
#define CONFIG_SYS_SPL_MALLOC_END (CONFIG_SYS_INIT_RAM_ADDR + \
|
# define CONFIG_SPL_STACK_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
|
||||||
CONFIG_SYS_INIT_RAM_SIZE - \
|
CONFIG_SYS_INIT_RAM_SIZE - \
|
||||||
GENERATED_GBL_DATA_SIZE)
|
CONFIG_SYS_MALLOC_F_LEN)
|
||||||
|
|
||||||
#define CONFIG_SYS_SPL_MALLOC_SIZE 0x100
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The main reason to do it in this way is that MALLOC_START
|
|
||||||
* can't be defined - common/spl/spl.c
|
|
||||||
*/
|
|
||||||
#if (CONFIG_SYS_SPL_MALLOC_SIZE != 0)
|
|
||||||
# define CONFIG_SYS_SPL_MALLOC_START (CONFIG_SYS_SPL_MALLOC_END - \
|
|
||||||
CONFIG_SYS_SPL_MALLOC_SIZE)
|
|
||||||
# define CONFIG_SPL_STACK_ADDR CONFIG_SYS_SPL_MALLOC_START
|
|
||||||
#else
|
|
||||||
# define CONFIG_SPL_STACK_ADDR CONFIG_SYS_SPL_MALLOC_END
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Just for sure that there is a space for stack */
|
/* Just for sure that there is a space for stack */
|
||||||
#define CONFIG_SPL_STACK_SIZE 0x100
|
#define CONFIG_SPL_STACK_SIZE 0x100
|
||||||
@@ -453,8 +444,7 @@
|
|||||||
|
|
||||||
#define CONFIG_SPL_MAX_FOOTPRINT (CONFIG_SYS_INIT_RAM_SIZE - \
|
#define CONFIG_SPL_MAX_FOOTPRINT (CONFIG_SYS_INIT_RAM_SIZE - \
|
||||||
CONFIG_SYS_INIT_RAM_ADDR - \
|
CONFIG_SYS_INIT_RAM_ADDR - \
|
||||||
GENERATED_GBL_DATA_SIZE - \
|
CONFIG_SYS_MALLOC_F_LEN - \
|
||||||
CONFIG_SYS_SPL_MALLOC_SIZE - \
|
|
||||||
CONFIG_SPL_STACK_SIZE)
|
CONFIG_SPL_STACK_SIZE)
|
||||||
|
|
||||||
#endif /* __CONFIG_H */
|
#endif /* __CONFIG_H */
|
||||||
|
Reference in New Issue
Block a user