Memory size detected wrong on 4gb model as 8gb

hi *,

i just updated my u-boot and payload and now my 4gb model seems to feel like it has 8gb of ram - sadly running something like “memtester 6G” quickly shows that the upper half of that is just vapour-ram - looks like there is something wrong with the memory detection - at least if it is the same for others too. all this is with the full 69 image.

adding mem=4000M in /boot/boot/extlinux/extlinux.conf is a workaround to avoid crashes whenever the systems tries to access the nonexisting part of the memory

best wishes - hexdump

Can you show me your startup log?

sure - i will post it here in the next days - first i have to find a usb serial converter and connect it to the tty console

best wishes - hexdump

@kira - i now have a serial console connected and here is the boot log without a limiting mem=4000M option: https://pastebin.com/raw/numnDK9u

u-boot seems to get the memory size right, but the kernel somehow seems to get it wrong

best wishes - hexdump

@kira - problem solved - i just built the VF2_v2.6.0 kernel and that one is detecting the memory size properly as 4gb :slight_smile:

1 Like

please use the latest spl and uboot,it will show you the right memory size

1 Like

i’m using v2.5.0 for both (will maybe update to v2.6.0 soon) and i think that was not relevant - changing the kernel to v2.6.0 made a difference as the kernel since then detects the memory size properly (u-boot was right already before - the kernel was wrong)

best wishes - hexdump

1 Like

From my basic understanding there are 4 main stages to the boot process (5 if you count OpenSBI which is loaded with u-boot, 6 if you count Linux daemons/services, and 7 if you count the user running applications):

ROM-> CPU L1 cache (32 KiB) binary is 32 KiB
spl-u-boot->CPU L2 Cache (2 MiB) binary is typically about 125~140 KiB
u-boot->main DDR RAM (2/4/8 GiB) binary is typically about 2.7 MiB
kernel->main DDR RAM (2/4/8 GiB) binary manages all the RAM

It is up to the spl-u-boot to configure the LPDDR4 memory controller, and then load the next boot stage into LPDD4 RAM. So it should always be updated because if there is a bad configuration of the DDR RAM, it is probably the source of the problem.