From mboxrd@z Thu Jan 1 00:00:00 1970 From: Philipp Tomsich Date: Wed, 2 Aug 2017 22:34:01 +0200 Subject: [U-Boot] [PATCH v4 06/66] spl: use TPL_SYS_MALLOC_F_LEN for TPL In-Reply-To: <1501706105-7490-1-git-send-email-philipp.tomsich@theobroma-systems.com> References: <1501706105-7490-1-git-send-email-philipp.tomsich@theobroma-systems.com> Message-ID: <1501706105-7490-7-git-send-email-philipp.tomsich@theobroma-systems.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de The (upstream) changes to break up SYS_MALLOC_F_LEN for the full U-Boot and the SPL stage, break TPL (if simple malloc is enabled in TPL). This adds support for a TPL-variant of SYS_MALLOC_F_LEN: - adds TPL_SYS_MALLOC_F_LEN - rewrites a test for CONFIG_SPL_SYS_MALLOC_F_LEN to access CONFIG_VAL(SYS_MALLOC_F_LEN) Signed-off-by: Philipp Tomsich Reviewed-by: Simon Glass Version-changes: 3 - (new patch) adds changes to SYS_MALLOC_F_LEN for TPL to fix breakage from rebasing to u-boot-rockchip/master Version-changes: 4 - changes (one-line) summary text --- Changes in v4: None Changes in v3: None Changes in v2: None Kconfig | 12 +++++++++++- common/spl/spl.c | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Kconfig b/Kconfig index c1451bc..27c64fe 100644 --- a/Kconfig +++ b/Kconfig @@ -96,7 +96,17 @@ config SYS_MALLOC_F_LEN initial serial device and any others that are needed. config SPL_SYS_MALLOC_F_LEN - hex "Size of malloc() pool in spl before relocation" + hex "Size of malloc() pool in SPL before relocation" + depends on SYS_MALLOC_F + default SYS_MALLOC_F_LEN + help + Before relocation, memory is very limited on many platforms. Still, + we can provide a small malloc() pool if needed. Driver model in + particular needs this to operate, so that it can allocate the + initial serial device and any others that are needed. + +config TPL_SYS_MALLOC_F_LEN + hex "Size of malloc() pool in TPL before relocation" depends on SYS_MALLOC_F default SYS_MALLOC_F_LEN help diff --git a/common/spl/spl.c b/common/spl/spl.c index b61993f..c84ffd8 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -487,7 +487,7 @@ ulong spl_relocate_stack_gd(void) gd_t *new_gd; ulong ptr = CONFIG_SPL_STACK_R_ADDR; -#if defined(CONFIG_SPL_SYS_MALLOC_SIMPLE) && CONFIG_SPL_SYS_MALLOC_F_LEN +#if defined(CONFIG_SPL_SYS_MALLOC_SIMPLE) && CONFIG_VAL(SYS_MALLOC_F_LEN) if (CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN) { ptr -= CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN; gd->malloc_base = ptr; -- 2.1.4