mirror of
https://github.com/linux-sunxi/u-boot-sunxi.git
synced 2024-02-12 11:16:03 +08:00
powerpc: spl: configure SYS_MALLOC_F_LEN independently for SPL and 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 <andy.yan@rock-chips.com> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> [fixed up commit-message:] Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
This commit is contained in:

committed by
Philipp Tomsich

parent
f5868a5da1
commit
2b71d098ee
@ -264,14 +264,14 @@ in_flash:
|
|||||||
cmplw r3, r4
|
cmplw r3, r4
|
||||||
bne 1b
|
bne 1b
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_MALLOC_F_LEN
|
#if CONFIG_VAL(SYS_MALLOC_F_LEN)
|
||||||
|
|
||||||
#if CONFIG_SYS_MALLOC_F_LEN + GENERATED_GBL_DATA_SIZE > CONFIG_SYS_INIT_RAM_SIZE
|
#if CONFIG_VAL(SYS_MALLOC_F_LEN) + GENERATED_GBL_DATA_SIZE > CONFIG_SYS_INIT_RAM_SIZE
|
||||||
#error "CONFIG_SYS_MALLOC_F_LEN too large to fit into initial RAM."
|
#error "SYS_MALLOC_F_LEN too large to fit into initial RAM."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* r3 = new stack pointer / pre-reloc malloc area */
|
/* r3 = new stack pointer / pre-reloc malloc area */
|
||||||
subi r3, r3, CONFIG_SYS_MALLOC_F_LEN
|
subi r3, r3, CONFIG_VAL(SYS_MALLOC_F_LEN)
|
||||||
|
|
||||||
/* Set pointer to pre-reloc malloc area in GD */
|
/* Set pointer to pre-reloc malloc area in GD */
|
||||||
stw r3, GD_MALLOC_BASE(r4)
|
stw r3, GD_MALLOC_BASE(r4)
|
||||||
|
@ -1183,14 +1183,13 @@ _start_cont:
|
|||||||
lis r3,(CONFIG_SYS_INIT_RAM_ADDR)@h
|
lis r3,(CONFIG_SYS_INIT_RAM_ADDR)@h
|
||||||
ori r3,r3,((CONFIG_SYS_INIT_SP_OFFSET-16)&~0xf)@l /* Align to 16 */
|
ori r3,r3,((CONFIG_SYS_INIT_SP_OFFSET-16)&~0xf)@l /* Align to 16 */
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_MALLOC_F_LEN
|
#if CONFIG_VAL(SYS_MALLOC_F_LEN)
|
||||||
|
#if CONFIG_VAL(SYS_MALLOC_F_LEN) + GENERATED_GBL_DATA_SIZE > CONFIG_SYS_INIT_RAM_SIZE
|
||||||
#if CONFIG_SYS_MALLOC_F_LEN + GENERATED_GBL_DATA_SIZE > CONFIG_SYS_INIT_RAM_SIZE
|
#error "SYS_MALLOC_F_LEN too large to fit into initial RAM."
|
||||||
#error "CONFIG_SYS_MALLOC_F_LEN too large to fit into initial RAM."
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Leave 16+ byte for back chain termination and NULL return address */
|
/* Leave 16+ byte for back chain termination and NULL return address */
|
||||||
subi r3,r3,((CONFIG_SYS_MALLOC_F_LEN+16+15)&~0xf)
|
subi r3,r3,((CONFIG_VAL(SYS_MALLOC_F_LEN)+16+15)&~0xf)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* End of RAM */
|
/* End of RAM */
|
||||||
@ -1204,7 +1203,7 @@ _start_cont:
|
|||||||
cmplw r4,r3
|
cmplw r4,r3
|
||||||
bne 1b
|
bne 1b
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_MALLOC_F_LEN
|
#if CONFIG_VAL(SYS_MALLOC_F_LEN)
|
||||||
lis r4,(CONFIG_SYS_INIT_RAM_ADDR)@h
|
lis r4,(CONFIG_SYS_INIT_RAM_ADDR)@h
|
||||||
ori r4,r4,(CONFIG_SYS_GBL_DATA_OFFSET)@l
|
ori r4,r4,(CONFIG_SYS_GBL_DATA_OFFSET)@l
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user