summaryrefslogtreecommitdiffstats
path: root/DynamicTablesPkg/Library/Acpi
Commit message (Collapse)AuthorAgeFilesLines
* DynamicTablesPkg: SSDT Pci express generatorPierre Gondois2021-12-134-0/+1710
| | | | | | | | | | | | | | | | 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 CacheId to PPTT generatorChris Jones2021-12-101-11/+94
| | | | | | | | | | | | 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: Update PPTT generator to ACPI 6.4Chris Jones2021-12-101-22/+22
| | | | | | | | | Bugzilla: 3697 (https://bugzilla.tianocore.org/show_bug.cgi?id=3697) Update the PPTT generator to use Acpi64.h. 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-102-156/+2
| | | | | | | | | | | | | | 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-0717-1289/+1382
| | | | | | | | | | | | 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 complex DEBUG_CODE() to DEBUG_CODE_BEGIN/END()Michael D Kinney2021-12-071-2/+2
| | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3767 Update use of DEBUG_CODE(Expression) if Expression is a complex code block with if/while/for/case statements that use {}. 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-083-0/+1395
| | | | | | | | | | | | | | | 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>
* DynamicTablesPkg: Remove unnecessary includesPierre Gondois2021-10-082-5/+0
| | | | | | | Some includes are not necessary. Remove them. Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
* DynamicTablesPkg: Rename SBSA generic watchdogChris Jones2021-10-051-30/+30
| | | | | | | | | | | | | Buzilla: 3565 (https://bugzilla.tianocore.org/show_bug.cgi?id=3565) As part of the updates to ACPI 6.4 the "SBSA Generic Watchdog" was renamed to the "Arm Generic Watchdog". This patch implements that change by updating the GTDT generator to use Acpi64.h and renames any occurence of "SBSA Generic Watchdog" to "Arm Generic Watchdog". Signed-off-by: Chris Jones <christopher.jones@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Update FADT generator to ACPI 6.4Chris Jones2021-10-051-52/+52
| | | | | | | | | | | | Bugzilla: 3568 (https://bugzilla.tianocore.org/show_bug.cgi?id=3568) Update the FADT generator to use Acpi64.h. As the FADT revision tracks the ACPI revision this updates the minor revision value generated. Mantis ID for change: https://mantis.uefi.org/mantis/view.php?id=2105 Signed-off-by: Chris Jones <christopher.jones@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Rework AmlResourceDataCodegen.c/hPierre Gondois2021-10-011-3/+5
| | | | | | | | | | | | | | | | | | | | Rework all the functions to to have a generic prototype: - First take take the resource data specific arguments. E.g.: for a Register(): the AddressSpace, BitWidth, ... - The penultimate parameter is a NameOpNode. The resource data created is appended to the ResourceTemplate() contained in the NameOpNode. - The last parameter is a pointer holding the created resource data. A least one of the two last parameter must be provided. One of them can be omitted. This generic interface allows to either: - Add the resource data to a NameOpNode. This is a common case for the Ssdt tables generator. - Get the created resource data and let the caller place it in an AML tree. Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
* DynamicTablesPkg: Deprecate Crs specific methods in AmlLibPierre Gondois2021-10-011-3/+3
| | | | | | | | | | | | | | | | | | Some functions in the AmlLib have 'Crs' in their name and can only be applied to '_CRS' AML objects. To re-use them on AML objects that have different names: - Rename them and remove the '_CRS' name check. - Create aliases having of the 'Crs' function prototypes. These aliases are available when DISABLE_NEW_DEPRECATED_INTERFACES is not defined. They will be deprecated in a near future. The deprecated functions are: - AmlNameOpCrsGetFirstRdNode() - AmlNameOpCrsGetNextRdNode() - AmlCodeGenCrsAddRdInterrupt() Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
* DynamicTablesPkg: Extract AcpiHelperLib from TableHelperLibPierre Gondois2021-10-014-5/+7
| | | | | | | | | | | | | The TableHelperLib contains helper functions. Some rely on DynamicTablesPkg definitions (they use Configuration Manager objects). Some others are more generic. To allow using these generic functions without including DynamicTablesPkg definitions, move them to a new AcpiHelperLib library. Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
* DynamicTablesPkg: Use AML_NAME_SEG_SIZE definePierre Gondois2021-06-022-4/+4
| | | | | | | | | Use the newly introduced defined value in: MdePkg/Include/IndustryStandard/AcpiAml.h Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Set the Access size for the DBG2 tableJoey Gouly2021-04-191-1/+23
| | | | | | | | | | | | | | | | The DBG2 table generator set the access size for the UART to DWORD (4 bytes) by default. However, according to Section B Generic UART, Arm Base System Architecture 1.0, Platform Design Document, a Generic UART can have BYTE, WORD or DWORD access sizes. To address this an AccessSize field has been introduced in CM_ARM_SERIAL_PORT_INFO object. This patch updates the DBG2 generator to setup the AccessSize field in the Generic Address Structure (GAS) for the UART in the DBG2 table with information provided by the platform. Signed-off-by: Joey Gouly <joey.gouly@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Set the Access size for the SPCR tableJoey Gouly2021-04-191-1/+21
| | | | | | | | | | | | | | | | The SPCR table generator set the access size for the UART to DWORD (4 bytes) by default. However, according to Section B Generic UART, Arm Base System Architecture 1.0, Platform Design Document, a Generic UART can have BYTE, WORD or DWORD access sizes. To address this an AccessSize field has been introduced in CM_ARM_SERIAL_PORT_INFO object. This patch updates the SPCR generator to setup the AccessSize field in the Generic Address Structure (GAS) for the UART in the SPCR table with information provided by the platform. Signed-off-by: Joey Gouly <joey.gouly@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Add SSDT CMN-600 Table generatorPierre Gondois2020-11-034-0/+874
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Generic ACPI for Arm Components 1.0 Platform Design Document, s2.6.4 "ASL code examples" provides information to describe an Arm CoreLink CMN-600 Coherent Mesh Network using an ASL definition block table. The SSDT CMN-600 Table Generator uses the Configuration Manager protocol to obtain the following information about the CMN-600 device on the platform: - the PERIPHBASE address location and address range; - the ROOTNODEBASE address location; - the number of Debug and Trace Controller (DTC) and their respective interrupt number; The CMN-600 mesh is described using the CM_ARM_CMN_600_INFO and CM_ARM_EXTENDED_INTERRUPT structures in the Configuration Manager. The SSDT CMN-600 Table generator: - gets the CMN-600 hardware information from the configuration manager. - uses the AmlLib interfaces to parse the AML template BLOB and construct an AML tree. - uses the AmlLib to update: - the "_UID" value; - the address location and range of the PERIPHBASE; - the address location of the ROOTNODEBASE; - the number of Debug and Trace Controller (DTC) and their respective interrupt number; - serializes the AML tree to an output buffer. This output buffer contains the fixed-up AML code, which is then installed as an ACPI SSDT table. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Co-authored-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
* DynamicTablesPkg: AcpiSratLibArm fix ECC errorSami Mujawar2020-10-211-2/+2
| | | | | | | | | | Fix the following ECC reported error in AcpiSratLibArm. - [9002] The function headers should follow Doxygen special documentation blocks in section 2.3.5 Comment does NOT have tail **/ Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
* DynamicTablesPkg: SsdtSerialPortLibArm fix ECC errorSami Mujawar2020-10-211-1/+5
| | | | | | | | | Fix the following ECC reported error in SsdtSerialPortLibArm. - [5007] There should be no initialization of a variable as part of its declaration Variable Name. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
* DynamicTablesPkg: Fix order of assert checksSami Mujawar2020-10-211-2/+2
| | | | | | | | Reordered the asserts to first check if the pointer is valid before de-referencing the pointer. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
* DynamicTablesPkg: Add SSDT Serial port for DBG2Pierre Gondois2020-08-132-70/+165
| | | | | | | | | | | | | | | The SSDT Serial port fixup library provides interfaces to generate a SSDT Serial port table based on the serial port information. Update the DBG2 Generator to use the SSDT serial port fixup library to build a serial port definition block for the DBG2 serial port and install the SSDT table. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
* DynamicTablesPkg: Add SSDT Serial port for SPCRPierre Gondois2020-08-132-62/+164
| | | | | | | | | | | | | | | | | | | | According to Arm Server Base Boot Requirements, Platform Design Document version 1.2 revision D, September 2, 2019, section '4.2.1.8 SPCR'; the SPCR console device must be included in the DSDT. The SSDT Serial port fixup library provides interfaces to generate a SSDT Serial port table based on the serial port information. Update the SPCR Generator to use the SSDT serial port fixup library to build a serial port definition block corresponding to the SPCR serial port and install the SSDT table. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
* DynamicTablesPkg: SSDT Serial Port generatorPierre Gondois2020-08-132-0/+400
| | | | | | | | | | | | | | | | | | | | | | Most platforms have several serial ports. These serial ports are described to an operating system using definition block tables. The SSDT Serial Port Table Generator uses the Configuration Manager protocol to obtain information for the Serial Ports on the platform. The serial ports are described using the CM_ARM_SERIAL_PORT_INFO structure. The EArmObjSerialPortInfo ID is used to represent a standard serial port. The SSDT Serial port fixup library provides interfaces to generate a SSDT Serial port table based on the serial port information. The SSDT Serial Port Table Generator uses the SSDT serial port fixup library to build serial port definition blocks and installs the SSDT tables. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
* DynamicTablesPkg: Fix issues reported by EDKII CISami Mujawar2020-08-075-17/+17
| | | | | | | | | | | | | | | | | The TianoCore EDKII project has introduced a Core CI infrastructure using TianoCore EDKII Tools PIP modules: * https://pypi.org/project/edk2-pytool-library/ * https://pypi.org/project/edk2-pytool-extensions/ More information on configuring the environment and running the builds can be found in edk2\.pytool\Readme.md This patch fixes the issues reported by the CI system mainly around fixing typo errors and package dec and dsc files. A subsequent patch enables the CI builds for the DynamicTablesPkg. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
* DynamicTablesPkg: SRAT: Fix uninitialized memory usageSami Mujawar2020-03-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | On enabling the /analyse option the VS2017 compiler reports: warning C6001: Using uninitialized memory. This warning is reported for the Status variable in AddGenericInitiatorAffinity() as it is not initialised to a default value. This condition is only valid if GenInitAffCount is equal to 0. Since GenInitAffCount is already checked in BuildSratTable() this condition can never happen. The value of the Status variable is returned in failure cases from appropriate locations in AddGenericInitiatorAffinity(). The only case where Status value is being used un-initialised is the return statement at the end of AddGenericInitiatorAffinity(). Therefore, to fix this issue EFI_SUCCESS can be safely returned instead of returning the Status variable at the end of the function. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
* DynamicTablesPkg: SRAT: Fix entry pointsSami Mujawar2020-03-311-4/+4
| | | | | | | | | | | | | | VS2017 reports 'warning C4028: formal parameter 2 different from declaration' for the library constructor and destructor interfaces for the SRAT Generator modules. Remove the CONST qualifier for the ImageHandle and the SystemTable pointer in the library constructor and destructor to make it compatible with the formal declaration. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* DynamicTablesPkg: PPTT: Fix uninitialized memory usageSami Mujawar2020-03-291-30/+29
| | | | | | | | | | | | | On enabling the /analyse option the VS2017 compiler reports: warning C6001: Using uninitialized memory. This warning is reported as some variables that were being logged were uninitialised. To fix this, moved the logging code after the variables being logged are initialised. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
* DynamicTablesPkg: IORT: Fix uninitialized memory usageSami Mujawar2020-03-291-48/+48
| | | | | | | | | | | | | On enabling the /analyse option the VS2017 compiler reports: warning C6001: Using uninitialized memory. This warning is reported as some variables that were being logged were uninitialised. To fix this, moved the logging code after the variables being logged are initialised. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
* DynamicTablesPkg: Fix IORT node length assignmentSami Mujawar2020-03-291-99/+253
| | | | | | | | | | | | | | | | | The VS2017 compiler reports 'warning C4267: 'return': conversion from 'size_t' to 'UINT32', possible loss of data' for a number of functions that compute the IORT node length. Similarly, it reports warnings for IORT node length field assignments as the length field is 16-bit wide. This patch adds type casts at appropriate places and also implements validations to ensure that the max width of the respective fields is not exceeded. This patch also fixes a typo in one of the local variable names. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
* DynamicTablesPkg: Remove redundant frame count checkSami Mujawar2020-03-291-10/+0
| | | | | | | | Removing GT Block frame count check from AddGTBlockTimerFrames() as this is already validated in BuildGtdtTable(). Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
* DynamicTablesPkg: Serial debug port initialisationSami Mujawar2020-03-291-10/+17
| | | | | | | | | | | | | The ARM DCC serial port subtype is an option that is supported by the DBG2 generator. However, the serial port initialisation should only be done for PL011/SBSA compatible UARTs. Add check to conditionally initialise the serial port. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
* DynamicTablesPkg: Fix unaligned pointers usageSami Mujawar2020-03-292-13/+24
| | | | | | | | | | | | | The VS2017 compiler reports 'warning C4366: The result of the unary '&' operator may be unaligned' if an address of an unaligned structure member is passed as an argument to a function. Fix this warning by using local variables in place of unaligned structure members. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
* DynamicTablesPkg: Fix GT Block length assignmentSami Mujawar2020-03-291-4/+21
| | | | | | | | | | | | | | | | | | The VS2017 compiler reports 'warning C4267: '=': conversion from 'size_t' to 'UINT16', possible loss of data'. The sizeof() operator is used to calculate the size of the GT Block structure. The length field in the GT Block structure is 16-bit wide. Since the return type of sizeof() operator is size_t the VS2017 compiler reports the above warning. To fix the warning, an explicit type cast is added. An additional check is also performed to ensure that the calculated GT Block length does not exceed MAX_UINT16. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
* DynamicTablesPkg: Fix Proc node length assignmentSami Mujawar2020-03-291-3/+4
| | | | | | | | | | | | | | | | | | The length field for the Processor Hierarchy node structure is 8-bit wide while the number of private resource field is 32-bit wide. Therefore, the GetProcHierarchyNodeSize() returns the size as a 32-bit value. The VS2017 compiler reports 'warning C4244: '=': conversion from 'UINT32' to 'UINT8', possible loss of data' while assigning the length field of the Processor Hierarchy node structure. To fix this, a type cast is added. In addition, there is a check to ensure that the Processor Hierarchy node size does not exceed MAX_UINT8. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
* DynamicTablesPkg: Fix serial port subtype warningSami Mujawar2020-03-291-1/+14
| | | | | | | | | | | | | | | | | | | | | | | The VS2017 compiler reports 'warning C4244: '=': conversion from 'UINT16' to 'UINT8', possible loss of data' for the SPCR InterfaceType field assignment. The SPCR InterfaceType field uses the same encoding as that of the DBG2 table Port Subtype field. However SPCR.InterfaceType is 8-bit while the Port Subtype field in DBG2 table is 16-bit. Since the Configuration Manager represents the Serial port information using the struct CM_ARM_SERIAL_PORT_INFO, the PortSubtype member in this struct is 16-bit. To fix the warning an explicit type case is added. A validation is also added to ensure that the Serial Port Subtype value provided by the Configuration Manager is within the 8-bit range (less than 256). Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
* DynamicTablesPkg: Fix missing local header warningSami Mujawar2020-03-292-1/+3
| | | | | | | | | | | | The edk2 BaseTools report a warning if a local header file is not listed under the [Sources] section in the INF file. Add header files to the [Sources] section in the respective INF files to fix the warnings. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
* DynamicTablesPkg: Fix entry point param definitionSami Mujawar2020-03-299-36/+36
| | | | | | | | | | | | | | VS2017 reports 'warning C4028: formal parameter 2 different from declaration' for the library constructor and destructor interfaces for the Generator modules. VS2017 compiler also reports similar warnings for the DXE entry points. Remove the CONST qualifier for the SystemTable pointer (the second parameter to the constructor/destructor/DXE Entry point) to make it compatible with the formal declaration. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
* DynamicTablesPkg: Update FADT generator to ACPI 6.3Sami Mujawar2020-03-261-51/+51
| | | | | | | Update FADT table generator to support ACPI revision 6.3 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
* DynamicTablesPkg: Arm SRAT Table GeneratorSami Mujawar2019-10-212-0/+864
| | | | | | | | | | | | | | | | | | | | | | | | | | The SRAT generator uses the configuration manager protocol to obtain the affinity information for the GICC, GIC ITS, Memory, Generic Initiator, etc. and generates the SRAT table. The table generator supports ACPI 6.3, SRAT table revision 3. The ACPI and PCI device handles of the Generic Initiator Affinity structures are represented using tokens. The generator invokes the configuration manager protocol interfaces and requests for objects referenced by tokens to get the device handle information. The Configuration Manager object definition for the GICC has been updated to include the Proximity Domain, Clock Domain and associated flag information. Similarly the Configuration Manager object for the GIC ITS has been updated to include the Proximity Domain information. These changes should not impact any existing implementations as the new fields have been added towards the end of the Configuration Manager Objects. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
* DynamicTablesPkg: GTDT updates for ACPI 6.3Pierre Gondois2019-06-111-30/+38
| | | | | | | | | | The ACPI 6.3 specification adds support for describing ARMv8.1 EL2 virtual timers. Update GTDT Generator to extend this support. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Add dynamic PPTT table generation supportKrzysztof Koch2019-06-113-0/+1747
| | | | | | | | | | | | | | | | | The PPTT generator uses the configuration manager protocol to obtain information about platform's processor topology and caches. This data is then used to generate the PPTT table. The table generator supports ACPI 6.3, PPTT table revision 2. The dynamic PPTT generator also carries out extensive input validation which includes cycle detection and MADT-PPTT cross-validation. A number of architectural compliance checks are also performed. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Add ACPI 6.3 SPE support to MADT generatorKrzysztof Koch2019-06-101-46/+59
| | | | | | | | | | | | | The Dynamic Tables Framework now supports generating Multiple APIC Description Table (MADT) revision 5 for ARM platforms while maintaining backward-compatibility with ACPI 6.2. The relevant change is the enablement of the Statistical Profiling Extension (SPE). Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Test for duplicate GT Block frame numbersKrzysztof Koch2019-06-101-2/+64
| | | | | | | | | Check for duplicate frame numbers when populating the GT Block Timer Frames inside the GTDT table generator. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Test for duplicate UIDs in MADT generatorKrzysztof Koch2019-06-101-7/+83
| | | | | | | | | Check for duplicate ACPI Processor UIDs when populating the GIC CPU (GICC) Interface structures inside the MADT table generator. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Add frame number validation to GTDT generatorKrzysztof Koch2019-06-101-0/+9
| | | | | | | | | | | | Added code to check if the Generic Timer Block Structure's frame number provided by the platform repository is within the allowed range (0-7). References: - ACPI 6.2 Errata A, Table 5-122, September 2017 Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-0917-119/+17
| | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Remove GIC Distributor Id fieldSami Mujawar2019-03-201-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch was originally merged in edk2 master at d3a15f435f9716aa2f2ea5e9b35fcda04f267ab4. However, this was later reverted at 82c4426a176c271d24915b403b267a431bdc52f5 as it was merged during the Soft Feature Freeze for edk2-stable201903. Resubmitting this patch as the edk2 merge window is now open. According to ACPI 6.2 Specification - Errata A, 'One, and only one, GIC distributor structure must be present in the MADT for an ARM based system'. Therefore, the GIC Distributor ID field in the ACPI MADT GICD substructure can be set to zero and there is no need for the Configuration Manager to provide this information. Update the CM_ARM_GICD_INFO structure to remove the GicId field. Similarly update the MADT Generator to set the GicId field in the GICD substructure to zero. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Alexei Fedorov <alexei.fedorov@arm.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
* DynamicTablesPkg: DGB2: Update DBG2_DEBUG_PORT_DDISami Mujawar2019-03-201-4/+1
| | | | | | | | | | | | | | | | | | | | | | This patch was originally merged in edk2 master at 6814256083a90ef218e7ae240e51922045175df1. However, this was later reverted at db8382ef5e44bd07654fb4726b77f3c329210561 as it was merged during the Soft Feature Freeze for edk2-stable201903. Resubmitting this patch as the edk2 merge window is now open. The DBG2_DEBUG_PORT_DDI() macro supports adding only one Generic Base Address Register. Therefore, removed the superfluous parameter NumReg and updated the macro to use DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS which has a value 1. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Alexei Fedorov <alexei.fedorov@arm.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
* DynamicTablesPkg: Add OEM InfoSami Mujawar2019-03-207-7/+7
| | | | | | | | | | | | | | | | | | | This patch originally merged in edk2 master at c788bdaba47536447ae37518a96d92e0da54aad7. However, this was later reverted at bdbbedea949eb4b10d24110c0e559b03c7a6bce4 as it was merged during the Soft Feature Freeze for edk2-stable201903. Resubmitting this patch as the edk2 merge window is now open. Added option for OEMs to provide OEM Table ID and OEM Revision for ACPI tables. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Alexei Fedorov <alexei.fedorov@arm.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
* DynamicTablesPkg: Rename enum used for ID MappingSami Mujawar2019-03-201-3/+3
| | | | | | | | | | | | | | | | | | | This patch was originally merged in edk2 master at 1d49a75367ef6827b8b8f77f61e9ce245d1bdee3. However, this was later reverted at 334111b0dab80394aeb1ebb8f0f3314847e2dc1f as it was merged during the Soft Feature Freeze for edk2-stable201903. Resubmitting this patch as the edk2 merge window is now open. Renamed the enum EArmObjIdMapping to EArmObjIdMappingArray and updated the IORT generator accordingly. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Alexei Fedorov <alexei.fedorov@arm.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>