craigphicks
Posts: 3
Joined: Fri Apr 19, 2019 11:00 pm

How to set RAM size so that start.elf knows the right value - OpenWRT

Sat Apr 20, 2019 12:25 am

I'm running a RPi3B+ specific OpenWRT kernel.

Code: Select all

# uname -a
Linux OpenWrt 4.9.152 #0 SMP Mon Jan 28 08:54:32 2019 aarch64 GNU/Linux
The RPi3B+ specific openwrt kernel is

Code: Select all

https://downloads.openwrt.org/releases/18.06.2/targets/brcm2708/bcm2710/openwrt-18.06.2-brcm2708-bcm2710-rpi-3-ext4-factory.img.gz
The device has actual RAM of 1GB (confirmed when running raspbian-stretch-lite). However, when running with the openwrt kernel the memory specified in the kernel cmdline is only 256MB:

Code: Select all

# cat /proc/cmdline
8250.nr_uarts=1 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708_fb.fbswap=1 vc_mem.mem_base=0xec00000 vc_mem.mem_size=0x10000000  dwc_otg.lpm_enable=0 console=ttyS0,115200 kgdboc=ttyS0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=squashfs,ext4 rootwait
You can see the argument

Code: Select all

vc_mem.mem_size=0x10000000

which is 256MB.

I am using the same "start.elf" file for the raspbian-stretch-lite and the openwrt kernels. In the case of raspbian stretch lite the memory is the correct size 1GB. A grep of "start.elf" shows:

Code: Select all

/boot/start.elf ::: 
 vc_mem.mem_base=0x%x vc_mem.mem_size=0x%x 
so I think there is difference in the parameters that "start.elf" is reading at boot time.

I would be grateful for any advice as to what or where that/those RAM size parameter(s) might be.

User avatar
rpdom
Posts: 15178
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: How to set RAM size so that start.elf knows the right value - OpenWRT

Sat Apr 20, 2019 6:14 am

Have you got a gpu_mem=xxx or similar entries in config.txt?

craigphicks
Posts: 3
Joined: Fri Apr 19, 2019 11:00 pm

Re: How to set RAM size so that start.elf knows the right value - OpenWRT

Sun Apr 21, 2019 3:13 am

Yes - I did try those parameters which sets aside a certain amount of memory for the GPU.
However it didn't make a difference.

User avatar
rpdom
Posts: 15178
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: How to set RAM size so that start.elf knows the right value - OpenWRT

Sun Apr 21, 2019 3:19 am

Those values set the split between gpu and cpu. That is what is used by start.elf.

What does your cmdline.txt look like?

Return to “Linux Kernel”