Commit Graph

225 Commits

Author SHA1 Message Date
Ashish Singhal 23dbb8a07d DynamicTablesPkg: Fix ETE _UID Creation
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-21 14:13:54 +00:00
Sami Mujawar fbbbd98499 DynamicTablesPkg: Fix assert in CmObject parser
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-11-01 15:17:37 +00:00
Sami Mujawar 09fd4e4172 DynamicTablesPkg: Fix referencing of CPC token
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-30 12:16:56 +00:00
Sami Mujawar 3ee23713e1 DynamicTablesPkg: Add ETE device to CPU node in AML
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-30 12:16:56 +00:00
Sami Mujawar f81ee47513 DynamicTablesPkg: Add an ET info object parser
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-30 12:16:56 +00:00
Sami Mujawar 50e8518276 DynamicTablesPkg: Update FADT generator to ACPI 6.5
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-30 12:16:56 +00:00
Sami Mujawar 36e9f3d08a DynamicTablesPkg: Update MADT generator for ACPI 6.5
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-30 12:16:56 +00:00
Sami Mujawar cf62548a35 DynamicTablesPkg: Add TRBE interrupt to GICC object parser
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-30 12:16:56 +00:00
Jeshua Smith 309450db26 DynamicTablesPkg/AmlLib: Enumerate memory attributes
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-23 18:38:59 +00:00
Jeshua Smith ec7f734366 DynamicTablesPkg/TableHelperLib: Enhance error handling
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-23 17:05:02 +00:00
Jeshua Smith 575bd4f55c DynamicTablesPkg/TableHelperLib: Fix and improve text handling
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-10-23 17:05:02 +00:00
Vidya Sagar 8b2e6b90b8 DynamicTablesPkg: AcpiSsdtPcieLibArm: Use QWord to describe I/O range
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-22 14:46:02 +00:00
Vidya Sagar 909e870e34 DynamicTablesPkg: AML Code generation for I/O ranges
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-22 14:46:02 +00:00
Jeff Brasen b5003ab725 DynamicTablesPkg: Add Aml NameUnicodeString API
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-22 09:06:21 +00:00
Jeff Brasen fd0ccccb42 DynamicTablesPkg: Add support to add Strings to package
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-22 09:06:21 +00:00
Jeff Brasen b2df3ee17f DynamicTablesPkg: Add support for simple method invocation.
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-22 09:06:21 +00:00
Jeff Brasen 8f5505a4c9 DynamicTablesPkg: Add ThermalZone CodeGen function
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-09-22 09:06:21 +00:00
Pierre Gondois 18f463edba DynamicTablesPkg/SsdtCpuTopology: Allow multi-packages topologies
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-04-25 10:52:24 +00:00
Sami Mujawar cc6a0cff99 DynamicTablesPkg: Fix parsing of serial port node
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-29 13:48:54 +00:00
Sami Mujawar 31f0af7964 DynamicTablesPkg: Reduce log output from TableHelperLib
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-29 13:48:54 +00:00
Sami Mujawar 9b94ebb0c8 DynamicTablesPkg: Add SMBIOS String table helper library
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-03-10 14:56:13 +00:00
Moritz Fischer 717f35a9f2 DynamicTablesPkg: FdtHwInfoParserLib: Fix compatible string
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>
2023-01-10 14:27:18 +00:00
Jeff Brasen 5fb3f5723a DynamicTablesPkg: Allow for specified CPU names
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-19 11:28:55 +00:00
Jeff Brasen 916825b84f DynamicTablesPkg: SSDT _LPI revision is incorrect
_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>
2022-12-14 15:39:28 +00:00
Pierre Gondois 11ce7a2de7 DynamicTablesPkg: Remove duplicated words
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>
2022-12-13 14:30:20 +00:00
Pierre Gondois 1729fb8a82 DynamicTablesPkg/AmlLib: Allow larger AccessSize for Pcc address space
For Pcc address space, the AccessSize field of a Register is
used to delcare the Pcc Subspace Id. This Id can be up to 256.

