[U-Boot] [PATCHv2 15/20] arm: socfpga: spl: adjust SPL_MALLOC_SIZE to 256

Marek Vasut
2015-03-29T23:45:34Z

On Friday, March 27, 2015 at 09:10:35 PM, Dinh Nguyen wrote:
> Hi Marek,

Hi Dinh,

> On 03/04/2015 07:16 AM, Marek Vasut wrote:
> > On Monday, March 02, 2015 at 05:28:03 PM, dinguyen at opensource.altera.com
wrote:
> >> From: Dinh Nguyen <dinguyen@opensource.altera.com>
> >>
> >> Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
> >
> > Why did you do this change please ?
>
> Sorry that it's taken me a while to get back to you on this, but this is
> why I had to adjust the SPL_MALLOC_SIZE to 256:

No worries, I'm also quite busy myself :)

> #define CONFIG_SYS_INIT_RAM_SIZE (0x10000 - 0x100)
> #define CONFIG_SYS_INIT_SP_ADDR \
> (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE - \
> GENERATED_GBL_DATA_SIZE)
>
> Because of the above define I only have 0x100 left for SPL_MALLOC_SIZE.
>
> I think I should rework this patch to be like this:
>
> --- a/include/configs/socfpga_common.h
> +++ b/include/configs/socfpga_common.h
> @@ -41,7 +41,7 @@
> #define CONFIG_SYS_MEMTEST_END PHYS_SDRAM_1_SIZE
>
> #define CONFIG_SYS_INIT_RAM_ADDR 0xFFFF0000
> -#define CONFIG_SYS_INIT_RAM_SIZE (0x10000 - 0x100)
> +#define CONFIG_SYS_INIT_RAM_SIZE (0x10000 -
> CONFIG_SYS_SPL_MALLOC_SIZE)

Certainly, that makes more sense ;-) You can also take for example
include/configs/novena.h for a reference. It contains the defines
which should be enabled for SPL with working mallocator, while it
still runs from OCRAM.

Best regards,
Marek Vasut