rgl / rpi4-uefi-ipxe

UEFI iPXE for the Raspberry Pi 4 ARM64
17 stars 6 forks source link

RAM still limited to 3GB #3

Open JeanMertz opened 4 months ago

JeanMertz commented 4 months ago

I found your repository as I was looking for a RPI4 EUFI solution that unlocks all of the 8GB of my RPI.

I had this script previously to put the files in /boot:

wget https://github.com/pftf/RPi4/releases/download/v1.35/RPi4_UEFI_Firmware_v1.35.zip;
unzip RPi4_UEFI_Firmware_v1.35.zip;

This worked, and my rpi boots, but only has 3GB of RAM available.

I've since switched the script to:

wget https://github.com/rgl/rpi4-uefi-ipxe/releases/download/v0.8.0/rpi4-uefi-ipxe.zip;
unzip rpi4-uefi-ipxe.zip;

After recreating my disks, and running the script, my raspberry still boots, but free -m still shows only 3GB of ram available.

Here are some details on the partition itself:

parted /dev/sda1 print
Model: Unknown (unknown)
Disk /dev/sda1: 7952MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:

Number  Start  End     Size    File system  Flags
 1      0.00B  7952MB  7952MB  fat32

Any thoughts on what could be causing this?

rgl commented 4 months ago

I'm not sure you need to use this repo image. Probably you are looking for the 64-bit OS available at https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-64-bit which will use all your RPI memory. If so, this repo image is not needed.

This repo contains an UEFI firmware image that is configured to use the whole PI RAM thru an UEFI variable; which is equivalent of setting this in the UEFI firmware setup:

image

With this UEFI image, my 8GB RPI4, the UEFI firmware setup application shows the expected 8GB:

image

Besides the UEFI firmware being configured to use more than 3GB, your OS must also support (or be configured) that too. Typically, you need to run a 64-bit OS like the above.

JeanMertz commented 3 months ago

Thank you for the information. I should have provided you with more details up-front.

To clarify:

rgl commented 3 months ago

Nice cluster you got there!

But, I'm afraid I do not known how to help; I never tried that combination.

In case you didn't notice, the actual UEFI firmware is developed at the upstream https://github.com/pftf/RPi4 project, which itself, is building the upstream edk2 project with some extra patches (maybe today the number of patches are non-existent; I have not been able to keep track of it). In case you didn't already, I would ask there.

BTW, I've just noticed there was a recent release at https://github.com/pftf/RPi4/releases/tag/v1.36 maybe that helps with NixOS?

rgl commented 3 months ago

I've released https://github.com/rgl/rpi4-uefi-ipxe/releases/tag/v0.9.0 with the https://github.com/pftf/RPi4/releases/tag/v1.36 and described how to load the debian kernel and show the free memory (with my rpi4 it shows the expected ~8 GiB of total memory).

rgl commented 3 months ago

oh, the previously released artifacts were not actually configuring the firmware to not limit the ram to 3GB. that was only being done when I built them locally. this is now fixed in https://github.com/rgl/rpi4-uefi-ipxe/releases/tag/v0.10.0. please given them a try and let me know how it goes.