Cf. ACPI 6.4, s14.7 Referencing the PCC address space

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2022-10-31 12:32:32 +00:00
Pierre Gondois 8405b1480f DynamicTablesPkg: Add PCCT Generator
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>
2022-10-31 12:32:32 +00:00
Pierre Gondois dab7bac94c DynamicTablesPkg: Add PCCT related objects
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>
2022-10-31 12:32:32 +00:00
Pierre Gondois a5672d43a6 DynamicTablesPkg: Fix Ssdt PCI generation comments
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>
2022-10-31 12:32:32 +00:00
Pierre Gondois 5acd6489df DynamicTablesPkg: FdtHwInfoParserLib: Remove wrong comment
commit 13136cc311 ("DynamicTablesPkg: FdtHwInfoParserLib:
Parse Pmu info")
adds support for pmu parsing. Thus, remove the wrong comment.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2022-10-31 12:32:32 +00:00
Pierre Gondois 0bcd3cc06e DynamicTablesPkg: Remove deprecated APIs
commit 691c5f7762 ("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>
2022-10-31 12:32:32 +00:00
Pierre Gondois 2ef32f914a DynamicTablesPkg: Fix wrong/missing fields in CmObjParser
Add missing fields to the following CmObjParser objects:
- EArmObjGicDInfo
- EArmObjCacheInfo
and fix wrong formatting of:
- EArmObjLpiInfo

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2022-10-31 12:32:32 +00:00
Pierre Gondois a64cc43552 DynamicTablesPkg: Fix GTBlock and GTBlockTimerFrame CmObjParsers
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>
2022-10-31 12:32:32 +00:00
Pierre Gondois 3bcc2e22ef DynamicTablesPkg: Update CmObjParser for MinorRevision
commit 0d23c447d6 ("DynamicTablesPkg: Add support to specify FADT
minor revision")
adds new 'MinorRevision' field to CM_STD_OBJ_ACPI_TABLE_INFO.
Reflect the change in this patch to the CmObjectParser.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2022-10-31 12:32:32 +00:00
Pierre Gondois 44b7a856f0 DynamicTablesPkg: Update CmObjParser for IORT Rev E.d
commit de200b7e2c ("DynamicTablesPkg: Update ArmNameSpaceObjects for
IORT Rev E.d")
adds new CmObj structures and fields to the ArmNameSpaceObjects.
Update the CmObjectParser accordingly.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2022-10-31 12:32:32 +00:00
Pierre Gondois 48c6e7dbcd DynamicTablesPkg: Add PrintString to CmObjParser
Add a PrintString to print strings in the CmObjParser.
String must be NULL terminated and no buffer overrun check
is done by this function.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2022-10-31 12:32:32 +00:00
Pierre Gondois 020891f173 DynamicTablesPkg: Use correct print formatter
In C, the 'long long' types are 64-bits. The 'll' printf length
specifier should be used to pring these values. Just '%x' allows to
print values that are on 16-bits or more. Use that instead.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2022-10-31 12:32:32 +00:00
Jeff Brasen 2500ce1011 DynamicTablesPkg: SSDT CPU _CPC generator
Add code to use a token attached to GICC to generate _CPC object on cpus.

Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2022-09-23 17:21:36 +00:00
Jeff Brasen 58350c0055 DynamicTablesPkg: AML Code generation to add _CPC entries
_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>
2022-09-23 17:21:36 +00:00
Jeff Brasen 09c90532e7 DynamicTablesPkg: Add CM_ARM_CPC_INFO object
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>
2022-09-23 17:21:36 +00:00
Jeff Brasen 8c92a9508e DynamicTablesPkg: AcpiSsdtPcieLibArm: Allow use of segment number as UID
Add support for selecting to use index or segment number as UID and name.
This allows the path of the nodes to be well known.
For example, if the PCIe node needs to be notified from by an interrupt
for a Generic Event Device

Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2022-09-15 16:33:25 +00:00
Michael Kubacki e8a537d28d DynamicTablesPkg/AcpiPpttLibArm: Fix debug macro arguments
Cc: Sami Mujawar <Sami.Mujawar@arm.com>
Cc: Alexei Fedorov <Alexei.Fedorov@arm.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2022-09-09 01:42:39 +00:00
Rebecca Cran ac55fcb051 DynamicTablesPkg: Fix typo in AmlCodeGenRdMemory32Fixed doxygen comment
Fix typo of "Address".

Signed-off-by: Rebecca Cran <rebecca@quicinc.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2022-09-01 14:48:38 +00:00
Jeff Brasen 7719bc3f71 DynamicTablesPkg: Fix nested processor containers
Current code will generate duplicate UID if there are nested processor
containers in the topology. For example if there is a
socket/cluster/core layout.

Change references to processor container from cluster to be more
accurate on what is being created.

Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2022-09-01 14:19:59 +00:00
Jeff Brasen 0a4079ad86 DynamicTablesPkg: AcpiSsdtPcieLibArm : Add UID to slot creation
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>
2022-09-01 13:53:17 +00:00
Jeff Brasen b9bb27e1ff DynamicTablesPkg: Add support to build _DSD
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>
2022-09-01 12:43:22 +00:00
Kun Qin 033ba8bb29 DynamicTablesPkg: AcpiSsdtPcieLibArm: Added function to reserve ECAM space
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3998

Certain OSes will complain if the ECAM config space is not reserved in
the ACPI namespace.

This change adds a function to reserve PNP motherboard resources for a
given PCI node.

Co-authored-by: Joe Lopez <joelopez@microsoft.com>
Signed-off-by: Kun Qin <kuqin12@gmail.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Tested-by: Sami Mujawar <sami.mujawar@arm.com>
2022-09-01 10:27:02 +00:00
Kun Qin d9c8a9cf11 DynamicTablesPkg: DynamicPlatRepoLib: Adding more token fixers
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3996

This change added more token fixers for other node types, including
NamedComponentNode, RootComplexNode, and SmmuV3Node.

The corresponding entries for tokenFixer functions table is also updated.

Cc: Sami Mujawar <Sami.Mujawar@arm.com>
Cc: Alexei Fedorov <Alexei.Fedorov@arm.com>

Co-authored-by: Joe Lopez <joelopez@microsoft.com>
Signed-off-by: Kun Qin <kuqin12@gmail.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>
Tested-by: Sami Mujawar <sami.mujawar@arm.com>
2022-09-01 10:27:02 +00:00
Kun Qin b18c0905ee DynamicTablesPkg: DynamicPlatRepoLib: Fix incorrect dereferencing
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3996

The content of token should be derived from the data section of the
`CmObject` instead of the object itself.

This change fixed the issue by dereferencing the token value from the
data buffer of input CmObject.

Cc: Sami Mujawar <Sami.Mujawar@arm.com>
Cc: Alexei Fedorov <Alexei.Fedorov@arm.com>

Co-authored-by: Joe Lopez <joelopez@microsoft.com>
Signed-off-by: Kun Qin <kuqin12@gmail.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>
Tested-by: Sami Mujawar <sami.mujawar@arm.com>
2022-09-01 10:27:02 +00:00
Kun Qin 2081054636 DynamicTablesPkg: DynamicPlatRepoLib: Added MemoryAllocationLib to inf
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3996

The DynamicPlatRepoLib has multiple reference to MemoryAllocationLib,
such as DynamicPlatRepo.c and TokenMapper.c. Not including it in the
library inf file could lead to potential build break.

This change added the MemoryAllocationLib into this inf file.

Cc: Sami Mujawar <Sami.Mujawar@arm.com>
Cc: Alexei Fedorov <Alexei.Fedorov@arm.com>

Co-authored-by: Joe Lopez <joelopez@microsoft.com>
Signed-off-by: Kun Qin <kuqin12@gmail.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>
Tested-by: Sami Mujawar <sami.mujawar@arm.com>
2022-09-01 10:27:02 +00:00