Hi Jonas,

On 5/21/24 1:57 PM, Jonas Karlman <jo...@kwiboo.se> wrote:
Hi Quentin,

On 2024-05-21 11:53, Quentin Schulz wrote:
> Hi all,
>
> On 5/20/24 6:06 PM, Tom Rini wrote:
>> Hey all,
>>
>> It's release day and here is -rc3. At this point, I think we're firmly
>> on "bug fix and documentation" ground moving forward for changes to
>> v2024.07 and the next branch is open and ready for use and pull
>> requests.
>>
>> In terms of a changelog,
>> git log --merges v2024.07-rc2..v2024.07-rc3
>> contains what I've pulled but as always, better PR messages and tags
>> will provide better results here.
>>
>> I hope to remain on schedule and that means the rest of the rcs every
>> other Monday, and with final release on Monday, July 1st, 2024. Thanks
>> all!
>>
>
> Just to let you know that Rockchip PX30 support is broken since
> 
https://source.denx.de/u-boot/u-boot/-/commit/1d01440b3f14f6648cd672da619489f635cb209c
> (at the very least on Ringneck, haven't tested on PX30 Mini-EVB yet).
>
> U-Boot proper pre-reloc seems to be running out of memory and we cannot
> reach U-Boot CLI anymore.
>
> I hope I'll have time to look into this before v2024.07 is released but
> cannot promise anything.

On Rockchip platform all DRAM is available at U-Boot proper pre-reloc,
so there is no need to limit SYS_MALLOC_F_LEN to a small amount.

Ringneck seem to use 8 KiB for pre-reloc malloc() pool, please try with
a 64 KiB pool, same as rk3308/rk3328/rk3399/rk356x/rk3588 all now use.

   CONFIG_SYS_MALLOC_F_LEN=0x10000


This made it work, thanks for the hint.

malloc() pool size used by TPL/SPL should still work:

   CONFIG_TPL_SYS_MALLOC_F_LEN=0x600
   CONFIG_SPL_SYS_MALLOC_F_LEN=0x2000

Also check the "Early malloc usage" from bdinfo cmd, should show how
much memory was actually allocated at pre-reloc, from a rk3308 board:

   Early malloc usage: 2060 / 10000


"""
=> bdinfo
boot_params = 0x0000000000000000
DRAM bank   = 0x0000000000000000
-> start    = 0x0000000000200000
-> size     = 0x000000007fe00000
flashstart  = 0x0000000000000000
flashsize   = 0x0000000000000000
flashoffset = 0x0000000000000000
baudrate    = 115200 bps
relocaddr   = 0x000000007ff53000
reloc off   = 0x000000007fd53000
Build       = 64-bit
current eth = ethernet@ff360000
ethaddr     = f6:3c:b5:0d:0a:13
IP addr     = <NULL>
fdt_blob    = 0x000000007df43bd0
new_fdt     = 0x000000007df43bd0
fdt_size    = 0x000000000000c1e0
lmb_dump_all:
memory.cnt = 0x1 / max = 0x10
memory[0]       [0x200000-0x7fffffff], 0x7fe00000 bytes flags: 0
reserved.cnt = 0x1 / max = 0x10
reserved[0]     [0x7df3f580-0x7fffffff], 0x020c0a80 bytes flags: 0
devicetree  = separate
serial addr = 0x00000000ff030000
width      = 0x0000000000000004
shift      = 0x0000000000000002
offset     = 0x0000000000000000
clock      = 0x00000000016e3600
arch_number = 0x0000000000000000
TLB addr    = 0x000000007fff0000
irq_sp      = 0x000000007df43bc0
sp start    = 0x000000007df43bc0
Early malloc usage: 2250 / 10000
"""

The default on PX30 for SYS_MALLOC_F_LEN is 0x400 (both from 
arch/arm/mach-rockchip/px30/Kconfig and Kconfig).

The default for SPL_SYS_MALLOC_F_LEN is SYS_MALLOC_F_LEN.

The default for TPL_SYS_MALLOC_F_LEN is SPL_SYS_MALLOC_F_LEN.

I suggest we change the default SYS_MALLOC_F_LEN to be 0x20000 then, on PX30.

Since we have forced TPL support on PX30, we can keep SPL_SYS_MALLOC_F_LEN is 
SYS_MALLOC_F_LEN, because we necessarily have DRAM support in SPL so we are 
much less limited in allocation.

Since all PX30 boards have 0x600 for TPL_SYS_MALLOC_F_LEN I suggest to make 
this the default as well?

Anything against this?

I'm also a bit confused as to why we need to specify the size of the allocation 
pool pre-relocation? Why is this important?

Thanks a lot for the hint, I can now work on migrating PX30 to OF_UPSTREAM :)

Cheers,
Quentin

Reply via email to