summaryrefslogtreecommitdiff
path: root/Platform/RaspberryPi
AgeCommit message (Collapse)AuthorFilesLines
8 daysPlatform/RaspberryPi: Fix mailbox tag struct alignment for GET_MAC_ADDRESSvaltzu1-5/+2
The mailbox property interface expects every tag's value buffer to be padded to a 32-bit boundary so the following tags and the end tag stay aligned. Commit 61708392042b ("RPiFirmwareDxe: Fix and consolidate incorrect pragma pack blocks") wrapped every mailbox tag struct in a module-wide #pragma pack(1). RPI_FW_MAC_ADDR_TAG then no longer rounds up to a multiple of 4: the packed tag is 10 bytes (6-byte MAC address + 4-byte "UINT32 Padding"), which leaves the trailing end tag misaligned. Recent VideoCore firmware rejects such a request with a 0x80000001 partial response, so RpiFirmwareGetMacAddress () fails and callers fall back to an all-zero MAC address. None of these tag structs actually need packing - they are all built from UINT32 fields and are laid out identically packed or not. The sole exception was RPI_FW_SERIAL_TAG's UINT64, which would otherwise be padded to an 8-byte boundary inside the tag body. Drop the #pragma pack block entirely, express the serial as UINT32[2] (read back with CopyMem) and remove the now-unneeded RPI_FW_MAC_ADDR_TAG padding member; the enclosing command struct's natural alignment keeps the end tag aligned. Signed-off-by: valtzu <valtzu@gmail.com>
2026-07-21Platform/RaspberryPi: Add GPTLib dependencyThamballi Sreelalitha2-0/+2
Add GPTLib to the affected RaspberryPi platform DSC files to resolve build failures caused by the introduction of the new GPTLib dependency in edk2. Signed-off-by: Thamballi Sreelalitha <sreelali@qti.qualcomm.com>
2026-06-18Global: Include AcpiHelperMacros.h for ACPI helper macrosVarshit Pandya6-21/+21
Update platform ACPI table sources to include AcpiHelperMacros.h for the ACPI helper macros that moved out of AcpiLib.h. For files that only use the helper macros, replace the AcpiLib.h include with AcpiHelperMacros.h. For SbsaQemuAcpiDxe, keep AcpiLib.h because the driver also uses AcpiLib APIs, and add AcpiHelperMacros.h for the moved macro definitions. This change depends on the companion edk2 change: "EmbeddedPkg,MdeModulePkg,DynamicTablesPkg: Move ACPI helper macros" Tested: Affected platform DSCs: AARCH64 GCC NOOPT SGI affected platforms passed; other affected platforms fail due to missing local assets/dependencies unrelated to the include migration. Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-05-28Global: Switch AArch64 platforms to CpuExceptionHandlerLibVishal Oliyil Kunnil2-4/+2
Replace ArmPkg DefaultExceptionHandlerLib and ArmExceptionLib with UefiCpuPkg/CpuExceptionHandlerLib across AArch64 platforms. Signed-off-by: Vishal Oliyil Kunnil <vishalo@qti.qualcomm.com>
2026-05-07Platform/RaspberryPi: Revert "use DEBUG for DXE driver"Ard Biesheuvel1-7/+8
This reverts commit 29203d6aa8d2197be9401dd96c112ccb320708d0. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2026-04-17Global: Consume ArmLib from MdePkgOliver Smith-Denny2-2/+2
edk2 is moving ArmLib to MdePkg. Update DSCs accordingly. Signed-off-by: Oliver Smith-Denny <osde@microsoft.com> [ardb: add missed instance in N1SdpPlatform.dsc] Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2026-04-09use DEBUG for DXE driverRaymond Yang1-8/+7
2025-11-06Platform/RaspberryPi: Add support for Raspberry Pi Zero 2 WArd Biesheuvel1-0/+3
Add support for the Raspberry Pi variant Zero 2 W, which is based on the same SoC as the Raspberry Pi 3. This is needed in order to correctly identify the SoC peripherals such as the MMC/SD controller. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-10-02Platform/RaspberryPi: add default PeilessSecMeasureLibLevi Yun2-0/+2
As edk2 introduce PeilessSecMeasureLib [0], PeilessSec requires to link PeilessSecMeasureLib. Set the default PeilessSecMeasureLib with PeilessSecMeasureNullLib. Link: https://github.com/tianocore/edk2/pull/11344 [0] Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2025-09-30Platform/RaspberryPi: Update uses of SMBIOS type 4 and 7 structuresSarah Walker1-14/+13
Use SMBIOS_CACHE_SIZE, SMBIOS_CACHE_SIZE2 and AArch64 PROCESSOR_ID_DATA structures. Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
2025-07-28Platform/RaspberryPi: add ArmTransferListLib for PeilessSecLevi Yun2-0/+2
Since the edk2 commit b1096651d808 ("ArmPlatformPkg: Capture TransferList information for PeilessSec") PeilessSec requires the ArmTransferListLib. To resolve build failure, add ArmTransferListLib. Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2025-07-08Platform/RaspberryPi: Remove UGA supportPierre Gondois3-9/+0
The Universal Graphics Adapter (UGA) is a graphic abstraction. The UGA I/O and Draw protocols are deprecated since UEFI 2.0 was introduced. Cf. the UEFI spec v2.9: "Appendix L - EFI 1.10 Protocol Changes and Deprecation List" section L.2 "Deprecated Protocols" Remove the UGA support. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-07-08Various packages: add missing UefiCpuPkg dependency for ArmMmuLibLeif Lindholm1-0/+1
Commit 7516ab83ff67 ("Update ArmMmuLib library path") did what it says, but some packages in the tree have their own modules making use of ArmMmuLib, without previously having declared a dependency on UefiCpuPkg. Add the missing dependencies. Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-07-05Update ArmMmuLib library pathAjan Zhong2-2/+2
ArmMmuLib is moved from ArmPkg to UefiCpuPkg, update ArmMmuLib path for all platforms to adapt EDK2 change. Signed-off-by: Ajan Zhong <ajan.zhong@newfw.com>
2025-06-02Platform/RaspberryPi: migrate RPi3/RPi4 to MdePkg BaseFdtLibLeif Lindholm3-61/+56
EmbeddedPkg FdtLib is getting deleted. Migrate RPI to MdePkg BaseFdtLib which is the replacement. Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-05-27Platform/RaspberryPi/Readme: Mention Pi 400Alexander Ziaee1-1/+3
Signed-off-by: Alexander Ziaee <ziaee@google.com>
2025-05-25Platform/RaspberryPi: Add missing Hash2Dxe for HTTP bootArd Biesheuvel4-0/+4
HTTP boot has been broken on RPi ever since the PixieFail CVE fixes were applied, as the TCP driver now relies on Hash2Dxe (and the EFI RNG protocol) to produce cryptographically strong sequence numbers. Add the missing driver to restore HTTP boot functionality. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-04-30Platform/RaspberryPi: use MdePkg BaseFdtLibLeif Lindholm3-5/+10
Map individual users of obsolete EmbeddedPkg FdtLib to that version for now - they will need converting. Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-04-11Various Arm/AArch64 platforms: make PcdVFPEnabled AArch32-onlyLeif Lindholm2-2/+0
Since UEFI requires AArch64 to support FP/NEON, the Pcd to decide whether to enable (or disable trapping of) those instructions has changed to be ARM-only in edk2, and the enabling to be unconditional for AArch64. So drop the explicit setting to 1 for all AArch64 platforms, and move the setting to a .ARM section for the one dual-architecture platform in the tree (Juno) Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-04-10Platform/RaspberryPi: RPi4: Update Library Paths for SMC/SVC/FFAKun Qin1-1/+1
This commit adapts to the new locations of the SMC, SVC, and FFA libraries following their relocation from ArmPkg. The changes are based on the updates introduced in the following PR: https://github.com/tianocore/edk2/pull/10929. Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-10Platform/RaspberryPi: RPi3: Update Library Paths for SMC/SVC/FFAKun Qin1-1/+1
This commit adapts to the new locations of the SMC, SVC, and FFA libraries following their relocation from ArmPkg. The changes are based on the updates introduced in the following PR: https://github.com/tianocore/edk2/pull/10929. Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-01-30Platform,Silicon: Remove references to ArmDisassemblerLibArd Biesheuvel2-2/+0
ArmDisassemblerLib is no longer used, and will be removed from edk2. So drop all references to it across the repo. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-30Platform/Silicon: drop PcdRelocateVectorTable from various Arm .dsc filesLeif Lindholm2-6/+0
These platforms all set PcdRelocateVectorTable to its default value of FALSE. Since the Pcd is getting dropped in edk2, skip the setting here. Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-01-17Platform/RPi4: Use v2 specific GIC driverArd Biesheuvel2-4/+2
Switch to the v2 specific GIC DXE driver, which is the only thing this platform implements. While at it, drop references to GIC related libraries and PCDs that no longer exist. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-17Platform/RaspberryPi4: Fix EFI runtime region for varstore accessArd Biesheuvel2-13/+4
Commit 991b802e8f70 ("Platform/RPi4: Allocate more space for UEFI image") reorganized the Flash Device (FD) layout to accommodate the growing size of the firmware, and reserved some additional space to be used for ACPI PCC channel data in the future. This additional allocation was added at the end of the FD, after the varstore image, while the mapping code in PlatformLib expects the varstore related regions to live at the very end. The upshot is that the varstore region in the FD is no longer mapped for runtime access, resulting in runtime service crashes when attempting to access the varstore from under the OS. Fix this in PlatformLib, by extending the varstore memory region to include everything that comes after it. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-11-14Cleanup Null Stack Cookie ImplementationOliver Smith-Denny2-6/+0
edk2 PR https://github.com/tianocore/edk2/pull/6433 cleans up the null stack cookie implementation, no longer requiring DSCs to manually add the null stack cookie lib to Sec modules. This commit changes all DSCs in edk2-platforms to drop the manual adding. Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-11-06GLOBAL: Align MDEPKG_NDEBUG dependent code with edk2 debug macro changesMike Beaton1-7/+5
edk2 commit ae83c6b7fd83a5906e016a32027c1bcd792a624e updates the 'null' variants of the DebugLib macros (used when MDEPKG_NDEBUG is defined) so that they explicitly discard their parameters using `if (FALSE)` code blocks. These are understood as marking the contained code as referenced but unused by all supported compilers. This avoids the need for additional MDEPKG_NDEBUG dependent code in c files, to conditionally hide static methods or functions which are only used in debug macros. Now, such code can and must be removed. This commit updates the relevant MDEPKG_NDEBUG code in c files throughout edk2-platforms (there are only some 20 instances). We also fix a couple of cases where the wrapped variables had incorrectly not been marked STATIC. Since the RELEASE builds of all platforms which used this kind of code break after the above-mentioned edk2 commit, it is considered preferable to have one single cross-platform commit to edk2-platforms which resolves this, rarther than spreading the fix across multiple commits. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Mike Beaton <mjsbeaton@gmail.com>
2024-10-03Platform/RaspberryPi/RPiFirmwareDxe: Fix and consolidate incorrect pragma ↵valtzu1-256/+225
pack blocks This fixes serial number on RPi4 – it is now the actual serial number instead of MAC address. Signed-off-by: valtzu <valtzu@gmail.com>
2024-09-24Update to New StackCheckLibOliver Smith-Denny2-6/+6
edk2 PR https://github.com/tianocore/edk2/pull/5957 removed BaseStackCheckLib and added StackCheckLibNull (amongst others). This PR updates all dscs/dsc.incs to remove the old BaseStackCheckLib and if appropriate, add StackCheckLibNull to LibraryClasses.common.SEC or to specific SEC libs. For all other component types, MdeLibs.dsc.inc links them to StackCheckLibNull. This does all dscs at once as it is formulaic and fixes build breaks. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-09-24Platform/RPi4: Allocate more space for UEFI imageJeremy Linton3-17/+26
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 <jeremy.linton@arm.com>
2024-09-16Update code to be more C11 compliant by using __func__Rebecca Cran10-129/+129
__FUNCTION__ is a pre-standard extension that gcc and Visual C++ among others support, while __func__ was standardized in C99. Since it's more standard, replace __FUNCTION__ with __func__ throughout edk2-platforms. Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2024-09-16Replace deprecated EFI_D_* with DEBUG_*Rebecca Cran1-2/+2
Replaced the deprecated EFI_D_{INFO,WARN,ERROR,VERBOSE} usage with DEBUG_{INFO,WARN,ERROR,VERBOSE}. Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2024-09-16ARM/AARCH64 Platforms: Drop ArmCompilerIntrinsicsLibOliver Smith-Denny2-12/+0
edk2 PR https://github.com/tianocore/edk2/pull/6048 moves ArmCompilerIntrinsicsLib to MdePkg and into MdeLibs.dsc.inc. This patch drops all of the references to the ArmPkg location as these platforms are now getting it from MdeLibs.dsc.inc. This is done in one shot as it is a breaking change and has no functional impact. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-09-16Arm/AARCH64 Platforms: Update AsmMacroLib.h IncludesOliver Smith-Denny1-1/+1
edk2 PR https://github.com/tianocore/edk2/pull/6048 moves AsmMacroIoLib.h and AsmMacroIoLibV8.h to MdePkg and renames them to Arm/AsmMacroLib.h and AArch64/AsmMacroLib.h, respectively. This updates all edk2-platforms in one go, as this is a breaking change and no functional change. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-08-28Platform AARCH64: Move PrePi users to PeilessSec.infArd Biesheuvel4-8/+6
PrePi has been superseded by PeilessSec.inf, which is a more common naming for the SEC module, aligned with other architectures. No functional changes intended. Switch all users to PeilessSec.inf so the old implementation can be retired from EDK2. No ArmPlatformStackLib resolution is needed in this case, so drop those as well. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Jeremy Linton <jeremy.linton@arm.com> Tested-by: Jeremy Linton <jeremy.linton@arm.com>
2024-08-27Platform/ ARM AARCH64: Remove ArmPlatformLib MPCore boilerplateArd Biesheuvel1-27/+0
Remove all the ArmPlatformLib routines that are no longer used now that the MPCore SEC drivers have been retired. The prototypes will be removed from the ArmPlatformLib library class in a subsequent EDK2 change. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com> Reviewed-by: Nhi Pham <nhi@os.amperecomputing.com> Tested-by: Nhi Pham <nhi@os.amperecomputing.com>
2024-07-30Platform/RaspberryPi: Drop platform specific EfiResetSystemLibArd Biesheuvel7-211/+0
Drop the now unused EfiResetSystemLib implementation, which has been superseded by the generic one from EDK2. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-07-30Platform/RaspberryPi: Switch to generic reset runtimeArd Biesheuvel8-9/+14
Drop the reference to the special reset runtime DXE driver in EmbeddedPkg, and move to the one in MdeModulePkg shared between all architectures. This version implements reset notifications, allowing us to retire the home grown version of that functionality in a subsequent patch. Add depexes to the components that rely on the reset notification protocols to ensure that they are not dispatched before those protocols are made available by the reset runtime DXE driver. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-07-30Platform/RaspberryPi/PlatformBootManagerLib: Reimplement reset hookArd Biesheuvel2-0/+79
Duplicate the logic that is triggered on a system reset into the platform boot manager driver, and hook it up to the EDK2 platform specific reset notification driver. This is supported by generic EDK2 code in MdeModulePkg, allowing us to retire the platform-specific EfiResetSystemLib implementation in a subsequent patch. This is needed because this library class and its only user ResetRuntimeDxe in EmbeddedPkg are deprecated and are going to be removed. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-07-30Platform/RaspberryPi/VarBlockServiceDxe: Register for reset notificationArd Biesheuvel2-3/+33
In addition to setting up the home grown reset notification, register with the generic EFI protocol that does the same. This event is triggered from the reset runtime implemented in MdeModulePkg, to which we will be switching the RPi platforms in a subsequent patch. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-07-30Platform/RaspberryPi/VarBlockServiceDxe: Refactor DumpVars event handlerArd Biesheuvel1-6/+14
The DumpVars() routine is called directly and via an event notification callback, and the latter therefore defines the function's prototype, even though the arguments are unused. We will introduce another callback into this logic, but via a reset notifier, which has yet another prototype. So to keep things tidy, drop the formal parameters from DumpVars() and invoke it via a helper function that discards the arguments when called as a event notification callback. We will do the same for the reset notification once that functionality gets added. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-07-30Platform/RaspberryPi: Use depex based dispatch order for varstoreArd Biesheuvel4-2/+14
The VarBlockServiceDxe driver needs to be dispatched before the common VariableRuntimeDxe, but we are currently relying on FDF order and lack of transitive dependencies for this, which is fragile, and will break once we move to the generic reset runtime. So use the existing helper library for this, which can be plugged into the generic variable drivers, and force them to depex on a GUID that can be installed as a NULL protocol in VarBlockServiceDxe. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-07-30Platform/RaspberryPi: Fix line endings in DSCsArd Biesheuvel2-2/+2
Get rid of spurious LF-only line endings. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-07-30Platform/RaspberryPi: Mark RAM regions as write/execute protectableArd Biesheuvel1-0/+2
Mark RAM ranges as write/execute protectable in the GCD memory map. This is needed to avoid issues with NonCoherentDmaLib in EmbeddedPkg, which will fail if it does not manage to set the EFI_MEMORY_XP attribute on the allocated DMA buffers. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-03-12Platform/RaspberryPi: Check for Boot Discovery Policy change.Grzegorz Bernacki1-1/+23
This patch adds checks if Boot Discovery Policy has been changed. Only in that case EfiBootManagerRefreshAllBootOption() should be called. Signed-off-by: Grzegorz Bernacki <gjb@semihalf.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2024-03-11Platform/RaspberryPi: Update PCIe MMIO window for DTJeremy Linton2-0/+28
Since we are updating the DT memory map and telling it how we have configured the PCIe, there isn't a reason for moving the MMIO window. In fact this appears to fix OpenBSD+DT as well as it makes the linux XHCI reset sequence happier. Signed-off-by: Jeremy Linton <jeremy.linton@arm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2024-03-11Platform/RaspberryPi: Give the user control over the XHCI mailboxJeremy Linton9-0/+50
It's a complete tossup whether removing the mailbox call after we have set up the XHCI works for a given kernel+distro in DT mode. So lets give users who want to try DT the option of flipping this on/off. Users that don't want to have to deal with DT, can use ACPI. Signed-off-by: Jeremy Linton <jeremy.linton@arm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2024-03-11Platform/RaspberryPi: Cleanup menu visibilityJeremy Linton1-3/+3
Lets allow some of these options to change when the system is in ACPI+DT mode. Plus the fan temp should be disabled when ACPI isn't enabled. Signed-off-by: Jeremy Linton <jeremy.linton@arm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2023-12-01Platform/RaspberryPi: Add ImagePropertiesRecordLib InstanceTaylor Beebe2-0/+2
ImagePropertiesRecordLib is used by DxeMain and PiSmmCore, so it needs to be added to most platforms. Signed-off-by: Taylor Beebe <taylor.d.beebe@gmail.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Jeremy Linton <jeremy.linton@arm.com>
2023-11-22multiple Arm platforms: set WritePolicyValid for all cache typesMarcin Juszkiewicz1-1/+1
acpiview complains: ERROR: On Arm based systems, all cache properties must be provided in the cache type structure. Missing 'Write Policy Valid' flag. ACPI specification says: > Set to 1 if the write policy attribute described is valid. A value > of 0 indicates that, where possible, processor architecture specific > discovery mechanisms should be used to ascertain the value of this > attribute. Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>