summaryrefslogtreecommitdiffstats
path: root/DynamicTablesPkg/Include
Commit message (Collapse)AuthorAgeFilesLines
* DynamicTablesPkg: Adds integer to the AML package nodeAbdul Lateef Attar7 days1-1/+40
| | | | | | | | | | | Adds an AmlAddIntegerToNamedPackage() API to generate AML code, which adds an integer value to the package node. Cc: Pierre Gondois <pierre.gondois@arm.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg/SsdtSerialPortFixupLib: Add Interrupt node for SPIs onlyHimanshu Sharma2024-03-041-2/+5
| | | | | | | | | | | | | | | | | | Add interrupt node to the AML description of the serial-port only if the IRQ ID from the Configuration Manager is a valid SPI (shared processor interrupt) or an extended SPI. So, for DBG2 UART ports where interrupt is not mandatory, adding of an interrupt node in the AML description using Serial Port Fixup Library can be ignored if the UART is not defined with a valid SPI, like in N1SDP. This update generates the interrupt node for the valid SPI range using the AML Codegen API instead of updating it using the AML Fixup API. Cc: Sami Mujawar <Sami.Mujawar@arm.com> Cc: Pierre Gondois <pierre.gondois@arm.com> Signed-off-by: Himanshu Sharma <Himanshu.Sharma@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>
* DynamicTablesPkg: Add DynamicTablesScmiInfoLibPierre Gondois2024-01-291-0/+33
| | | | | | | | | | | | | The SCP holds some power information that could be advertised through the _CPC object. The communication with the SCP is done through SCMI protocols (c.f. ArmScmiDxe). Use the SCMI protocols to query information and feed it to the DynamicTablesPkg. Acked-by: Leif Lindholm <quic_llindhol@quicinc.com> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Add AmlCreatePsdNode() to generate _PSDPierre Gondois2024-01-291-1/+34
| | | | | | | | | | Add AmlCreatePsdNode() to the AmlLib to generate _PSD objects. _PSD objects allow to describe 'performance control, P-state or CPPC, logical processor dependency', Cf. ACPI 6.5, s8.4.5.5 _PSD (P-State Dependency). Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Add PsdToken field to CM_ARM_GICC_INFO objectPierre Gondois2024-01-291-0/+5
| | | | | | | | | | The _PSD object (cf. ACPI 6.5, s8.4.5.5 _PSD (P-State Dependency) allows to describe CPU's power state dependencies. Add a PsdToken field to the CM_ARM_GICC_INFO object so that interdependent CPUs can reference the same CM_ARM_PSD_INFO object. Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
* DynamicTablesPkg: Add CM_ARM_PSD_INFO objectPierre Gondois2024-01-292-0/+30
| | | | | | | | | Add an object describing _PSD information, cf. ACPI 6.5, s8.4.5.5 _PSD (P-State Dependency). Also add the corresponding CmObjParser. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Rename AmlCpcInfo.h to AcpiObjects.hPierre Gondois2024-01-293-2/+2
| | | | | | | | | | | | | | The DynamicTables framework uses the AmlLib to generate some Aml objects. It is done by using structured known by both frameworks, e.g. the AML_CPC_INFO/CM_ARM_CPC_INFO structures. To prepare adding similar structures (e.g. representing _PSD information), rename AmlCpcInfo.h to AcpiObjects.h. This new file will contain all the structures used by the AmlLib and the DynamicTables framework. Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
* DynamicTablesPkg: AML Code generation to invoke a methodAbdul Lateef Attar2023-12-221-0/+112
| | | | | | | | | | | | Adds API to generate AML code to invoke/call another method. Also provides ability to pass arguments of type integer, string, ArgObj or LocalObj. Cc: Pierre Gondois <pierre.gondois@arm.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Corrects AmlCodeGenRdWordBusNumber parametersAbdul Lateef Attar2023-12-221-5/+5
| | | | | | | | | | | Corrects the parameters of AmlCodeGenRdWordBusNumber() to UINT16 to generate word bus number. Cc: Pierre Gondois <pierre.gondois@arm.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: AML Code generation for word I/O rangesAbdul Lateef Attar2023-12-221-0/+65
| | | | | | | | | | | Add helper functions to generate AML resource data for word I/O. Cc: Pierre Gondois <pierre.gondois@arm.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Add an ET info object to Arm namespaceSami Mujawar2023-10-301-1/+24
| | | | | | | | | | | | | | | | | | | Add an Embedded Trace (ET) info object that can be used to provide information about Embedded Trace Extension (ETE) or Embedded Trace Module (ETM) available on a platform. Although ETE and ETM share the same HID, ETE has a system register interfaces, unlike ETM which requires memory mapped registers. Since this patch aims to support ETE it does not describe any memory mapped registers. However, required support for ETM can be added in the future. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>
* DynamicTablesPkg: Add TRBE interrupt to GICC objectSami Mujawar2023-10-301-0/+7
| | | | | | | | | | | | | | ACPI 6.5 introduces a new filed to the MADT GICC structure to specify the Trace Buffer Extension (TRBE) interrupt. The TRBE interrupt is a Processor Private interrupt (PPI) and is used to specify a platform-specific interrupt to signal TRBE events. Therefore, update the CM_ARM_GICC_INFO to reflect the addition of the TRBE interrupt field. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>
* DynamicTablesPkg/AmlLib: Enumerate memory attributesJeshua Smith2023-10-231-4/+45
| | | | | | | | | | | | AmlCodeGenRdQWordMemory's and AmlCodeGenRdDWordMemory's Cacheable and MemoryRangeType parameters treat specific values as having specific meanings as defined by the spec. This change adds enums to map those meanings to their corresponding values. Signed-off-by: Jeshua Smith <jeshuas@nvidia.com> Acked-by: Leif Lindholm <quic_llindhol@quicinc.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: AML Code generation for I/O rangesVidya Sagar2023-09-221-0/+67
| | | | | | | | | Add helper functions to generate AML Resource Data describing I/O ranges of four words long. API AmlCodeGenRdQWordIo () is exposed. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Add Aml NameUnicodeString APIJeff Brasen2023-09-221-0/+31
| | | | | | | | Add API to generate a Name that contains a Unicode string buffer. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Add support to add Strings to packageJeff Brasen2023-09-221-0/+17
| | | | | | | Add API to add a String to a package created with NamedPackage API. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Add support for simple method invocation.Jeff Brasen2023-09-221-0/+54
| | | | | | | | Add support to add Return objects via AML that pass a single integer argument to the named method. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Add ThermalZone CodeGen functionJeff Brasen2023-09-221-0/+28
| | | | | | | | Add API to generate a ThermalZone object to AmlLib. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Add SMBIOS String table helper librarySami Mujawar2023-03-101-0/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Section 6.1.3, SMBIOS specification version 3.6.0 describes the handling of test strings in SMBIOS tables. Text strings are added at the end of the formatted portion of the SMBIOS structure and are referenced by index in the SMBIOS structure. Therefore, introduce a SmbiosStringTableLib to simplify the publishing of the string set. SmbiosStringTableLib introduces a concept of string table which records the references to the SMBIOS strings as they are added and returns an string reference which is then assigned to the string field in the formatted portion of the SMBIOS structure. Once all strings are added, the library provides an interface to get the required size for the string set. This allows sufficient memory to be allocated for the SMBIOS table. The library also provides an interface to publish the string set in accordance with the SMBIOS specification. Example: EFI_STATUS BuildSmbiosType17Table () { STRING_TABLE StrTable; UINT8 DevLocatorRef; UINT8 BankLocatorRef; SMBIOS_TABLE_TYPE17 *SmbiosRecord; CHAR8 *StringSet; ... // Initialize string table for 7 strings StringTableInitialize (&StrTable, 7); StringTableAddString (&StrTable, "SIMM 3", &DevLocatorRef); StringTableAddString (&StrTable, "Bank 0", &BankLocatorRef); ... SmbiosRecord = AllocateZeroPool ( sizeof (SMBIOS_TABLE_TYPE17) + StringTableGetStringSetSize (&StrTable) ); ... SmbiosRecord->DeviceLocator = DevLocatorRef; SmbiosRecord->BankLocator = BankLocatorRef; ... // get the string set area StringSet = (CHAR8*)(SmbiosRecord + 1); // publish the string set StringTablePublishStringSet ( &StrTable, StringSet, StringTableGetStringSetSize (&StrTable) ); // free string table StringTableFree (&StrTable); return EFI_SUCCESS; } Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Cc: Alexei Fedorov <Alexei.Fedorov@arm.com> Cc: Pierre Gondois <pierre.gondois@arm.com> Cc: Girish Mahadevan <gmahadevan@nvidia.com> Cc: Jeff Brasen <jbrasen@nvidia.com> Cc: Ashish Singhal <ashishsingha@nvidia.com> Cc: Nick Ramirez <nramirez@nvidia.com> Cc: William Watson <wwatson@nvidia.com> Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
* DynamicTablesPkg: Allow for specified CPU namesJeff Brasen2022-12-191-0/+11
| | | | | | | | | | | | | | | Allow object to specify the name of processor and processor container nodes and the UID of processor containers. This allows these to be more accurately referenced from other tables. For example for the _PSL method or the UID in the APMT table. The UID and Name for processor container may be different as if the intention is to set names as the corresponding affinity level the UID may need to be different if there are multiple levels of containers. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Remove duplicated wordsPierre Gondois2022-12-131-1/+1
| | | | | | | | | | In an effort to clean the documentation of the above package, remove duplicated words. Cc: Sami Mujawar <Sami.Mujawar@arm.com> Cc: Alexei Fedorov <Alexei.Fedorov@arm.com> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Add PCCT GeneratorPierre Gondois2022-10-311-1/+2
| | | | | | | | | | | | | | The Platform Communication Channel Table (PCCT) generator collates the relevant information required for generating a PCCT table from configuration manager using the configuration manager protocol. The DynamicTablesManager then install the PCCT table. From ACPI 6.4, s14 PLATFORM COMMUNICATIONS CHANNEL (PCC): The platform communication channel (PCC) is a generic mechanism for OSPM to communicate with an entity in the platform. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Add PCCT related objectsPierre Gondois2022-10-311-43/+234
| | | | | | | | | | | | | | | | | | | | | Introduce the following CmObj in the ArmNameSpaceObjects: - CM_ARM_MAILBOX_REGISTER_INFO - CM_ARM_PCC_SUBSPACE_CHANNEL_TIMING_INFO - CM_ARM_PCC_SUBSPACE_GENERIC_INFO - CM_ARM_PCC_SUBPSACE_TYPE0_INFO - CM_ARM_PCC_SUBPSACE_TYPE1_INFO - CM_ARM_PCC_SUBPSACE_TYPE2_INFO - CM_ARM_PCC_SUBPSACE_TYPE3_INFO - CM_ARM_PCC_SUBPSACE_TYPE4_INFO - CM_ARM_PCC_SUBPSACE_TYPE5_INFO These objects allow to describe mailbox registers, pcc timings and PCCT subspaces. They prepare the enablement of a PCCT generator. Also add the CmObjParsers associated to each object. Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Fix Ssdt PCI generation commentsPierre Gondois2022-10-311-1/+1
| | | | | | | | | | | | The second model of the _PRT object is used. Indeed: - the interrupts described are not re-configurable - OSes are aware of the polarity of PCI legacy interrupts, so there is no need to accurately describe the polarity. Also, fix a comment for the CM_ARM_PCI_INTERRUPT_MAP_INFO obj. Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Remove deprecated APIsPierre Gondois2022-10-311-138/+0
| | | | | | | | | commit 691c5f776274 ("DynamicTablesPkg: Deprecate Crs specific methods in AmlLib") deprecates some APIs. Finally remove them. Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Fix GTBlock and GTBlockTimerFrame CmObjParsersPierre Gondois2022-10-311-16/+16
| | | | | | | | | | | | | The CmObjParsers of the following objects was inverted, probably due to a wrong ordering placement in the file defining the structures: -EArmObjGTBlockTimerFrameInfo -EArmObjPlatformGTBlockInfo Assign the correct parser for each object, and re-order the structures in the file defining them. Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: AML Code generation to add _CPC entriesJeff Brasen2022-09-231-0/+54
| | | | | | | | | | | | | _CPC entries can describe CPU performance information. The object is described in ACPI 6.4 s8.4.7.1. "_CPC (Continuous Performance Control)". Add AmlCreateCpcNode() helper function to add _CPC entries to an existing CPU object. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Add CM_ARM_CPC_INFO objectJeff Brasen2022-09-232-17/+166
| | | | | | | | | | Introduce the CM_ARM_CPC_INFO CmObj in the ArmNameSpaceObjects. This allows to describe CPC information, as described in ACPI 6.4, s8.4.7.1 "_CPC (Continuous Performance Control)". Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: AcpiSsdtPcieLibArm : Add UID to slot creationJeff Brasen2022-09-011-3/+5
| | | | | | | | | | | | | | | | | | Expose the UID value to GeneratePciSlots(). This is needed for some cases for example: https://docs.microsoft.com/en-us/windows-hardware/drivers/pci/dsd-for-pcie-root-ports#identifying-externally-exposed-pcie-root-ports Name (_DSD, Package () { ToUUID("EFCC06CC-73AC-4BC3-BFF0-76143807C389"), Package () { Package (2) {"ExternalFacingPort", 1}, Package (2) {"UID", 0}, } }) Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Add support to build _DSDJeff Brasen2022-09-011-0/+56
| | | | | | | | | | | | Add APIs needed to build _DSD with different UUIDs. This is per ACPI specification 6.4 s6.2.5. Adds support for building data packages with format Package {"Name", Integer} Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Update ArmNameSpaceObjects for IORT Rev E.dSami Mujawar2022-07-291-1/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bugzilla: 3458 - Add support IORT Rev E.d specification updates (https://bugzilla.tianocore.org/show_bug.cgi?id=3458) The IO Remapping Table, Platform Design Document, Revision E.d, Feb 2022 (https://developer.arm.com/documentation/den0049/) introduces the following updates, collectively including the updates and errata fixes to Rev E, Rev E.a, Rev E.b, Rev E.c: - increments the IORT table revision to 5. - updates the node definition to add an 'Identifier' field. - adds definition of node type 6 - Reserved Memory Range node. - adds definition for Memory Range Descriptors. - adds flag to indicate PRI support for root complexes. - adds flag to indicate if the root complex supports forwarding of PASID information on translated transactions to the SMMU. - adds flag to indicate if the root complex supports PASID. - adds flags to define access privilege and attributes for the memory ranges. Therefore, update the Arm namespace objects to: - add Identifier field to IORT nodes. - introduce enums to represent RMR nodes and Memory Range descriptors. - add definition of node type 6 - Reserved Memory Range node. - add definition for Memory Range Descriptors. - add PASID capabilities and flags field to Root Complex node. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>
* DynamicTablesPkg: AcpiSsdtPcieLibArm: Create support libraryJeff Brasen2022-07-191-0/+73
| | | | | | | | | | Add support library to allow for customization of _OSC and slot info. The functions in the library are unchanged, with the exception of adding PciInfo pointer to the APIs. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Add support to specify FADT minor revisionSami Mujawar2022-07-151-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | The CM_STD_OBJ_ACPI_TABLE_INFO.AcpiTableRevision can be used to specify the major revision number of the ACPI table that the generator must use. Although most ACPI tables only have a major revision number, the FADT table additionally has a minor revision number. The FADT generator currently defaults to setting the latest supported ACPI revision for the FADT table i.e. ACPI 6.4. This means that the minor revision for the FADT table is always set to 4 and there is no provision for a user to specify the minor revision to be selected. Therefore, update CM_STD_OBJ_ACPI_TABLE_INFO to introduce a new field MinorRevision which can be used to specify the minor revision for an ACPI table. Also update the FADT generator to validate the supported FADT revisions ans use the specified minor revision for the FADT table if supported. If an unsupported minor revision is specified the FADT generator defaults to the latest supported minor revision. Since the CM_STD_OBJ_ACPI_TABLE_INFO.MinorRevision field is added to the end of the structure, it should not break existing platform code. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: <pierre.gondois@arm.com> Tested-by: Jagadeesh Ujja <Jagadeesh.Ujja@arm.com>
* DynamicTablesPkg: Add AmlCodeGenMethodRetInteger functionRebecca Cran2022-02-021-0/+47
| | | | | | | | | Add AmlCodeGenMethodRetInteger function to generate AML code for a Method returning an Integer. Signed-off-by: Rebecca Cran <quic_rcran@quicinc.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Add Memory32Fixed functionRebecca Cran2022-02-021-0/+33
| | | | | | | | | Add a Memory32Fixed function to generate code for the corresponding Memory32Fixed macro in AML. Signed-off-by: Rebecca Cran <quic_rcran@quicinc.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Print specifier macro for CM_OBJECT_IDPierre Gondois2022-02-011-1/+6
| | | | | | | | | Add a macro that specifies the format for printing CM_OBJECT_ID. This allows to print the CM_OBJECT_ID is a consistent way in the output logs. Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
* DynamicTablesPkg: Definition for DynamicPlatRepoLib interfacePierre Gondois2021-12-141-0/+114
| | | | | | | | | | | | | | | | | | | The DynamicPlatRepoLib library allows to handle dynamically created CmObj. The dynamic platform repository can be in the following states: 1 - Non-initialised 2 - Transient: Possibility to add CmObj to the platform, but not to query them. 3 - Finalised: Possibility to query CmObj, but not to add new. A token is allocated to each CmObj added to the dynamic platform repository (except for reference tokens CmObj). This allows to retrieve dynamic CmObjs among all CmObj (static CmObj for instance). This patch defines the library interface of the DynamicPlatRepo. Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Definition for HwInfoParser interfacePierre Gondois2021-12-141-0/+99
| | | | | | | | | | | | | | | | | | Hardware information parser is an optional module defined by the Dynamic Tables Framework. It can either parse an XML, a Device Tree or a Json file containing the platform hardware information to populate the platform information repository. The Configuration Manager can then utilise this information to generate ACPI tables for the platform. Therefore, define an interface for the HwInfoParser library class. Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Co-authored-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Joey Gouly <joey.gouly@arm.com>
* DynamicTablesPkg: SSDT Pci express generatorPierre Gondois2021-12-131-0/+5
| | | | | | | | | | | | | | | | This generator allows to generate a SSDT table describing a Pci express Bus. It uses the following CmObj: - EArmObjCmRef - EArmObjPciConfigSpaceInfo - EArmObjPciAddressMapInfo - EArmObjPciInterruptMapInfo REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3682 To: Sami Mujawar <sami.mujawar@arm.com> To: Alexei Fedorov <Alexei.Fedorov@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Add Pci related objectsPierre Gondois2021-12-131-4/+82
| | | | | | | | | | | | | | Introduce the following CmObj in the ArmNameSpaceObjects: - CM_ARM_PCI_ADDRESS_MAP_INFO - CM_ARM_PCI_INTERRUPT_MAP_INFO These objects allow to describe address range mapping of Pci busses and interrupt mapping of Pci devices. To: Sami Mujawar <sami.mujawar@arm.com> To: Alexei Fedorov <Alexei.Fedorov@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Add AmlAttachNode()Pierre Gondois2021-12-131-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | This function allows to add a node as the last node of a parent node in an AML tree. For instance, ASL code corresponding to NewNode: Name (_UID, 0) ASL code corresponding to ParentNode: Device (PCI0) { Name(_HID, EISAID("PNP0A08")) } "AmlAttachNode (ParentNode, NewNode)" will result in: ASL code: Device (PCI0) { Name(_HID, EISAID("PNP0A08")) Name (_UID, 0) } To: Sami Mujawar <sami.mujawar@arm.com> To: Alexei Fedorov <Alexei.Fedorov@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: AML Code generation to add _PRT entriesPierre Gondois2021-12-131-0/+52
| | | | | | | | | | | | | _PRT entries can describe interrupt mapping for Pci devices. The object is described in ACPI 6.4 s6.2.13 "_PRT (PCI Routing Table)". Add AmlCodeGenPrtEntry() helper function to add _PRT entries to an existing _PRT object. To: Sami Mujawar <sami.mujawar@arm.com> To: Alexei Fedorov <Alexei.Fedorov@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: AML Code generation to create a named ResourceTemplate()Pierre Gondois2021-12-131-0/+28
| | | | | | | | | | | | | | Add AmlCodeGenNameResourceTemplate() to generate code for a ResourceTemplate(). AmlCodeGenNameResourceTemplate ("REST", ParentNode, NewObjectNode) is equivalent of the following ASL code: Name(REST, ResourceTemplate () {}) To: Sami Mujawar <sami.mujawar@arm.com> To: Alexei Fedorov <Alexei.Fedorov@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: AML Code generation to create a named Package()Pierre Gondois2021-12-131-0/+28
| | | | | | | | | | | | | Add AmlCodeGenNamePackage() to generate code for a Package(). AmlCodeGenNamePackage ("PACK", ParentNode, NewObjectNode) is equivalent of the following ASL code: Name(PACK, Package () {}) To: Sami Mujawar <sami.mujawar@arm.com> To: Alexei Fedorov <Alexei.Fedorov@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: AML Code generation for memory rangesPierre Gondois2021-12-131-0/+272
| | | | | | | | | | | | | | | | Add helper functions to generate AML Resource Data describing memory ranges. Memory ranges can be one, double or four words long. They can be of 'normal', IO or bus number memory type. The following APIs are exposed: - AmlCodeGenRdDWordIo () - AmlCodeGenRdDWordMemory () - AmlCodeGenRdWordBusNumber () - AmlCodeGenRdQWordMemory () To: Sami Mujawar <sami.mujawar@arm.com> To: Alexei Fedorov <Alexei.Fedorov@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Add CacheId to PPTT generatorChris Jones2021-12-101-1/+3
| | | | | | | | | | | | Bugzilla: 3697 (https://bugzilla.tianocore.org/show_bug.cgi?id=3697) Update the PPTT generator with the CacheId field as defined in table 5.140 of the ACPI 6.4 specification. Also add validations to ensure that the cache id generated is unique. Signed-off-by: Chris Jones <christopher.jones@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Remove PPTT ID structure from ACPI 6.4 generatorChris Jones2021-12-101-22/+1
| | | | | | | | | | | | | | Bugzilla: 3697 (https://bugzilla.tianocore.org/show_bug.cgi?id=3697) ACPI 6.3A deprecated PPTT ID (type 2) structure which was subsequently removed in ACPI 6.4. Therefore remove support for generating PPTT ID structures. Mantis ID for removing PPTT type 2 structure: 2072 (https://mantis.uefi.org/mantis/view.php?id=2072) Signed-off-by: Chris Jones <christopher.jones@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Apply uncrustify changesMichael Kubacki2021-12-0713-431/+429
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the DynamicTablesPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Change OPTIONAL keyword usage styleMichael D Kinney2021-12-071-13/+13
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3760 Update all use of ', OPTIONAL' to ' OPTIONAL,' for function params. Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: SSDT CPU topology and LPI state generatorPierre Gondois2021-10-081-1/+6
| | | | | | | | | | | | | | | In the GIC interrupt model, logical processors are required to have a Processor Device object in the DSDT and must convey each processor's GIC information to the OS using the GICC structure. Additionally, _LPI objects may be needed as they provide a method to describe Low Power Idle states that defines the local power states for each node in a hierarchical processor topology. Therefore, add support to generate the CPU topology and the LPI state information in an SSDT table. Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>