All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/1] arm: sunxi: increase SYS_MALLOC_F_LEN
@ 2020-07-25 18:18 Heinrich Schuchardt
  2020-08-25  4:10 ` Heinrich Schuchardt
  2020-10-21 18:23 ` Jagan Teki
  0 siblings, 2 replies; 6+ messages in thread
From: Heinrich Schuchardt @ 2020-07-25 18:18 UTC (permalink / raw)
  To: u-boot

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(-)

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,
--
2.27.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v3 1/1] arm: sunxi: increase SYS_MALLOC_F_LEN
  2020-07-25 18:18 [PATCH v3 1/1] arm: sunxi: increase SYS_MALLOC_F_LEN Heinrich Schuchardt
@ 2020-08-25  4:10 ` Heinrich Schuchardt
  2020-08-25 16:57   ` Simon Glass
  2020-10-21 18:23 ` Jagan Teki
  1 sibling, 1 reply; 6+ messages in thread
From: Heinrich Schuchardt @ 2020-08-25  4:10 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v3 1/1] arm: sunxi: increase SYS_MALLOC_F_LEN
  2020-08-25  4:10 ` Heinrich Schuchardt
@ 2020-08-25 16:57   ` Simon Glass
  2020-10-08 13:02     ` Heinrich Schuchardt
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Glass @ 2020-08-25 16:57 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v3 1/1] arm: sunxi: increase SYS_MALLOC_F_LEN
  2020-08-25 16:57   ` Simon Glass
@ 2020-10-08 13:02     ` Heinrich Schuchardt
  2020-10-19 22:08       ` André Przywara
  0 siblings, 1 reply; 6+ messages in thread
From: Heinrich Schuchardt @ 2020-10-08 13:02 UTC (permalink / raw)
  To: u-boot

On 25.08.20 18:57, Simon Glass wrote:
> 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

Hello Jagan, hello Maxime,

it is merge window but I could not find this patch in

https://gitlab.denx.de/u-boot/custodians/u-boot-sunxi

Please, take care of the patch.

Best regards

Heinrich

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v3 1/1] arm: sunxi: increase SYS_MALLOC_F_LEN
  2020-10-08 13:02     ` Heinrich Schuchardt
@ 2020-10-19 22:08       ` André Przywara
  0 siblings, 0 replies; 6+ messages in thread
From: André Przywara @ 2020-10-19 22:08 UTC (permalink / raw)
  To: u-boot

On 08/10/2020 14:02, Heinrich Schuchardt wrote:

Hi,

> On 25.08.20 18:57, Simon Glass wrote:
>> 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
> 
> Hello Jagan, hello Maxime,
> 
> it is merge window but I could not find this patch in
> 
> https://gitlab.denx.de/u-boot/custodians/u-boot-sunxi

So apparently since commit 4ab3817ff16a ("clk: fixed-rate: Enable
DM_FLAG_PRE_RELOC flag") even the pine64-lts_defconfig is now broken,
because more malloc space is needed for U-Boot proper before relocation.
This patches fixes is.

So can someone PLEASE merge this patch?

To answer this one lingering question: Apparently the malloc memory for
SPL is taken from DRAM (similar to BSS), so we have plenty. The U-Boot
proper early malloc is taken from SRAM A1 (why?), but we don't need it
for anything else any more, so have enough of it. So the 8KB are safe in
both worlds.

Thanks!
Andre

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v3 1/1] arm: sunxi: increase SYS_MALLOC_F_LEN
  2020-07-25 18:18 [PATCH v3 1/1] arm: sunxi: increase SYS_MALLOC_F_LEN Heinrich Schuchardt
  2020-08-25  4:10 ` Heinrich Schuchardt
@ 2020-10-21 18:23 ` Jagan Teki
  1 sibling, 0 replies; 6+ messages in thread
From: Jagan Teki @ 2020-10-21 18:23 UTC (permalink / raw)
  To: u-boot

On Sat, Jul 25, 2020 at 11:49 PM Heinrich Schuchardt <xypron.glpk@gmx.de> 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>
> ---
> v3:
>         rebased
> v2:
>         keep default for SPL_SYS_MALLOC_F_LEN at 0x400
> ---
>  Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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)

Applied to u-boot-sunix/master

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-10-21 18:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-25 18:18 [PATCH v3 1/1] arm: sunxi: increase SYS_MALLOC_F_LEN Heinrich Schuchardt
2020-08-25  4:10 ` Heinrich Schuchardt
2020-08-25 16:57   ` Simon Glass
2020-10-08 13:02     ` Heinrich Schuchardt
2020-10-19 22:08       ` André Przywara
2020-10-21 18:23 ` Jagan Teki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.