summaryrefslogtreecommitdiff
path: root/common/spl
diff options
context:
space:
mode:
authorAndy Yan <andy.yan@rock-chips.com>2017-07-24 09:43:34 (GMT)
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>2017-07-27 12:59:03 (GMT)
commitf1896c45cb2f7d8dbed27e784a6459a129fc0762 (patch)
tree981ca22db89ce23f0a47e11de4d2b7be92391083 /common/spl
parenta1903c18db13e740e6bedb8955b3272dce5104e1 (diff)
downloadu-boot-fsl-qoriq-f1896c45cb2f7d8dbed27e784a6459a129fc0762.tar.xz
spl: make SPL and normal u-boot stage use independent SYS_MALLOC_F_LEN
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> Reviewed-by: Tom Rini <trini@konsulko.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>
Diffstat (limited to 'common/spl')
-rw-r--r--common/spl/spl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/common/spl/spl.c b/common/spl/spl.c
index 7f3fd92..c56cc6f 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -220,12 +220,12 @@ static int spl_common_init(bool setup_malloc)
debug("spl_early_init()\n");
-#if defined(CONFIG_SYS_MALLOC_F_LEN)
+#if CONFIG_VAL(SYS_MALLOC_F_LEN)
if (setup_malloc) {
#ifdef CONFIG_MALLOC_F_ADDR
gd->malloc_base = CONFIG_MALLOC_F_ADDR;
#endif
- gd->malloc_limit = CONFIG_SYS_MALLOC_F_LEN;
+ gd->malloc_limit = CONFIG_VAL(SYS_MALLOC_F_LEN);
gd->malloc_ptr = 0;
}
#endif
@@ -419,7 +419,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
default:
debug("Unsupported OS image.. Jumping nevertheless..\n");
}
-#if defined(CONFIG_SYS_MALLOC_F_LEN) && !defined(CONFIG_SYS_SPL_MALLOC_SIZE)
+#if CONFIG_VAL(SYS_MALLOC_F_LEN) && !defined(CONFIG_SYS_SPL_MALLOC_SIZE)
debug("SPL malloc() used %#lx bytes (%ld KB)\n", gd->malloc_ptr,
gd->malloc_ptr / 1024);
#endif
@@ -486,7 +486,7 @@ ulong spl_relocate_stack_gd(void)
gd_t *new_gd;
ulong ptr = CONFIG_SPL_STACK_R_ADDR;
-#ifdef CONFIG_SPL_SYS_MALLOC_SIMPLE
+#if defined(CONFIG_SPL_SYS_MALLOC_SIMPLE) && CONFIG_SPL_SYS_MALLOC_F_LEN
if (CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN) {
ptr -= CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN;
gd->malloc_base = ptr;