On Tue, 12 Apr 2022 at 18:01, Rebecca Cran <quic_rc...@quicinc.com> wrote: > > I've been working on cleaning up some of the code in ArmPlatformPkg and > have been trying to understand the differences between PrePi and PrePeiCore. > It looks like PrePi was added to save space over PrePeiCore, but I'm > wondering if we still need it?
Andrew should be able to answer this, as well as Eugene, I imagine. The reason is that PEI is designed to execute in place from NOR flash, and so it assumes that global variables are read-only, except for some 'temporary RAM' located in the cache running in no-evict mode, which includes the stack as well. This permits PEI to configure and initialize the DRAM controller and DRAM. When EDK2 was ported to the BeagleBoard, it relied on a previous boot stage that copied the image into DRAM and executed it from there. This means PEI is unneeded, and SEC can launch the DXE core directly, provided that it creates the minimal PEI context that the DXE core relies on to be able to initialize itself. This is why MemoryPeim, CpuPeim etc are all factored into libraries on ARM, this permits the individual PEIMs to pull in the functionality, but permits a single PrePi SEC stage to pull in those same libraries and have the same functionality. Unfortunately, for things like Capsule Update and measured boot, PrePi is unsuitable unless we factor out those things into libraries as well. Since PEI can happily execute from DRAM as well as NOR flash, this means that for more complete implementations, PrePeiCore is a better choice. Note that SynQuacer also uses PrePeiCore, but actually does run it in place from NOR flash, just like ArmVirtQemu does. Platforms such as Seattle use PrePeiCore but rely on TF-A to copy the entire FD image into DRAM first. > I'm guessing most of the platforms below > could use the latter, possibly with the exception of BeagleBoard and > VExpress? > > > Platforms using PrePi/Pei{Uni,MP}Core: > > RPi3 > RPi4 > HiKey > BeagleBoard > VExpress-FVP > ArmJuno > HiKey960 > DurianPkg > VExpress-CTA15-A7 > > -- > Rebecca Cran > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#89478): https://edk2.groups.io/g/devel/message/89478 Mute This Topic: https://groups.io/mt/90421325/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-