summaryrefslogtreecommitdiff
path: root/DynamicTablesPkg/Library
AgeCommit message (Collapse)AuthorFilesLines
3 daysDynamicTablesPkg/AcpiFadtLib: Preserve platform flags on Arm and RISC-VHEADmasterDjordje Nedic2-2/+2
BuildFadtTable() adds platform-provided fixed-feature flags before calling FadtArchUpdate(). The Arm and RISC-V implementations assign Fadt->Flags, discarding the flags already added by the platform. Use bitwise OR assignment to add architecture defaults without overwriting the existing flags. Leave the generation order, validation masks, ACPI revision handling, and architecture defaults unchanged. Signed-off-by: Djordje Nedic <djordje.nedic@nextsilicon.com>
5 daysDynamicTablesPkg/AmlLib: Fix root node cleanup leakAmrathesh1-3/+0
AmlCreateRootNode() calls AmlDeleteRootNode() when SDT header allocation fails. However, AmlDeleteRootNode() rejects a NULL header and returns without freeing the root node, leaking the node allocation. Allow AmlDeleteRootNode() to handle a NULL SDT header and always free the root node. Signed-off-by: Amrathesh <amrathesh@arm.com>
5 daysDynamicTablesPkg/AmlLib: Fix data node cleanup leakAmrathesh1-4/+0
AmlCreateDataNode() calls AmlDeleteDataNode() when buffer allocation fails. However, AmlDeleteDataNode() rejects a NULL buffer and returns without freeing the data node, leaking the node allocation. Allow AmlDeleteDataNode() to handle a NULL buffer and always free the data node. Signed-off-by: Amrathesh <amrathesh@arm.com>
5 daysDynamicTablesPkg/AmlLib: Fix fixed argument bounds checkAmrathesh1-1/+1
AmlSetFixedArgument() accepts an index equal to the fixed argument count. The count is an exclusive upper bound, so this permits an out-of-bounds write to the FixedArgs array. Require the index to be strictly less than the fixed argument count. Signed-off-by: Amrathesh <amrathesh@arm.com>
5 daysDynamicTablesPkg/AmlLib: Fix serialization buffer size handlingAmrathesh2-9/+11
AmlSerializeTree uses a reversed buffer size comparison. As a result, it returns success without serializing when the buffer is larger than needed and attempts serialization when the buffer is too small. Return EFI_BUFFER_TOO_SMALL when Buffer is NULL or the supplied buffer is too small, and always report the required size. Update AmlSerializeDefinitionBlock to handle the expected size query status. Signed-off-by: Amrathesh <amrathesh@arm.com>
5 daysDynamicTablesPkg: Add SMBIOS IPMI Device generatorGirish Mahadevan2-0/+369
Signed-off-by: Girish Mahadevan <gmahadevan@nvidia.com>
5 daysDynamicTablesPkg: Add IPMI Device CM object and parserGirish Mahadevan1-0/+14
Signed-off-by: Girish Mahadevan <gmahadevan@nvidia.com>
10 daysDynamicTablesPkg: Add ACPI ERST table generatorAmrathesh3-0/+566
Add a common Error Record Serialization Table (ERST) generator based on the ACPI 6.6 definition. Introduce an architecture-common Configuration Manager object to provide serialization instruction entries. Validate actions, instructions, flags, register masks, action grouping, and GOTO targets before generating the table. Signed-off-by: Amrathesh <amrathesh@arm.com>
11 daysDynamicTablesPkg: Add ACPI BERT table generatorAmrathesh3-0/+316
Add a common Boot Error Record Table (BERT) generator based on the ACPI 6.6 definition. Introduce an architecture-common Configuration Manager object that provides the boot error region address and length. Signed-off-by: Amrathesh <amrathesh@arm.com>
11 daysDynamicTablesPkg: Add SMBIOS Onboard Devices generatorGirish Mahadevan2-0/+452
Signed-off-by: Girish Mahadevan <gmahadevan@nvidia.com>
11 daysDynamicTablesPkg: Add Onboard Device CM object and parserGirish Mahadevan1-0/+13
Signed-off-by: Girish Mahadevan <gmahadevan@nvidia.com>
12 daysDynamicTablesPkg: Library: fix wrong iteration ITS affinity in SRATsecurity-advisory/cve-2026-92258/advisoryYeoreum Yun1-1/+2
For GicV5 ITS, it should be iterated with GicItsV5Info not GicItsInfo in SratGenerator. Fix wrong iteration. Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
12 daysDynamicTablesPkg: Library: fix IWB node device index in IORT generatorYeoreum Yun3-8/+23
Up to 16 IWB devices can currently be created dynamically. However, the device name is derived from GicIwbId, which causes problems when GicIwbId is greater than 16. Use a separate index to generate the device name instead. Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
13 daysDynamicTablesPkg: fix missing field relevant GiCv5 CM object for parsersYeoreum Yun1-10/+16
Several fields are missing from the GICv5 Configuration Manager object parsers, including those used for SRAT. Add the missing fields. Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
13 daysDynamicTablesPkg/HwInfoParser: Fix FdtResolveInterrupt() on absent propertyPierre Gondois1-2/+1
FdtResolveInterrupt() might be called on a node with an absent "interrupts" property. In such case, the function should: - not assert - return EFI_NOT_FOUND This ASSERT is triggered when running ArmVirtKvmtool, when searching for a GSIV maintenance interrupt. Fixes: b377584b344a ("DynamicTablesPkg/HwInfoParser: Add FdtResolveInterrupt()") Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
13 daysDynamicTablesPkg: MadtGenerator: make GICD info as optionLevi Yun1-15/+32
GICD information is not a mandatory in the platform where use the GicV5 interrupt controller. Therefore, make GICD information as optional one. Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
13 daysDynamicTablesPkg: SsdtSerialPortFixupLib: Add GICv5 IRQ ranges to IRQ checkSarah Walker5-22/+164
To support SPCR with GicV5, check GiCv5 SPI IRQ ranges too. And cleanup for ifdef for ARM specific validation with the Arch specific function to validate serial port information. Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
13 daysDynamicTablesPkg,MdePkg: generate IORT table for GICv5Sarah Walker6-31/+845
Generate GICv5 related information in IORT table. Continuous-integration-options: PatchCheck.ignore-multi-package Co-Developed-by: Yeoreum Yun <yeoreum.yun@arm.com> Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
13 daysDynamicTablesPkg,MdePkg: validate number of ItsGroupCount in IORTYeoreum Yun1-1/+12
Since the IORT specification version E.g[0], Number of ITS node (a.k.a ITS Group node) must be "1". To ensure compliance with the specification, add a sanity check for the number of ITS Group nodes. Link: https://developer.arm.com/documentation/den0049/latest [0] Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
13 daysDynamicTablesPkg: generate SRAT table for GICv5Sarah Walker2-20/+159
Generate GICv5 related information in SRAT table. Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
13 daysDynamicTablesPkg: generate MADT table for GICv5Sarah Walker2-34/+430
Generate GICv5 related information in MADT table. Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
13 daysDynamicTablesPkg: Smbios System Boot Information (Type 32)Girish Mahadevan2-0/+319
Signed-off-by: Girish Mahadevan <gmahadevan@nvidia.com>
13 daysDynamicTablesPkg: Add System Boot CM object and parserGirish Mahadevan1-0/+8
Signed-off-by: Girish Mahadevan <gmahadevan@nvidia.com>
14 daysDynamicTablesPkg: Smbios Firmware Language Information (Type 13)Girish Mahadevan2-0/+473
Signed-off-by: Girish Mahadevan <gmahadevan@nvidia.com>
14 daysDynamicTablesPkg: Add BIOS Language CM object and parserGirish Mahadevan1-0/+17
Signed-off-by: Girish Mahadevan <gmahadevan@nvidia.com>
2026-09-11DynamicTablesPkg/HwInfoParser: Remove IRQ helper macrosPierre Gondois1-39/+0
The following IRQ helper macros are now unused: - GET_DT_REG_ADDRESS_OFFSET() - GET_DT_REG_SIZE_OFFSET() Remove them. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-09-11DynamicTablesPkg/HwInfoParser: Add FdtGetTranslatedReg()Pierre Gondois10-13/+292
The Devicetree Specification [1] defines the "ranges" property. """ The ranges property provides a means of defining a mapping or translation between the address space of the bus (the child address space) and the address space of the bus node’s parent (the parent address space). """ Add a FdtGetTranslatedReg() function, reading the "reg" property of a node and translating the base address through the "ranges" properties present in the node hierarchy. Make use of FdtGetTranslatedReg() wherever relevant. This allows to handle the presence of "ranges" property in a node hierarchy by default. [1] Spec. v0.4, s2.3.8 ranges Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-09-11DynamicTablesPkg/HwInfoParser: Add FdtGetReg() helperPierre Gondois10-232/+290
Add a FdtGetReg() helper to fetch the "reg" property of a node. Use the newly introduce helper wherever relevant. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-09-11DynamicTablesPkg/HwInfoParser: Add FdtResolveInterrupt()Pierre Gondois5-136/+430
The Devicetree Specification [1] defines the concept of interrupt mapping, interrupt domain, interrupt nexus and interrupt controller. An interrupt property might need to be translated through an interrupt nexus to obtain the interrupt type, id, flags. Add a FdtResolveInterrupt() function, resolving an interrupt property through interrupt nexuses until reaching the interrupt-controller node. Make use of FdtResolveInterrupt() wherever relevant. This allows to handle the presence of interrupt nexus by default. [1] Spec. v0.4, s2.4 Interrupts and Interrupt Mapping Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-09-11DynamicTablesPkg/HwInfoParser: Add Size param to interrupt gettersPierre Gondois8-24/+42
Add a Size parameter to: - FdtGetInterruptId() - FdtGetInterruptFlags() This allows to check the size of the interrupt data to parse inside the later functions. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-09-11DynamicTablesPkg/HwInfoParser: Relax GetNodeInterruptCells()Pierre Gondois7-66/+59
FdtGetInterruptCellsInfo() expects to receive an interrupt controller node. However, a common use-case is to get the "#interrupt-cells" of a non interrupt-controller node in order to decode an "interrupts" property. Add a "SearchInHierarchy" parameter to FdtGetInterruptCellsInfo() to conditionnaly relax the function and either get the "#interrupt-cells" property: - from the input node - from the hierachy of the input node. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-09-11DynamicTablesPkg/HwInfoParser: Add FdtGetInterruptMap()Pierre Gondois3-102/+304
A FDT interrupt nexus defines an "interrupt-map" property. The property is an array of 5 columns as: - child unit address - child interrupt specifier - interrupt-parent (phandle on 1 cell) - parent unit address - parent interrupt specifier It is difficult to iterate over the lines of the "interrupt-map" array. To determine the location of each property in the interrupt-map, the size of the child unit address and interrupt specifier must be fetched. The interrupt-parent cells then allows to fetch the size of the parent unit address and interrupt specifier. Create a FdtGetInterruptMap() function allowing to fetch all the properties of an interrupt-map entry. Use the function to simplify the PCI config space parser. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-09-11DynamicTablesPkg/HwInfoParser: Handle int-ctrl in FdtGetIntcNode()Pierre Gondois1-0/+21
An interrupt-controller node might have interrupts itself. In such case, the interrupt parent of the interrupt-controller must be found. If no interrupt parent is found, fallback to the input node (if the node is an interrupt-controller itself). Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-09-11DynamicTablesPkg/HwInfoParser: Split FdtGetIntcParentNode()Pierre Gondois7-31/+124
The Devicetree Specification [1] defines the concept of interrupt mapping, interrupt domain, interrupt nexus and interrupt controller. The "interrupt-controller" property defines a node as an interrupt controller. The "interrupt-map" property defines a node as an interrupt nexus. Both node types are defined as the root of an interrupt domain. A GIC (Generic Interrupt Controller) is an interrupt controller. The GIC version should be fetched to the matching device tree node. A node defining an interrupt domain might not necessarily be an interrupt controller and contain this information. Introduce 2 functions: - FdtGetIntControllerNode() - FdtGetIntDomainNode()` to distinguish the 2 concepts. As the presence of interrupt nexus/domains is currently not supported, replace FdtGetIntcParentNode() calls with FdtGetIntControllerNode(). The distinction will be useful in following patches. Also, update the detection of an interrupt domain to the presence of one of these properties: - interrupt-controller - interrupt-map instead of relying on the presence of the #interrupt-cells property, which is not a guarantee. [1] Spec. v0.4, s2.4 Interrupts and Interrupt Mapping Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-09-11DynamicTablesPkg/HwInfoParser: Rework FdtGetIntcNode()Pierre Gondois1-33/+125
Rework FdtGetIntcNode() to prepare for following patches which will allow to make the distinction between interrupt-controller nodes and interrupt nexus nodes. Add the following functions: - FdtGetIntcParentNode() - FdtIsIntcDomainNode() No functional change. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-09-11DynamicTablesPkg/HwInfoParser: Rename FdtGetIntcParentNodePierre Gondois7-12/+12
The interrupt parent of a node is: - the node pointed by the "interrupt-parent" property if the property is present - the direct parent otherwise. FdtGetIntcParentNode() doesn't aim to find the next parent node in the interrupt hierarchy. It aims to find the interrupt-controller node upon which the input node depends. This interrupt-controller node might be multiple nodes up in the device tree hierarchy. Thus, rename FdtGetIntcParentNode() to FdtGetIntcNode() to make the function name less ambiguous and prepare for the addition of a function which gets the next parent node in an interrupt hierarchy. No functional change. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-09-11DynamicTablesPkg/HwInfoParser: Add ReadFdtCells64() helperPierre Gondois4-24/+80
Add a ReadFdtCells64() helper function, allowing to read a value spanning on 1 or 2 UINT32 FDT cells. Use ReadFdtCells64() wherever relevant. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-09-10DynamicTablesPkg: Generalize the CMN SSDT generatorVarshit Pandya7-222/+325
Extend the CMN Configuration Manager object with an implementation type and optional root-node region length. Map the implementation type to the ACPI hardware IDs for CMN-600, CMN-650, CMN-700 and CMN-S3. Apply CMN-600-specific address restrictions only when the CMN-600 implementation type is selected. Rename the CMN-600 generator, identifiers and files to reflect support for multiple CMN implementations. Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-09-10DynamicTablesPkg: Add AmlLib logical equality generatorVarshit Pandya1-0/+184
Add AmlCodeGenEqual() to create an AML LEqual expression from two supplied operands. Use the existing AML_METHOD_PARAM representation for integer, method argument, and local variable operands. The generated equality expression can be used as a predicate by control-flow objects. Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-09-10DynamicTablesPkg: Add AmlLib If code generatorVarshit Pandya1-0/+120
Add AmlCodeGenIf() to create an AML If object from a supplied predicate node. The API takes ownership of the predicate and returns an If node to which executable statements can subsequently be appended. Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-09-10DynamicTablesPkg: Validate fixed AML argument is detachedVarshitPandya1-2/+2
AmlSetFixedArgument() attaches NewNode to an AML object but does not currently verify that the node is detached. Passing an already attached node could leave the AML tree in an inconsistent state. Require non-NULL argument nodes to be detached before attaching them. Continue accepting NULL because callers use it to clear a fixed argument. Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-09-10DynamicTablesPkg: Correct AML package length calculationVarshitPandya1-3/+33
Use AmlComputePkgLength() when calculating the package lengths for Device, ThermalZone, and Scope objects. The package-length encoding width is included in the encoded length and can itself increase when that width is added. AmlComputePkgLength() handles this boundary condition correctly. Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-09-10DynamicTablesPkg: Add AmlLib Store generatorVarshit Pandya1-0/+212
Add AmlCodeGenStoreToName() to create an AML Store operation with a typed source operand and a named target. Support integer, method argument and local variable sources using the AML_METHOD_PARAM representation. Append the generated Store node to an optional parent object. Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-09-10DynamicTablesPkg: Add AmlLib NamedField code generatorVarshit Pandya1-0/+182
Add AmlCodeGenFieldElemNamed() to create a named element within an AML Field list. The API validates the supplied NameSeg and field length, encodes the length using the AML FieldPkgLen format, and appends the resulting NamedField node to its parent Field object. Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-09-10DynamicTablesPkg: Add AmlLib ReservedField code generatorVarshit Pandya1-0/+77
Add AmlCodeGenFieldElemReserved() to create an AML ReservedField element and append it to a Field list. The API accepts the reserved range length in bits and validates that the parent supports a Field list. ReservedField elements describe unnamed gaps in Field declarations and can be used when translating ASL Offset() declarations. Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-09-10DynamicTablesPkg: Validate AML package length on node creationVarshitPandya2-1/+4
Validate that the package length passed to AmlCreateObjectNode() fits within the 28-bit limit defined by the AML package-length encoding. Perform the validation centrally so that it applies consistently to all callers. Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-09-10DynamicTablesPkg: Add AmlLib Field code generatorVarshit Pandya1-0/+204
Add AmlCodeGenField() to create an empty AML Field object associated with an OperationRegion. Expose access type, lock rule, and update rule through typed public enumerations and encode them in the Field flags byte. The generated Field node can be attached directly to a parent or returned so that field elements can subsequently be appended. For example, the API can generate: Field (REG0, DWordAcc, NoLock, Preserve) { } Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-09-10DynamicTablesPkg: Add AmlLib OperationRegion code generatorVarshit Pandya1-0/+233
Add AmlCodeGenOperationRegion() to create an AML OperationRegion object from a region name, address space, integer offset, and integer length. The API creates the OperationRegion object and populates its four fixed AML operands: - RegionName - RegionSpace - RegionOffset - RegionLength RegionOffset and RegionLength are encoded using the smallest suitable AML integer representation. The generated node can either be attached directly to a supplied parent or returned to the caller for later use. For example, the API can generate an object equivalent to: OperationRegion ( REG0, SystemMemory, RegionOffset, RegionLength ) This provides generators with a reusable way to describe register regions without relying on a precompiled ASL template. Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-09-10DynamicTablesPkg: Generalize AmlLib Notify node generationVarshit Pandya1-13/+1
Allow AmlCodeGenNotifyNode() to attach a Notify object to any suitable parent node. This enables Notify objects to be generated within nested AML scopes, for example: Method (_EVT, 1, Serialized) { If (LEqual (Arg0, EventId)) { Notify (\_SB.RAS0, Value) } } Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-09-10DynamicTablesPkg: Expose AmlLib Notify generatorVarshit Pandya1-1/+0
Make AmlCodeGenNotify() public and declare it in AmlLib.h. Add the new API to the CodeGen documentation group. Callers currently cannot append an individual Notify operation while incrementally constructing a method body. For example, this enables generators to construct _EVT methods containing conditional register writes and device notifications. Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>