summaryrefslogtreecommitdiff
path: root/DynamicTablesPkg/Library
AgeCommit message (Collapse)AuthorFilesLines
2024-07-29DynamicTablesPkg: Drop Cpu Info object ID from Arm NamespaceSami Mujawar2-48/+46
The Arm Namespace Object ID for CPU info was not used. Therefore, drop the EArmObjCpuInfo object ID. Also remove - the partial listing of the Arm Namespace object IDs from ConfigurationManagerObject.h and add a reference to the location where they are defined. - the parsing code in Configuration Manager ObjectParser. - update the Dynamic Plat Repo TokenFixer map. Cc: Pierre Gondois <Pierre.Gondois@arm.com> Cc: Yeo Reum Yun <YeoReum.Yun@arm.com> Cc: AbdulLateef Attar <AbdulLateef.Attar@amd.com> Cc: Jeshua Smith <jeshuas@nvidia.com> Cc: Jeff Brasen <jbrasen@nvidia.com> Cc: Girish Mahadevan <gmahadevan@nvidia.com> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
2024-07-29DynamicTablesPkg: Update DynamicPlatRepo for Arch Common namespaceSami Mujawar3-64/+223
Update DynamicPlatRepo to reflect the introduction of the Arch Common namespace. Also, update the TokenFixer map to reflect the current state of the ArmNamespace Objects and add a note in the documentation header for the EARM_OBJECT_ID enum, that the Token fixer map needs updating whenever the ArmObjectId space is updated. Cc: Pierre Gondois <Pierre.Gondois@arm.com> Cc: Yeo Reum Yun <YeoReum.Yun@arm.com> Cc: AbdulLateef Attar <AbdulLateef.Attar@amd.com> Cc: Jeshua Smith <jeshuas@nvidia.com> Cc: Jeff Brasen <jbrasen@nvidia.com> Cc: Girish Mahadevan <gmahadevan@nvidia.com> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
2024-07-29DynamicTablesPkg: TokenFixer: Return Non Arm NS objs as unsupportedSami Mujawar1-4/+7
Update the Token Fixer to return objects other than Arm Namespace objects as unsupported. Cc: Pierre Gondois <Pierre.Gondois@arm.com> Cc: Yeo Reum Yun <YeoReum.Yun@arm.com> Cc: AbdulLateef Attar <AbdulLateef.Attar@amd.com> Cc: Jeshua Smith <jeshuas@nvidia.com> Cc: Jeff Brasen <jbrasen@nvidia.com> Cc: Girish Mahadevan <gmahadevan@nvidia.com> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
2024-07-29DynamicTablesPkg: Add support for ArchCommon objects in CmObjParserSami Mujawar1-0/+22
Update the Cm Object Parser to support parsing of Arch Common namespace objects. Cc: Pierre Gondois <Pierre.Gondois@arm.com> Cc: Yeo Reum Yun <YeoReum.Yun@arm.com> Cc: AbdulLateef Attar <AbdulLateef.Attar@amd.com> Cc: Jeshua Smith <jeshuas@nvidia.com> Cc: Jeff Brasen <jbrasen@nvidia.com> Cc: Girish Mahadevan <gmahadevan@nvidia.com> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
2024-07-29DynamicTablesPkg: Introduce ObjectId to validate CmObject Parser ArraySami Mujawar2-105/+75
Add ObjectId to CM_OBJ_PARSER_ARRAY so that the code can validate the entries in the Cm object parser array. Also introduce helper macros to populate the Cm Object Parser Arrays. Cc: Pierre Gondois <Pierre.Gondois@arm.com> Cc: Yeo Reum Yun <YeoReum.Yun@arm.com> Cc: AbdulLateef Attar <AbdulLateef.Attar@amd.com> Cc: Jeshua Smith <jeshuas@nvidia.com> Cc: Jeff Brasen <jbrasen@nvidia.com> Cc: Girish Mahadevan <gmahadevan@nvidia.com> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
2024-07-29DynamicTablesPkg: Replace ProcNodeIdInfo with EArmObjReserved29Sami Mujawar2-15/+2
The CM_ARM_PROC_NODE_ID_INFO was dropped by the patch at "b2bbe3df5470 DynamicTablesPkg: Remove PPTT ID structure from ACPI 6.4 generator" and the EArmObjProcNodeIdInfo was made EArmObjReserved29. Since ProcNodeIdInfo is no longer used drop the CM object parser code from EArmObjProcNodeIdInfo and specify a null entry for EArmObjReserved29. Cc: Pierre Gondois <Pierre.Gondois@arm.com> Cc: Yeo Reum Yun <YeoReum.Yun@arm.com> Cc: AbdulLateef Attar <AbdulLateef.Attar@amd.com> Cc: Jeshua Smith <jeshuas@nvidia.com> Cc: Jeff Brasen <jbrasen@nvidia.com> Cc: Girish Mahadevan <gmahadevan@nvidia.com> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
2024-07-29DynamicTablesPkg/SsdtCpuTopology: Update function's parameter descriptionPierre Gondois1-1/+2
The parameters of CreateAmlProcessorContainer() were not updated in: commit 5fb3f5723a1e ("DynamicTablesPkg: Allow for specified CPU names") This causes the EccCheck CI test to fail. Fix this. Cc: Pierre Gondois <Pierre.Gondois@arm.com> Cc: Yeo Reum Yun <YeoReum.Yun@arm.com> Cc: AbdulLateef Attar <AbdulLateef.Attar@amd.com> Cc: Jeshua Smith <jeshuas@nvidia.com> Cc: Jeff Brasen <jbrasen@nvidia.com> Cc: Girish Mahadevan <gmahadevan@nvidia.com> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
2024-07-01DynamicTablesPkg: AmlLib remove unnecessary castJeshua Smith2-2/+2
Now that CONST input strings to the AmlLib APIs are properly marked as CONST we don't need to cast them to non-CONST before passing them. Signed-off-by: Jeshua Smith <jeshuas@nvidia.com>
2024-07-01DynamicTablesPkg: AmlLib CONST cleanupJeshua Smith3-8/+8
Several input strings to AmlLib APIs are treated as CONST but were missing the CONST keyword, requiring their callers to create unnecessary r/w copies of r/o input strings. This change properly marks these input strings as CONST. Signed-off-by: Jeshua Smith <jeshuas@nvidia.com> Reviewed-by: Jeff Brasen <jbrasen@nvidia.com>
2024-05-10DynamicTablesPkg: Adds integer to the AML package nodeAbdul Lateef Attar1-0/+67
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>
2024-03-13DynamicTablesPkg/SSDT: Require Package node in hierarchyJeshua Smith1-10/+22
The code was incorrectly assuming that root nodes had to be physical package nodes and vice versa. This is not always true, so update the check to simply require exactly one package node somewhere in the hierarchy. Cc: Pierre Gondois <pierre.gondois@arm.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Jeshua Smith <jeshuas@nvidia.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2024-03-04DynamicTablesPkg/SsdtSerialPortFixupLib: Add Interrupt node for SPIs onlyHimanshu Sharma3-28/+64
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>
2024-01-29DynamicTablesPkg: Exempt some _CPC field from checksPierre Gondois2-4/+27
When generating _CPC objects, some fields are mandatory by spec [1]. Some fields cannot be supported by a the Juno platform, which is used to test the _CPC generation. Therefore, rely on the PcdDevelopmentPlatformRelaxations Pcd to either: - warn about the missing fields and and let the OS handle the missing information - consider the missing fields as an error _CPC fields that are exempted from checks when the Pcd is set: - PerformanceLimitedRegister - ReferencePerformanceCounterRegister - DeliveredPerformanceCounterRegister [1] Cf. non-optional fields in: ACPI 6.5, s8.4.6.1 '_CPC (Continuous Performance Control)' Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2024-01-29DynamicTablesPkg: Add DynamicTablesScmiInfoLibPierre Gondois2-0/+328
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>
2024-01-29DynamicTablesPkg: Generate _PSD in SsdtCpuTopologyGeneratorPierre Gondois1-0/+96
Make use of the newly added AmlCreatePsdNode() to generate _PSD objects. _PSD objects allow to describe 'performance control, P-state or CPPC, logical processor dependency', Cf. ACPI 6.4, s8.4.5.5 _PSD (P-State Dependency). Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2024-01-29DynamicTablesPkg: Add AmlCreatePsdNode() to generate _PSDPierre Gondois1-1/+187
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>
2024-01-29DynamicTablesPkg: Add PsdToken field to CM_ARM_GICC_INFO objectPierre Gondois1-1/+2
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>
2024-01-29DynamicTablesPkg: Add CM_ARM_PSD_INFO objectPierre Gondois1-0/+11
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>
2024-01-29DynamicTablesPkg: Rename AmlCpcInfo.h to AcpiObjects.hPierre Gondois1-1/+1
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>
2024-01-29DynamicTablesPkg: Use new CPC revision macroPierre Gondois1-1/+1
Make use of the newly added CPC revision macro. Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2024-01-03DynamicTablesPkg: Fix IA32 compilation errorsAbdul Lateef Attar2-3/+6
Add the support for X64 compilation to the CI. - Fix the signed and unsigned variable comparision. warning C4018: '>': signed/unsigned mismatch - Fix the NOOPT build error for IA32 by replacing 64bit shift operator with LShiftU64. 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: Sami Mujawar <sami.mujawar@arm.com>
2024-01-03DynamicTablesPkg: Fix X64 compilation errorsAbdul Lateef Attar5-5/+12
Add the support for X64 compilation to the CI. Fix the compilation errors. 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: Sami Mujawar <sami.mujawar@arm.com>
2023-12-22DynamicTablesPkg: AML Code generation to invoke a methodAbdul Lateef Attar1-0/+241
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>
2023-12-22DynamicTablesPkg: Corrects function pointer typedef of AML_PARSE_FUNCTIONAbdul Lateef Attar1-2/+1
Corrects the function pointer typedef AML_PARSE_FUNCTION, otherwise some compiler like VS2019 gives error. 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>
2023-12-22DynamicTablesPkg: Corrects AmlCodeGenRdWordBusNumber parametersAbdul Lateef Attar1-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>
2023-12-22DynamicTablesPkg: AML Code generation for word I/O rangesAbdul Lateef Attar1-0/+88
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>
2023-11-21DynamicTablesPkg: Fix ETE _UID CreationAshish Singhal1-1/+4
Bugzilla: 4600 (https://bugzilla.tianocore.org/show_bug.cgi?id=4600) Just like CPU _UID, ETE UID also needs to be unique so use AcpiProcessorUid instead of CpuName Signed-off-by: Ashish Singhal <ashishsingha@nvidia.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2023-11-01DynamicTablesPkg: Fix assert in CmObject parserSami Mujawar1-1/+2
The patch "f81ee47513e5 DynamicTablesPkg: Add an ET info object parser" updates the Configuration Manager object parser to add support for parsing CM_ARM_ET_INFO object. However, the GicC info structure also has an ET Reference token that points to the CM_ARM_ET_INFO object. Therefore, update the GICC info object parser to add an entry to parse the ET reference token. Without this change an assert stating that the RemainingSize != 0 will be triggered. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: levi.yun <yeoreum.yun@arm.com>
2023-10-30DynamicTablesPkg: Fix referencing of CPC tokenSami Mujawar1-1/+1
The CpcToken has been incorrectly referenced in the CreateTopologyFromGicC() and always points to the CPC token in the first GICC Info object. Therefore, fix this by correctly indexing into the GicCInfo object array. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>
2023-10-30DynamicTablesPkg: Add ETE device to CPU node in AMLSami Mujawar2-2/+195
The Coresight Embedded Trace Extension (ETE) feature can be detected by the platform firmware by examining the debug feature register ID_AA64DFR0_EL1.TraceVer field. The platform configuration manager can then describe the ETE by creating CM_ARM_ET_INFO object(s) and referencing these in CM_ARM_GICC_INFO.EtToken. The 'Table 3: Compatible IDs for architected CoreSight components' in the 'ACPI for CoreSight 1.2 Platform Design Document' specifies the HID value for Coresight ETE and CoreSight Embedded Trace Macrocell (ETM) v4.x as ARMH C500. Therefore, update the SsdtCpuTopologyGenerator to add an ETE device to the CPU node in the AML CPU hierarchy so that an OS can utilise this information. Note: 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, the AML description does not describe any memory mapped registers. However, 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>
2023-10-30DynamicTablesPkg: Add an ET info object parserSami Mujawar1-0/+8
An Embedded Trace (ET) info object is used to provide information about an Embedded Trace Extension (ETE) or an Embedded Trace Module (ETM) available on a platform. The CM_ARM_ET_INFO object has already been added to the Arm namespace objects list by a previous patch. Therefore, update the CM Object parser to add support for parsing the CM_ARM_ET_INFO object. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>
2023-10-30DynamicTablesPkg: Update FADT generator to ACPI 6.5Sami Mujawar1-54/+54
The ACPI 6.5 specification updates the minor revision of the FADT table to 5. Therefore, update the FADT generator to setup the minor revision for ACPI 6.5. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>
2023-10-30DynamicTablesPkg: Update MADT generator for ACPI 6.5Sami Mujawar1-37/+42
The ACPI 6.5 specification updates the MADT table to add a new field to GICC for specifying the TRBE interrupt and also adds support for Online Capable flag to the GICC flags. The Online Capable flags should be passed transparently through as specified in the CM_ARM_GICC_INFO.Flags field and only require the MADT table revision to be setup to 6 to reflect the ACPI 6.5 specification. The TRBE field needs to be appropriately setup in the GICC structure. Therefore, update the MADT generator to reflect the above updates required for supporting ACPI 6.5 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>
2023-10-30DynamicTablesPkg: Add TRBE interrupt to GICC object parserSami Mujawar1-1/+2
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. This field has already been added to the CM_ARM_GICC_INFO structure in a previous patch. Therefore, update the Configuration Manager Object Parser 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>
2023-10-23DynamicTablesPkg/AmlLib: Enumerate memory attributesJeshua Smith2-10/+10
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>
2023-10-23DynamicTablesPkg/TableHelperLib: Enhance error handlingJeshua Smith1-14/+33
This patch enhances error handling and reporting in the CM ObjectParser. Specifically: 1. ObjectIDs used as array indexes are checked for being out of bounds, and if so an error message is printed before the assert. 2. An error message is printed for unsupported NameSpaceIDs. 3. Adds support for unimplemented parsers by allowing IDs to list a NULL parser, resulting in an unimplemented message being printed. Signed-off-by: Jeshua Smith <jeshuas@nvidia.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2023-10-23DynamicTablesPkg/TableHelperLib: Fix and improve text handlingJeshua Smith1-33/+143
This fixes two bugs and adds some enhancements to the handling of characters and strings in objects being printed by the CM ObjectParser. Bug fixes: 1. PrintOemID() currently attempts to print characters with "%C", but the correct syntax is (lowercase) "%c". This bug results in "CCCCCC" being printed instead of the actual ASCII characters. 2. PrintString() is being passed a pointer to data in objects, but in some cases this data is the actual string to print and other cases it is a pointer to the string to print. This adds a PrintStringPtr function and uses the correct functions depending on the situation. Enhancements: 1. Some objects contain ASCII characters, which are currently printed as their hex values. This adds functions to print out ASCII character fields as text rather than hex, and uses those functions in several cases where the object data is defined to be ASCII. 2. The PrintOemID() function is replaced with the new identical but more generecically-named PrintChar6() function. Signed-off-by: Jeshua Smith <jeshuas@nvidia.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2023-09-22DynamicTablesPkg: AcpiSsdtPcieLibArm: Use QWord to describe I/O rangeVidya Sagar1-1/+1
Use AmlCodeGenRdQWordIo() to generate the I/O range in _CRS instead of AmlCodeGenRdDWordIo() to cater to the scenarios where 64-bit addresses can be used to generate I/O packets over the PCIe bus. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2023-09-22DynamicTablesPkg: AML Code generation for I/O rangesVidya Sagar1-0/+90
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>
2023-09-22DynamicTablesPkg: Add Aml NameUnicodeString APIJeff Brasen1-0/+86
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>
2023-09-22DynamicTablesPkg: Add support to add Strings to packageJeff Brasen1-0/+84
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>
2023-09-22DynamicTablesPkg: Add support for simple method invocation.Jeff Brasen1-0/+238
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>
2023-09-22DynamicTablesPkg: Add ThermalZone CodeGen functionJeff Brasen1-0/+116
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>
2023-04-25DynamicTablesPkg/SsdtCpuTopology: Allow multi-packages topologiesPierre Gondois2-51/+84
The topology of a platform is represented in ACPI using the PPTT table. It is possible to append information to CPUs/processor containers using their associated AML nodes in a SSDT table. A platform might have multiple 'physical packages' (or top-level nodes) in their PPTT topology representation. It can be assumed from [1] that a 'physical packages' is always a 'top-level node', and conversely. The SSDT topology generator doesn't support having multiple top-level nodes. The top-level node is also not generated in the SSDT topology representation. Add support to generate multiple top-level nodes in the SSDT topology generator and generate an AML node for this top-level node. This will allow to have matching PPTT and SSDT topology representations. Prior to this patch, this top-level AML node was not generated. Also factorize the flag checking in CheckProcNode() and add more checks. This patch takes inspiration from the discussion at: - v1: https://edk2.groups.io/g/devel/message/99410 - v2: https://edk2.groups.io/g/devel/message/99615 [1] ACPI 6.5, 5.2.30.1 Processor hierarchy node structure (Type 0): - "Multiple trees may be described, covering for example multiple packages. For the root of a tree, the parent pointer should be 0."" - "Each valid processor must belong to exactly one package. That is, the leaf must itself be a physical package or have an ancestor marked as a physical package." Suggested-by: Jeff Brasen <jbrasen@nvidia.com> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2023-03-29DynamicTablesPkg: Fix parsing of serial port nodeSami Mujawar1-2/+2
When scanning for the Serial Port in the device tree, the length and value parameters to ScanMem8() are not in the right order. This results in the serial port not being detected if the chosen node in the device tree has additional elements. Therefore, pass the parameters to ScanMem8() in the correct order to fix this issue. Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
2023-03-29DynamicTablesPkg: Reduce log output from TableHelperLibSami Mujawar1-14/+14
Reduce the log output from Configuration Manager Object Parser in TableHelperLib by enabling the logs only if DEBUG_INFO is enabled. Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
2023-03-10DynamicTablesPkg: Add SMBIOS String table helper librarySami Mujawar2-0/+252
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>
2023-01-10DynamicTablesPkg: FdtHwInfoParserLib: Fix compatible stringMoritz Fischer1-0/+1
Linux's cpu DT bindings call out arm,armv8 while the code previously used arm,arm-v8, add second entry to support the arm,armv8 case. Cc: Sami Mujawar <sami.mujawar@arm.com> Fixes: e366a41ef0 ("DynamicTablesPkg: FdtHwInfoParser: Add GICC parser") Signed-off-by: Moritz Fischer <moritzf@google.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2022-12-19DynamicTablesPkg: Allow for specified CPU namesJeff Brasen2-11/+32
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>
2022-12-14DynamicTablesPkg: SSDT _LPI revision is incorrectJeff Brasen1-1/+1
_LPI Revision should be 0 per the ACPI 6.5 specification. "The revision number of the _LPI object. Current revision is 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>