diff mbox series

[v3,1/1] arm: sunxi: increase SYS_MALLOC_F_LEN

Message ID 20200725181851.4339-1-xypron.glpk@gmx.de
State New
Delegated to: Jagannadha Sutradharudu Teki
Headers show
Series [v3,1/1] arm: sunxi: increase SYS_MALLOC_F_LEN | expand

Commit Message

Heinrich Schuchardt July 25, 2020, 6:18 p.m. UTC
The current default of 0x400 for SYS_MALLOC_F_LEN is too small if any
additional drivers marked as DM_FLAG_PRE_RELOC are loaded before
relocation.

CONFIG_RSA=y which is needed for UEFI secure boot or for FIT image
verification loads the driver mod_exp_sw which has DM_FLAG_PRE_RELOC.

CONFIG_LOG=Y is another setting requiring additional early malloc
area, cf. log_init().

When running pine64-lts_defconfig with CONFIG_RSA=y and debug UART enabled
we see as output in main U-Boot

    alloc_simple() alloc space exhausted

With this patch the default values of SYS_MALLOC_F_LEN and
SPL_SYS_MALLOC_F_LEN on ARCH_SUNXI are raised to 0x2000.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
---
v3:
	rebased
v2:
	keep default for SPL_SYS_MALLOC_F_LEN at 0x400
---
 Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.27.0

Comments

Heinrich Schuchardt Aug. 25, 2020, 4:10 a.m. UTC | #1
On 7/25/20 8:18 PM, Heinrich Schuchardt wrote:
> The current default of 0x400 for SYS_MALLOC_F_LEN is too small if any
> additional drivers marked as DM_FLAG_PRE_RELOC are loaded before
> relocation.
>
> CONFIG_RSA=y which is needed for UEFI secure boot or for FIT image
> verification loads the driver mod_exp_sw which has DM_FLAG_PRE_RELOC.
>
> CONFIG_LOG=Y is another setting requiring additional early malloc
> area, cf. log_init().
>
> When running pine64-lts_defconfig with CONFIG_RSA=y and debug UART enabled
> we see as output in main U-Boot
>
>     alloc_simple() alloc space exhausted
>
> With this patch the default values of SYS_MALLOC_F_LEN and
> SPL_SYS_MALLOC_F_LEN on ARCH_SUNXI are raised to 0x2000.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>

With current pine64-lts_defconfig we get a warning:

"alloc space exhausted"

So, please, merge the patch.

Best regards

Heinrich
Simon Glass Aug. 25, 2020, 4:57 p.m. UTC | #2
On Mon, 24 Aug 2020 at 22:15, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> On 7/25/20 8:18 PM, Heinrich Schuchardt wrote:
> > The current default of 0x400 for SYS_MALLOC_F_LEN is too small if any
> > additional drivers marked as DM_FLAG_PRE_RELOC are loaded before
> > relocation.
> >
> > CONFIG_RSA=y which is needed for UEFI secure boot or for FIT image
> > verification loads the driver mod_exp_sw which has DM_FLAG_PRE_RELOC.
> >
> > CONFIG_LOG=Y is another setting requiring additional early malloc
> > area, cf. log_init().
> >
> > When running pine64-lts_defconfig with CONFIG_RSA=y and debug UART enabled
> > we see as output in main U-Boot
> >
> >     alloc_simple() alloc space exhausted
> >
> > With this patch the default values of SYS_MALLOC_F_LEN and
> > SPL_SYS_MALLOC_F_LEN on ARCH_SUNXI are raised to 0x2000.
> >
> > Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> > Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
>
> With current pine64-lts_defconfig we get a warning:
>
> "alloc space exhausted"
>
> So, please, merge the patch.

Reviewed-by: Simon Glass <sjg@chromium.org>

>
> Best regards
>
> Heinrich
diff mbox series

Patch

diff --git a/Kconfig b/Kconfig
index 566ca72c92..513ccda8f2 100644
--- a/Kconfig
+++ b/Kconfig
@@ -182,7 +182,7 @@  config SYS_MALLOC_F_LEN
 	default 0x2000 if (ARCH_IMX8 || ARCH_IMX8M || ARCH_MX7 || \
 			   ARCH_MX7ULP || ARCH_MX6 || ARCH_MX5 || \
 			   ARCH_LS1012A || ARCH_LS1021A || ARCH_LS1043A || \
-			   ARCH_LS1046A || ARCH_QEMU)
+			   ARCH_LS1046A || ARCH_QEMU || ARCH_SUNXI)
 	default 0x400
 	help
 	  Before relocation, memory is very limited on many platforms. Still,