From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew F. Davis Date: Sun, 22 Jan 2017 16:19:36 -0600 Subject: [U-Boot] [PATCH v3 2/3] spl: Remove overwrite of relocated malloc limit In-Reply-To: <20170122221937.5868-1-afd@ti.com> References: <20170122221937.5868-1-afd@ti.com> Message-ID: <20170122221937.5868-3-afd@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de spl_init on some boards is called after stack and heap relocation, on some platforms spl_relocate_stack_gd is called to handle setting the limit to its value CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN when simple SPL malloc is enabled during relocation. spl_init should then not re-assign the old pre-relocation limit when this is defined. Signed-off-by: Andrew F. Davis --- common/spl/spl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/spl/spl.c b/common/spl/spl.c index 462c3a2b97..abff85a725 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -187,7 +187,9 @@ int spl_init(void) #ifdef CONFIG_MALLOC_F_ADDR gd->malloc_base = CONFIG_MALLOC_F_ADDR; #endif +#ifndef CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN gd->malloc_limit = CONFIG_SYS_MALLOC_F_LEN; +#endif gd->malloc_ptr = 0; #endif if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) { -- 2.11.0