* [PATCH v2 1/1] arm: sunxi: increase SYS_MALLOC_F_LEN
@ 2020-06-08 10:59 Heinrich Schuchardt
2020-06-08 11:50 ` Jagan Teki
0 siblings, 1 reply; 6+ messages in thread
From: Heinrich Schuchardt @ 2020-06-08 10:59 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 is raised to 0x2000.
The default for SPL_SYS_MALLOC_F_LEN on ARCH_SUNXI is explicitely set to
0x400 to avoid an increased usage of SRAM on elder SoCs.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
v2
keep default for SPL_SYS_MALLOC_F_LEN at 0x400
---
Kconfig | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Kconfig b/Kconfig
index 0e7ccc0b07..67b594cd74 100644
--- a/Kconfig
+++ b/Kconfig
@@ -146,7 +146,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_LS1046A || ARCH_SUNXI)
default 0x400
help
Before relocation, memory is very limited on many platforms. Still,
@@ -166,6 +166,7 @@ config SPL_SYS_MALLOC_F_LEN
hex "Size of malloc() pool in SPL before relocation"
depends on SYS_MALLOC_F && SPL
default 0x2800 if RCAR_GEN3
+ default 0x400 if ARCH_SUNXI
default SYS_MALLOC_F_LEN
help
Before relocation, memory is very limited on many platforms. Still,
--
2.26.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 1/1] arm: sunxi: increase SYS_MALLOC_F_LEN
2020-06-08 10:59 [PATCH v2 1/1] arm: sunxi: increase SYS_MALLOC_F_LEN Heinrich Schuchardt
@ 2020-06-08 11:50 ` Jagan Teki
2020-06-08 12:17 ` Heinrich Schuchardt
0 siblings, 1 reply; 6+ messages in thread
From: Jagan Teki @ 2020-06-08 11:50 UTC (permalink / raw)
To: u-boot
On Mon, Jun 8, 2020 at 6:59 AM 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 is raised to 0x2000.
> The default for SPL_SYS_MALLOC_F_LEN on ARCH_SUNXI is explicitely set to
> 0x400 to avoid an increased usage of SRAM on elder SoCs.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/1] arm: sunxi: increase SYS_MALLOC_F_LEN
2020-06-08 11:50 ` Jagan Teki
@ 2020-06-08 12:17 ` Heinrich Schuchardt
2020-06-08 12:59 ` Jagan Teki
0 siblings, 1 reply; 6+ messages in thread
From: Heinrich Schuchardt @ 2020-06-08 12:17 UTC (permalink / raw)
To: u-boot
On 08.06.20 13:50, Jagan Teki wrote:
> On Mon, Jun 8, 2020 at 6:59 AM 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 is raised to 0x2000.
>> The default for SPL_SYS_MALLOC_F_LEN on ARCH_SUNXI is explicitely set to
>> 0x400 to avoid an increased usage of SRAM on elder SoCs.
>>
>> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>> ---
>
> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
>
Thanks for reviewing.
All sunxi boards have at least 32 KiB SRAM and only this 32 KiB used by
U-Boot for SPL on all sunxi boards. A BananaPi with A20 CPU boots fine
with SPL_SYS_MALLOC_F_LEN=0x2000. So it seems that also version 1 of the
patch was on the safe side.
Best regards
Heinrich
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/1] arm: sunxi: increase SYS_MALLOC_F_LEN
2020-06-08 12:17 ` Heinrich Schuchardt
@ 2020-06-08 12:59 ` Jagan Teki
2020-07-25 7:49 ` Heinrich Schuchardt
0 siblings, 1 reply; 6+ messages in thread
From: Jagan Teki @ 2020-06-08 12:59 UTC (permalink / raw)
To: u-boot
On Mon, Jun 8, 2020 at 8:25 AM Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> On 08.06.20 13:50, Jagan Teki wrote:
> > On Mon, Jun 8, 2020 at 6:59 AM 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 is raised to 0x2000.
> >> The default for SPL_SYS_MALLOC_F_LEN on ARCH_SUNXI is explicitely set to
> >> 0x400 to avoid an increased usage of SRAM on elder SoCs.
> >>
> >> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> >> ---
> >
> > Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
> >
>
> Thanks for reviewing.
>
> All sunxi boards have at least 32 KiB SRAM and only this 32 KiB used by
> U-Boot for SPL on all sunxi boards. A BananaPi with A20 CPU boots fine
> with SPL_SYS_MALLOC_F_LEN=0x2000. So it seems that also version 1 of the
> patch was on the safe side.
Okay. Planning to push this in MW, since the existing boards look fine.
Jagan.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/1] arm: sunxi: increase SYS_MALLOC_F_LEN
2020-06-08 12:59 ` Jagan Teki
@ 2020-07-25 7:49 ` Heinrich Schuchardt
2020-07-25 17:13 ` Samuel Holland
0 siblings, 1 reply; 6+ messages in thread
From: Heinrich Schuchardt @ 2020-07-25 7:49 UTC (permalink / raw)
To: u-boot
On 6/8/20 2:59 PM, Jagan Teki wrote:
> On Mon, Jun 8, 2020 at 8:25 AM Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>>
>> On 08.06.20 13:50, Jagan Teki wrote:
>>> On Mon, Jun 8, 2020 at 6:59 AM 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 is raised to 0x2000.
>>>> The default for SPL_SYS_MALLOC_F_LEN on ARCH_SUNXI is explicitely set to
>>>> 0x400 to avoid an increased usage of SRAM on elder SoCs.
>>>>
>>>> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>>>> ---
>>>
>>> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
>>>
>>
>> Thanks for reviewing.
>>
>> All sunxi boards have at least 32 KiB SRAM and only this 32 KiB used by
>> U-Boot for SPL on all sunxi boards. A BananaPi with A20 CPU boots fine
>> with SPL_SYS_MALLOC_F_LEN=0x2000. So it seems that also version 1 of the
>> patch was on the safe side.
>
> Okay. Planning to push this in MW, since the existing boards look fine.
>
> Jagan.
>
Hello Jangan,
unfortunately the patch has not made it into mainline yet. Could you,
please, take a look.
The patch is available for download at:
https://patchwork.ozlabs.org/project/uboot/patch/20200608105949.5809-1-xypron.glpk at gmx.de/
Best regards
Heinrich
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/1] arm: sunxi: increase SYS_MALLOC_F_LEN
2020-07-25 7:49 ` Heinrich Schuchardt
@ 2020-07-25 17:13 ` Samuel Holland
0 siblings, 0 replies; 6+ messages in thread
From: Samuel Holland @ 2020-07-25 17:13 UTC (permalink / raw)
To: u-boot
Heinrich,
On 7/25/20 2:49 AM, Heinrich Schuchardt wrote:
> On 6/8/20 2:59 PM, Jagan Teki wrote:
>> On Mon, Jun 8, 2020 at 8:25 AM Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>>> On 08.06.20 13:50, Jagan Teki wrote:
>>>> On Mon, Jun 8, 2020 at 6:59 AM 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 is raised to 0x2000.
>>>>> The default for SPL_SYS_MALLOC_F_LEN on ARCH_SUNXI is explicitely set to
>>>>> 0x400 to avoid an increased usage of SRAM on elder SoCs.
>>>>>
>>>>> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>>>>> ---
>>>>
>>>> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
>>>>
>>>
>>> Thanks for reviewing.
>>>
>>> All sunxi boards have at least 32 KiB SRAM and only this 32 KiB used by
>>> U-Boot for SPL on all sunxi boards. A BananaPi with A20 CPU boots fine
>>> with SPL_SYS_MALLOC_F_LEN=0x2000. So it seems that also version 1 of the
>>> patch was on the safe side.
>>
>> Okay. Planning to push this in MW, since the existing boards look fine.
>>
>> Jagan.
>>
> Hello Jangan,
>
> unfortunately the patch has not made it into mainline yet. Could you,
> please, take a look.
>
> The patch is available for download at:
> https://patchwork.ozlabs.org/project/uboot/patch/20200608105949.5809-1-xypron.glpk at gmx.de/
This patch no longer applies to U-Boot master, since ARCH_QEMU was recently
added to the condition for SYS_MALLOC_F_LEN. Please send a rebased version.
Thanks,
Samuel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-07-25 17:13 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-08 10:59 [PATCH v2 1/1] arm: sunxi: increase SYS_MALLOC_F_LEN Heinrich Schuchardt
2020-06-08 11:50 ` Jagan Teki
2020-06-08 12:17 ` Heinrich Schuchardt
2020-06-08 12:59 ` Jagan Teki
2020-07-25 7:49 ` Heinrich Schuchardt
2020-07-25 17:13 ` Samuel Holland
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.