Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Platform/RPi4: Allocate more space for UEFI image #192

Merged

Conversation

jlinton
Copy link
Contributor

@jlinton jlinton commented Sep 10, 2024

The Pi's UEFI image was sized without thought for much future growth, and its become apparent that its largly outgrown the allocated space when various debug options or edk2 featurees are enabled. Since these images tend to exist on disks which are usually in the GB+ ranges doubling the size of the RPI_EFI.fd image shouldn't be a problem.

This change must be accompanied by build edk2-non-osi changes to TFA which update the RPI3_PRELOADED_DTB_BASE=0x3f0000 and config.txt changes as documented in the README being patched.

Since we are adjusting the image size, lets reserve a 64k block for future PCC channel data structures that are shared between TFA and ACPI as well immediately before the DTB.

@jlinton
Copy link
Contributor Author

jlinton commented Sep 10, 2024

I only updated the rpi4, because I've not seen a problem with the rpi3. But this will need to be merged along with a new TFA to edk-non-osi and config.txt updates to PFTF. I can open them if everyone thinks this is worthwhile.

@jlinton jlinton force-pushed the master_enlarge_image_code_size branch from 86b80cb to f0f0470 Compare September 11, 2024 02:49
@ardbiesheuvel
Copy link
Member

This looks reasonable to me - would it make sense to increase the size of the DT allocation too, now that we are at it?

@jlinton jlinton force-pushed the master_enlarge_image_code_size branch from f0f0470 to 34f557b Compare September 11, 2024 21:44
The Pi's UEFI image was sized without thought for much future growth,
and its become apparent that its largely outgrown the allocated space
when various debug options or edk2 features are enabled. Since these
images tend to exist on disks which are usually in the GB+ ranges
doubling the size of the RPI_EFI.fd image shouldn't be a problem.

This change must be accompanied by build edk2-non-osi changes to TFA
which update the RPI3_PRELOADED_DTB_BASE=0x3e0000 and config.txt
changes as documented in the README being patched.

Since we are adjusting the image size, lets also increase the DTB
reservation to 128K and reserve a 64k block for future PCC channel
data structures that are shared between TFA and ACPI as well
immediately before the DTB.

Signed-off-by: Jeremy Linton <[email protected]>
@jlinton jlinton force-pushed the master_enlarge_image_code_size branch from 34f557b to fd5d03a Compare September 11, 2024 21:47
@jlinton
Copy link
Contributor Author

jlinton commented Sep 11, 2024

That sounds reasonable, so I've doubled it as well, that provides a bit of breathing space if someone adds a bunch of overlays/etc since the base rpi4-b DTB's are all in the mid 50K range already.

This latest update has needs a bit more through testing to validate nothing got broken, which I'm going to do when I return home in a couple hours.

@jlinton
Copy link
Contributor Author

jlinton commented Sep 12, 2024

The 128k DTB appears to require further TFA changes since the 64k size is hardcoded in MAP_NS_DTB

@ardbiesheuvel
Copy link
Member

You mean code changes as opposed to rebuilding it with different defines on the command line, which we need to do in any case, right?

@jlinton
Copy link
Contributor Author

jlinton commented Sep 12, 2024

Yes, although I'm actually looking at the rest of that code now, and it probably doesn't matter currently because there is an overlapping mapping with the same attributes. Looks like TFA cleanup time though.

@leiflindholm leiflindholm merged commit 991b802 into tianocore:master Sep 24, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants