Skip to content

Commit

Permalink
microblaze: spl: configure SYS_MALLOC_F_LEN independently for SPL and…
Browse files Browse the repository at this point in the history
… full U-Boot

Some platforms have very limited SRAM to run SPL code, so there may
not be the same amount space for a malloc pool before relocation in
the SPL stage as the normal U-Boot stage.

Make SPL and (the full) U-Boot stage use independent SYS_MALLOC_F_LEN,
so the size of pre-relocation malloc pool can be configured memory
space independently.

Signed-off-by: Andy Yan <[email protected]>
Acked-by: Philipp Tomsich <[email protected]>
Reviewed-by: Philipp Tomsich <[email protected]>
[fixed up commit-message:]
Signed-off-by: Philipp Tomsich <[email protected]>
  • Loading branch information
Andy Yan authored and Philipp Tomsich committed Jul 27, 2017
1 parent 2b71d09 commit 9eea501
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arch/microblaze/cpu/start.S
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ _start:
mts rshr, r1
addi r1, r1, -4 /* Decrement SP to top of memory */
#else
#if defined(CONFIG_SYS_MALLOC_F_LEN)
addi r1, r0, CONFIG_SYS_INIT_SP_OFFSET - CONFIG_SYS_MALLOC_F_LEN
#if CONFIG_VAL(SYS_MALLOC_F_LEN)
addi r1, r0, CONFIG_SYS_INIT_SP_OFFSET - CONFIG_VAL(SYS_MALLOC_F_LEN)
#else
addi r1, r0, CONFIG_SYS_INIT_SP_OFFSET
#endif
Expand Down Expand Up @@ -162,14 +162,14 @@ clear_bss:
#ifndef CONFIG_SPL_BUILD
or r5, r0, r0 /* flags - empty */
addi r31, r0, _gd
#if defined(CONFIG_SYS_MALLOC_F_LEN)
#if CONFIG_VAL(SYS_MALLOC_F_LEN)
addi r6, r0, CONFIG_SYS_INIT_SP_OFFSET
swi r6, r31, GD_MALLOC_BASE
#endif
brai board_init_f
#else
addi r31, r0, _gd
#if defined(CONFIG_SYS_MALLOC_F_LEN)
#if CONFIG_VAL(SYS_MALLOC_F_LEN)
addi r6, r0, CONFIG_SPL_STACK_ADDR
swi r6, r31, GD_MALLOC_BASE
#endif
Expand Down

0 comments on commit 9eea501

Please sign in to comment.