summaryrefslogtreecommitdiff
path: root/ArmPkg/Include
AgeCommit message (Collapse)AuthorFilesLines
7 daysArmPkg: fix spell-check error in ArmPkgYeoreum Yun1-1/+1
CI reports spell-check error in ArmPkg: ERROR - SpellCheck found 7 failing words. See CI log for details. CRITICAL - If these are not errors add this to your ci.yaml file. "SpellCheck": { "ExtendWords": [ "discoery", "evlog", "icdiptr", "itlines", "mstrict", "ppihmr", "trnasfer" ] } Fix this problem. Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2026-07-30ArmPkg: StandaloneMmCoreEntryPoint: Use ARM_FFA_ARGS for misc bufferKun Qin1-3/+3
The MISC_MM_COMMUNICATE_BUFFER stored the FF-A direct message registers in a DIRECT_MSG_ARGS structure. Populating and reading it required manually re-indexing every register (EventSvcArgs->Arg4..Arg17 into DirectMsgArgs.Arg0..Arg13). This shifted the register positions and left the buffer layout inconsistent with the raw FF-A argument register file, making it error prone to correlate a slot with its architectural register. Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2026-07-25ArmPkg: Add Arm SMCCC SoC ID libraryVarshitPandya1-0/+39
Add ArmSmcccSocIdLib to provide a shared interface for checking support for the SMCCC Architecture SoC ID service and retrieving the JEP106 identification code and SoC revision. Move the existing SMCCC SoC ID handling out of ProcessorSubClassDxe and update the driver to use the new library. Continue to use the MIDR value for the SMBIOS Processor ID when the SMCCC SoC ID service is unavailable. This allows other SMBIOS implementations to reuse the SMCCC handling without duplicating it or depending on the legacy ProcessorSubClassDxe driver. Signed-off-by: Varshit Pandya <Varshit.Pandya@arm.com>
2026-07-21ArmPkg: Add SMBIOS Type 4 SocketType handlingRebecca Cran1-0/+1
The SMBIOS Type 4 field SocketType was added in commit 7f505d377b44aeee59f34b3d898f6caf0a0df538 in 2024. This caused the table size to be invalid when platforms specify versions of SMBIOS before 3.8. Update ProcessorSubClassDxe to handle fetching the string for the socket type including calling into OemMiscLib to retrieve it. Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2026-05-29ArmPkg, StandaloneMmPkg: optimise memory permission changeYeoreum Yun2-6/+28
In StandaloneMm, the allowed memory permission combinations are ROX, RO, and RW. At the initial stage, all regions are mapped as ROX. When drivers are loaded for relocation, the image is first mapped as RW. However, the current mechanism introduces significant overhead when changing memory permissions. For example, when changing permissions from ROX to RW, the process is performed in two steps: 1. Clear the execute (X) permission (ROX → RO) 2. Add the write (W) permission (RO → RW) To execute step (1), the system first retrieves the permissions of the target region. This may trigger multiple SMC calls, depending on the permissions of the pages within that region. This permission retrieval operation is redundant, as there is no need to maintain an intermediate state. Nevertheless, it can cause additional SMC calls and coherence operations from the SPMC (e.g., TLB flushes). Therefore, this redundant operation should be removed, and in most cases, the memory permission should be updated with a single “set memory permission” operation. Note: The ArmxxxMemoryRegionxxx() interfaces e.g. ArmSetMemoryRegionNoExec(), etc. return success when the Length parameter is 0 as the SectionHeader.Misc.VirtualSize could be 0 Length like .reloc section: UpdateMmFoundationPeCoffPermissions: Section 2 of image at 0x7004000 has 0x42000040 permissions UpdateMmFoundationPeCoffPermissions: Section 2 of image at 0x7004000 has .reloc name api_ffa_mem_perm_set page_count 0 ERROR: FFA_MEM_PERM_SET: page_count was zero Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2026-05-29ArmPkg/ArmMmuStandaloneMmLib: add missing documentationYeoreum Yun1-0/+72
Some functions in ArmMmuStandaloneMmLib lack documentation. Add appropriate documentation for each function. Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2026-05-28Global: Merge DefaultExceptionHandlerLib into CpuExceptionHandlerLibVishal Oliyil Kunnil1-22/+0
Merge DefaultExceptionHandlerLib into CpuExceptionHandlerLib. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Vishal Oliyil Kunnil <vishalo@qti.qualcomm.com>
2026-02-24ArmPkg: Replace include guards with #pragma onceMichael Kubacki27-108/+27
Replace traditional `#ifndef`/`#define`/`#endif` include guards with `#pragma` once. `#pragma once` is a widely supported preprocessor directive that prevents header files from being included multiple times. It is supported by all toolchains used to build edk2: GCC, Clang/LLVM, and MSVC. Compared to macro-based include guards, `#pragma once`: - Eliminates the risk of macro name collisions or copy/paste errors where two headers inadvertently use the same guard macro. - Eliminate inconsistency in the way include guard macros are named (e.g., some files use `__FILE_H__`, others use `FILE_H_`, etc.). - Reduces boilerplate (three lines replaced by one). - Avoids polluting the macro namespace with guard symbols. - Can improve build times as the preprocessor can skip re-opening the file entirely, rather than re-reading it to find the matching `#endif` ("multiple-include optimization"). - Note that some compilers may already optimize traditional include guards, by recognzining the idiomatic pattern. This change is made acknowledging that overall portability of the code will technically be reduced, as `#pragma once` is not part of the C/C++ standards. However, this is considered acceptable given: 1. edk2 already defines a subset of supported compilers in BaseTools/Conf/tools_def.template, all of which have supported `#pragma once` for over two decades. 2. There have been concerns raised to the project about inconsistent include guard naming and potential macro collisions. Approximate compiler support dates: - MSVC: Supported since Visual C++ 4.2 (1996) - GCC: Supported since 3.4 (2004) (http://gnu.ist.utl.pt/software/gcc/gcc-3.4/changes.html) - Clang (LLVM based): Since initial release in 2007 Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-02-04ArmPkg/Library: update xferlist version to 2Levi Yun1-1/+1
The Firmware Handoff specification has withdrawn the use of the “XOR” checksum and updated the checksum calculation to use “SUM” [0]. Accordingly, libtl has also been updated to reflect this change [1]. The “XOR” checksum calculation existed in version 1; however, as mentioned above, it has been withdrawn, and TF-A always provides the checksum using the “SUM” calculation. Therefore, the xferlist version is updated to version 2. Link: https://github.com/FirmwareHandoff/firmware_handoff/pull/81 [0] Link: https://review.trustedfirmware.org/c/shared/transfer-list-library/+/46033 [1] Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2026-01-16ArmPkg/Include/IndustryStandard: introduce firmware update feature headersLevi Yun1-0/+492
The Platform Security Firmware Update specification, 1.0 for A-profile (https://developer.arm.com/documentation/den0118/latest) describes a standard mechanism for performing firmware updates on Arm platform. This mechanism utilises the Arm Firmware Framework for Arm A-profile specification to transfer the firmware update binaries from the Normal World to the Secure World. An update agent on the Secure world then updates the flash area with the new update image. Add related headers for firmware update feature. Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2026-01-16ArmPkg/StandaloneMmCpu: pass ARM_MM_HANDLER_CONTEXT to MmHandlerLevi Yun2-3/+6
Pass ARM_MM_HANDLER_CONTEXT to MmHandler so it can determine: - whether the request came via FF-A or SPM_MM mode - the service type - whether it is a secure request or the source partition ID Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2026-01-16ArmPkg/Library: add ArmMmHandlerContext for MM handler context managementLevi Yun2-80/+120
Introduce ArmMmHandlerContext.h, which defines the ARM_MM_HANDLER_CONTEXT structure passed to each MmHandler’s Context argument. This structure provides: - The current communication protocol type - The service type - Protocol-specific details This enables MM drivers to differentiate requests from MM communication versus DIRECT_MSG_REQ2, support both SPM_MM and FF-A v1.2, and determine whether a request originated from the secure world. Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2025-09-26ArmPkg: Remove ARM32 SupportOliver Smith-Denny1-8/+1
edk2 is dropping support for the ARM32 architecture. This commit removes ARM32 code from the remaining parts of ArmPkg. Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-09-26ArmPkg: Remove ARM32 Support from ArmMonitorLibOliver Smith-Denny1-2/+0
edk2 is dropping support for the ARM32 architecture. This commit removes ARM32 files from ArmMonitorLib. Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-08-29ArmPkg/ArmTransferList: add TPM_EVENT_LOG informationLevi Yun2-0/+42
Add TRANSFER_EVENT_LOG information according to firmware hand-off spec[0]. and related helper. Links: https://github.com/FirmwareHandoff/firmware_handoff/blob/main/source/transfer_list.rst#tpm-event-log-table-entry-layout-xferlist_evlog Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2025-08-29ArmPkg/Library/ArmTransferList: add helper to get TransferListLevi Yun1-0/+15
Add helper to get TrnasferList from HOB list. Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2025-07-24ArmPkg: Add ArmTransferListHob GuidPrachotan Reddy Bathi1-0/+23
ArmTransferListHobGuid will hold the TransferList base address https://firmwarehandoff.github.io/firmware_handoff Signed-off-by: Prachotan Reddy Bathi <Prachotan.Bathi@arm.com>
2025-07-24ArmPkg/ArmTransferListLib: Add utility functionsPrachotan Reddy Bathi2-3/+67
Added functionality TransferList Library TransferListVerifyChecksum - Verify TransferList CheckSum TransferListCheckHeader - Check if TransferList header is valid, return suitable opcodes validating the header TransferListFindEntry - Find a specific entry on the TransferList using the TagId TransferListDump - Dump the contents of the TransferList header and the entry headers Signed-off-by: Prachotan Reddy Bathi <Prachotan.Bathi@arm.com>
2025-07-15ArmPkg: ArmGicDxe: Add support for GICv5Ard Biesheuvel1-0/+13
Add initial driver support for GICv5. This initial driver supports Private Peripheral Interrupts (PPIs) and Shared Peripheral Interrupts (SPIs). Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com> [ardb: Merge v5 support into GicV3Dxe] Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-07-05ArmPkg,ArmPlatformPkg,ArmVirtPkg,UefiCpuPkg: Move ArmMmuLib.h to UefiCpuPkgAjan Zhong1-74/+0
Move the ArmMmuLib interface definition to UefiCpuPkg, with this change, MMU libraries for ARM, AARCH64, RiscV, LongArch64 architectures all reside in UefiCpuPkg. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Ajan Zhong <ajan.zhong@newfw.com>
2025-06-06ArmPkg/Include: fix usage of wrong macro in ArmGicv3Dxelevi.yun1-1/+1
To get a SPI_MAX_INTID, interrupt controller type Register should be masked with ARM_GIC_ICDICTR_GET_SPI_RANGE. However, since ARM_GIC_ICDICTR_SPI_RANGE_TO_MAX_INTID macro uses ARM_GIC_ICDICTR_GET_EXT_SPI_RANGE mask, it returns wrong SPI_MAX_INITID. This makes a failure of loading GenericWatchDog in FVP RevC model. Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com> Fixes: d6d2f68e3801 ("ArmPkg/Drivers/ArmGicDxe: ...")
2025-06-04ArmPkg/Drivers/ArmGicDxe: Add Extended SPI support for GICv3Nick Graves1-9/+59
This commit enables extended SPI support for GicV3. GicV3 must decide, based on the source intid, whether to access the SPI-range registers, PPI-range registers in the redistributor, or the extended SPI-range registers. The protocol interfaces must also support registering an interrupt handler with an extended SPI intid. To save ~24KB of memory, handler allocation and access is delegated to GicV2 and GicV3. GicV2 retains the existing handler mapping scheme using intids literally. GicV3 remaps extended SPI intids to be immediately after the highest SPI intids. Tested on qemu with the BSA test suite. Signed-off-by: Nick Graves <nicholasgraves@google.com>
2025-05-26ArmPkg: Fix typosMichael Kubacki1-1/+1
Corrects some typos. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-04-10ArmPkg: ArmFfaLib.h: Move to MdePkgKun Qin1-320/+0
As a set of definitions from an industry specification-defined interface, ArmFfaLib.h is more appropriately placed in MdePkg. This update relocates both the header definition of ArmFfaLib to MdePkg, thereby supporting the monitor call primitives for all other packages that depend on this interface. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-10ArmPkg: ArmSvcLib: Move ArmSvcLib to MdePkgKun Qin1-56/+0
As an implementation of an industry specification-defined interface, ArmSvcLib is more appropriately placed in MdePkg. This update relocates both the header definition and the implementation of ArmSvcLib to MdePkg, thereby supporting the supervisor call primitives for all other packages that depend on this interface. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-10ArmPkg: ArmSmcLib: Move ArmSmcLib to MdePkgKun Qin1-123/+0
As an implementation of an industry specification-defined interface, ArmSmcLib is more appropriately placed in MdePkg. This update relocates both the header definition and the implementation of ArmSmcLib to MdePkg, thereby supporting the monitor call primitives for all other packages that depend on this interface. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-10ArmPkg: FF-A headers: Move to MdePkgKun Qin3-473/+0
ArmFfaBootInfo.h, ArmFfaPartInfo.h and ArmFfaSvc.h comprise a set of definitions established by industry standard specifications: https://developer.arm.com/documentation/den0077/latest This update relocates the header definitions from ArmPkg to MdePkg to maintain consistency within the EDK2 layout. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-10ArmPkg: ArmStdSmc.h: Move to MdePkgKun Qin1-256/+0
ArmStdSmc.h comprises a set of definitions established by an industry standard specification: https://developer.arm.com/documentation/den0028/latest/ This update relocates the header definition from ArmPkg to MdePkg to maintain consistency within the EDK2 repo layout. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-02ArmPkg: ArmFfaLib: Update FF-A direct message to support 18 registersKun Qin1-1/+28
This change expands the support of FF-A direct message 2 call to use the full 18 registers. It also adds a check in the contructors to ensure the SMCCC meets the minimal requirement of v1.2 to support FF-A v1.2 usage. Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-02ArmPkg: ArmSvcLib: Support all 18 registersKun Qin1-0/+10
This extends ARM_SVC_ARGS to support all x0-x17 registers use case for FF-A. The ArmCallSvc function is also updated to support 18-register usage. Co-authored-by: Olivier Deprez <Olivier.Deprez@arm.com> Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-02ArmPkg: ArmSmcLib: Support all 18 registersKun Qin1-0/+10
This extends ARM_SMC_ARGS to support all x0-x17 registers use case for FF-A. The ArmCallSmc function is also updated to support 18-register usage. Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-03-06ArmPkg/ArmTransferListLib: improve coding style complianceLeif Lindholm1-30/+27
The existing code was full of abbreviated function/variable names. Let's nip that in the bud before we add more code to this library. Update the current only upstream user: ArmStandaloneMmCoreEntryPoint. Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-02-26ArmPkg: ArmFfaSvc: Adding missing FF-A definitionsKun Qin1-0/+37
This change added missing FF-A definitions for certain FF-A function IDs. The `ARM_FFA_NOTIFICATION_*` and `ARM_FFA_FEATURE_*` definitions are based on FF-A spec v1.3 ALP1. The `ARM_FFA_MEM_PERM_RESERVED_MASK` definition is based on FF-A memory protocol spec v1.3 ALP1. Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-01-31ArmPkg: Retire ArmDisassemblerLibArd Biesheuvel1-37/+0
No longer used anywhere so can be retired. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-17ArmPkg/ArmGicDxe: Use EOImode 0x0 on GICv3Ard Biesheuvel1-1/+2
When re-entering EDK2 from a high level OS such as Linux, the GICv3 may be configured to use split priority drop and deactivate (EOImode == 1), whereas EDK2's GICv3 driver assumes the default setting of EOImode == 0. So clear the EOImode bit explicitly when taking control of the GIC. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-17ArmPkg/ArmGic: Incorporate v3 code from ArmGicLibArd Biesheuvel1-46/+0
Move the remaining code in ArmGicLib into ArmGicDxe, its only user, and drop the dependency on ArmGicLib. Note that ArmGicDxe has an undeclared dependency on ArmLib, so declare that instead. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-17ArmPkg/ArmGic: Retire ArmGicArchLibArd Biesheuvel1-40/+0
ArmGicArchLib is no longer use so remove all remaining references and implementations. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-17ArmPkg/ArmGic: Move some GIC defines into ArmGicLib.hArd Biesheuvel1-0/+8
Before getting rid of ArmGicArchLib entirely, preserve some GIC architecture related preprocessor defines by moving them into ArmGicLib.h instead. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-17ArmPkg/ArmGic: Move GICv3 sysreg check into ArmGicDxeArd Biesheuvel1-2/+0
ArmGicArchLib implements a check on the accessibility of the GIC system register interface, which is a prerequisite for using the GIC in v3 mode. It might be possible to use GICv2 compatibility mode on poorly configured platforms where the GIC is v3 capable but not accessible, but in most cases, the GIC is driven in its native mode. This check is now only carried out in a single place, and there is not really any reason to keep this in a separate library. Even though ArmVirtPkg implements its own version, the basic check (and enablement of the sysreg interface) is still needed. So move this check into the DXE driver itself, and drop the dependency on ArmGicArchLib. This allows it to be retired in a subsequent patch. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-17ArmPkg/ArmGic: Move GICv2 specific EOI/ACK routines into v2 driverArd Biesheuvel1-32/+0
ArmGicDxe is the only remaining user of ArmGicLib, and so there is no need for the abstraction, which is drawn at an arbitrary boundary anyway. So remove the remaining V2 specific code into the DXE driver. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-17ArmPkg/ArmGic: Move remaining shared code into ArmGicDxeArd Biesheuvel1-18/+0
Move the remaining ArmGicLib code that is shared between the v2 and v3 GIC DXE drivers into ArmGicCommonDxe.c Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-17ArmPkg/ArmGic: Drop declarations for non-existent functionsArd Biesheuvel1-32/+0
Drop some ArmGicLib declarations that don't actually exist in the code. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-17ArmPkg/ArmGic: Disentangle ArmGicEnableDistributor () versionsArd Biesheuvel1-6/+0
Split ArmGicEnableDistributor () into GICv2 and v3 specific versions, and move them into their single respective callers, so that the original can be dropped from ArmGicLib altogether. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-17ArmPkg/ArmGic: Disentangle v2 and v3 versions of IRQ en/disable APIsArd Biesheuvel1-33/+0
ArmGicLib is agnostic about the difference between v2 and v3, but its APIs are only called from code that is either v2-specific or v3-specific. That makes the generic interface kind of pointless, and we can just merge this code into the callers. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-17ArmPkg/ArmGic: Remove ArmGicEndOfInterrupt () APIArd Biesheuvel1-7/+0
ArmGicEndOfInterrupt () is never used: the v2 and v3 versions of the driver call respective specific versions directly, and so this API can be removed. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-17ArmPkg/ArmGic: Remove ArmGicSendSgiTo () APIArd Biesheuvel1-9/+0
ArmGicSendSgiTo () is never used, and is fundamentally tied to multi-CPU operation which is no longer supported. So drop the implementation. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-17ArmPkg/ArmGic: drop ArmGicEnableInterruptInterface from ArmGicLibArd Biesheuvel1-12/+0
The ArmGicLib API exposes ArmGicEnableInterruptInterface () and ArmGicDisableInterruptInterface (), but only the former is actually used, and only from the GICv2 driver. So drop the API entirely, and invoke the v2 version of the underlying interface directly. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-17StandaloneMmPkg: move core entry point lib and cpu driver to ArmPkgLevi Yun2-0/+354
StandaloneMmCpu driver is only used for Arm architecture and StandaloneMmCoreEntryPointLib for Arm has specific implementation with StandaloneMmCpu driver. Move StandaloneMmCpu Driver and StandaloneMmCoreEntryPointLib for Arm to ArmPkg. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Levi Yun <yeoreum.yun@arm.com>
2025-01-17AmrPkg/MmCommunication: move Mmcommunicate.h to common includelevi.yun1-0/+31
MmCommunication.h is used in MmCommunicationDxe/Pei both. Move this header file to common include. Signed-off-by: Levi Yun <yeoreum.yun@arm.com>
2025-01-17ArmPkg: Add ArmFfaLib.hLevi Yun1-0/+293
Add ArmFfaLib.h which defines interfaces correspond to FF-A ABIs. Signed-off-by: Levi Yun <yeoreum.yun@arm.com>