Date   

[PATCH v3 0/3] DynamicTablesPkg: _CPC support

Jeff Brasen
 

Add generator for creating the _CPC object for CPU nodes.

If viewing this review by a pull request is helpful one exists here:
https://github.com/NVIDIA/edk2/pull/12

Change Log:
v1 - Initial Revision
v2 - Added revision to object, improved error handling, changed to ACPI 6.4 structures.
v3 - Minor review feedback

Jeff Brasen (3):
DynamicTablesPkg: Add CM_ARM_CPC_INFO object
DynamicTablesPkg: AML Code generation to add _CPC entries
DynamicTablesPkg: SSDT CPU _CPC generator

.../Include/ArmNameSpaceObjects.h | 148 ++++-
.../Include/Library/AmlLib/AmlLib.h | 156 +++++
.../SsdtCpuTopologyGenerator.c | 223 ++++++-
.../Common/AmlLib/CodeGen/AmlCodeGen.c | 543 ++++++++++++++++++
.../ConfigurationManagerObjectParser.c | 80 +++
5 files changed, 1127 insertions(+), 23 deletions(-)

--
2.25.1


[PATCH v3 3/3] DynamicTablesPkg: SSDT CPU _CPC generator

Jeff Brasen
 

Add code to use a token attached to GICC to generate _CPC object on cpus.

Signed-off-by: Jeff Brasen <jbrasen@...>
---
.../SsdtCpuTopologyGenerator.c | 223 +++++++++++++++++-
1 file changed, 217 insertions(+), 6 deletions(-)

diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
index 8561f48e1f..5d41d57064 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
@@ -76,6 +76,16 @@ GET_OBJECT_LIST (
CM_ARM_LPI_INFO
);

+/**
+ This macro expands to a function that retrieves the CPC
+ information from the Configuration Manager.
+*/
+GET_OBJECT_LIST (
+ EObjNameSpaceArm,
+ EArmObjCpcInfo,
+ CM_ARM_CPC_INFO
+ );
+
/** Initialize the TokenTable.

One entry should be allocated for each CM_ARM_PROC_HIERARCHY_INFO
@@ -229,6 +239,183 @@ WriteAslName (
return EFI_SUCCESS;
}

+/** Utility function to check if generic address points to NULL
+
+ @param [in] Address Pointer to the Generic address
+
+ @retval TRUE Address is system memory with an Address of 0.
+ @retval FALSE Address does not point to NULL.
+**/
+STATIC
+BOOLEAN
+EFIAPI
+IsNullGenericAddress (
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *Address
+ )
+{
+ if ((Address == NULL) ||
+ ((Address->AddressSpaceId == EFI_ACPI_6_4_SYSTEM_MEMORY) &&
+ (Address->Address == 0x0)))
+ {
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+/** Create and add an _CPC Node to Cpu Node.
+
+ For instance, transform an AML node from:
+ Device (C002)
+ {
+ Name (_UID, 2)
+ Name (_HID, "ACPI0007")
+ }
+
+ To:
+ Device (C002)
+ {
+ Name (_UID, 2)
+ Name (_HID, "ACPI0007")
+ Name(_CPC, Package()
+ {
+ NumEntries, // Integer
+ Revision, // Integer
+ HighestPerformance, // Integer or Buffer (Resource Descriptor)
+ NominalPerformance, // Integer or Buffer (Resource Descriptor)
+ LowestNonlinearPerformance, // Integer or Buffer (Resource Descriptor)
+ LowestPerformance, // Integer or Buffer (Resource Descriptor)
+ GuaranteedPerformanceRegister, // Buffer (Resource Descriptor)
+ DesiredPerformanceRegister , // Buffer (Resource Descriptor)
+ MinimumPerformanceRegister , // Buffer (Resource Descriptor)
+ MaximumPerformanceRegister , // Buffer (Resource Descriptor)
+ PerformanceReductionToleranceRegister, // Buffer (Resource Descriptor)
+ TimeWindowRegister, // Buffer (Resource Descriptor)
+ CounterWraparoundTime, // Integer or Buffer (Resource Descriptor)
+ ReferencePerformanceCounterRegister, // Buffer (Resource Descriptor)
+ DeliveredPerformanceCounterRegister, // Buffer (Resource Descriptor)
+ PerformanceLimitedRegister, // Buffer (Resource Descriptor)
+ CPPCEnableRegister // Buffer (Resource Descriptor)
+ AutonomousSelectionEnable, // Integer or Buffer (Resource Descriptor)
+ AutonomousActivityWindowRegister, // Buffer (Resource Descriptor)
+ EnergyPerformancePreferenceRegister, // Buffer (Resource Descriptor)
+ ReferencePerformance // Integer or Buffer (Resource Descriptor)
+ LowestFrequency, // Integer or Buffer (Resource Descriptor)
+ NominalFrequency // Integer or Buffer (Resource Descriptor)
+ })
+ }
+
+ @param [in] Generator The SSDT Cpu Topology generator.
+ @param [in] CfgMgrProtocol Pointer to the Configuration Manager
+ Protocol Interface.
+ @param [in] ProcHierarchyNodeInfo CM_ARM_PROC_HIERARCHY_INFO describing
+ the Cpu.
+ @param [in] Node CPU Node to which the _CPC node is
+ attached.
+
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_INVALID_PARAMETER Invalid parameter.
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+CreateAmlCpcNode (
+ IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
+ IN CM_ARM_GICC_INFO *GicCInfo,
+ IN AML_OBJECT_NODE_HANDLE *Node
+ )
+{
+ EFI_STATUS Status;
+ CM_ARM_CPC_INFO *CpcInfo;
+
+ Status = GetEArmObjCpcInfo (
+ CfgMgrProtocol,
+ GicCInfo->CpcToken,
+ &CpcInfo,
+ NULL
+ );
+ if (EFI_ERROR (Status)) {
+ ASSERT (0);
+ return Status;
+ }
+
+ Status = AmlCreateCpcNode (
+ CpcInfo->Revision,
+ IsNullGenericAddress (&CpcInfo->HighestPerformanceBuffer) ?
+ NULL :
+ &CpcInfo->HighestPerformanceBuffer,
+ CpcInfo->HighestPerformanceInteger,
+ IsNullGenericAddress (&CpcInfo->NominalPerformanceBuffer) ?
+ NULL :
+ &CpcInfo->NominalPerformanceBuffer,
+ CpcInfo->NominalPerformanceInteger,
+ IsNullGenericAddress (&CpcInfo->LowestNonlinearPerformanceBuffer) ?
+ NULL :
+ &CpcInfo->LowestNonlinearPerformanceBuffer,
+ CpcInfo->LowestNonlinearPerformanceInteger,
+ IsNullGenericAddress (&CpcInfo->LowestPerformanceBuffer) ?
+ NULL :
+ &CpcInfo->LowestPerformanceBuffer,
+ CpcInfo->LowestPerformanceInteger,
+ IsNullGenericAddress (&CpcInfo->GuaranteedPerformanceRegister) ?
+ NULL :
+ &CpcInfo->GuaranteedPerformanceRegister,
+ IsNullGenericAddress (&CpcInfo->DesiredPerformanceRegister) ?
+ NULL :
+ &CpcInfo->DesiredPerformanceRegister,
+ IsNullGenericAddress (&CpcInfo->MinimumPerformanceRegister) ?
+ NULL :
+ &CpcInfo->MinimumPerformanceRegister,
+ IsNullGenericAddress (&CpcInfo->MaximumPerformanceRegister) ?
+ NULL :
+ &CpcInfo->MaximumPerformanceRegister,
+ IsNullGenericAddress (&CpcInfo->PerformanceReductionToleranceRegister) ?
+ NULL :
+ &CpcInfo->PerformanceReductionToleranceRegister,
+ IsNullGenericAddress (&CpcInfo->TimeWindowRegister) ?
+ NULL :
+ &CpcInfo->TimeWindowRegister,
+ IsNullGenericAddress (&CpcInfo->CounterWraparoundTimeBuffer) ?
+ NULL :
+ &CpcInfo->CounterWraparoundTimeBuffer,
+ CpcInfo->CounterWraparoundTimeInteger,
+ &CpcInfo->ReferencePerformanceCounterRegister,
+ &CpcInfo->DeliveredPerformanceCounterRegister,
+ &CpcInfo->PerformanceLimitedRegister,
+ IsNullGenericAddress (&CpcInfo->CPPCEnableRegister) ?
+ NULL :
+ &CpcInfo->CPPCEnableRegister,
+ IsNullGenericAddress (&CpcInfo->AutonomousSelectionEnableBuffer) ?
+ NULL :
+ &CpcInfo->AutonomousSelectionEnableBuffer,
+ CpcInfo->AutonomousSelectionEnableInteger,
+ IsNullGenericAddress (&CpcInfo->AutonomousActivityWindowRegister) ?
+ NULL :
+ &CpcInfo->AutonomousActivityWindowRegister,
+ IsNullGenericAddress (&CpcInfo->EnergyPerformancePreferenceRegister) ?
+ NULL :
+ &CpcInfo->EnergyPerformancePreferenceRegister,
+ IsNullGenericAddress (&CpcInfo->ReferencePerformanceBuffer) ?
+ NULL :
+ &CpcInfo->ReferencePerformanceBuffer,
+ CpcInfo->ReferencePerformanceInteger,
+ IsNullGenericAddress (&CpcInfo->LowestFrequencyBuffer) ?
+ NULL :
+ &CpcInfo->LowestFrequencyBuffer,
+ CpcInfo->LowestFrequencyInteger,
+ IsNullGenericAddress (&CpcInfo->NominalFrequencyBuffer) ?
+ NULL :
+ &CpcInfo->NominalFrequencyBuffer,
+ CpcInfo->NominalFrequencyInteger,
+ Node,
+ NULL
+ );
+ ASSERT_EFI_ERROR (Status);
+ return Status;
+}
+
/** Create and add an _LPI method to Cpu/Cluster Node.

For instance, transform an AML node from:
@@ -581,7 +768,20 @@ CreateAmlCpuFromProcHierarchy (
// CM_ARM_PROC_HIERARCHY_INFO, create an _LPI method returning them.
if (ProcHierarchyNodeInfo->LpiToken != CM_NULL_TOKEN) {
Status = CreateAmlLpiMethod (Generator, ProcHierarchyNodeInfo, CpuNode);
- ASSERT_EFI_ERROR (Status);
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ return Status;
+ }
+ }
+
+ // If a CPC info is associated with the
+ // GicCinfo, create an _CPC method returning them.
+ if (GicCInfo->CpcToken != CM_NULL_TOKEN) {
+ Status = CreateAmlCpcNode (Generator, CfgMgrProtocol, GicCInfo, CpuNode);
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ return Status;
+ }
}

return Status;
@@ -934,10 +1134,11 @@ CreateTopologyFromGicC (
IN AML_OBJECT_NODE_HANDLE ScopeNode
)
{
- EFI_STATUS Status;
- CM_ARM_GICC_INFO *GicCInfo;
- UINT32 GicCInfoCount;
- UINT32 Index;
+ EFI_STATUS Status;
+ CM_ARM_GICC_INFO *GicCInfo;
+ UINT32 GicCInfoCount;
+ UINT32 Index;
+ AML_OBJECT_NODE_HANDLE CpuNode;

ASSERT (Generator != NULL);
ASSERT (CfgMgrProtocol != NULL);
@@ -961,12 +1162,22 @@ CreateTopologyFromGicC (
ScopeNode,
&GicCInfo[Index],
Index,
- NULL
+ &CpuNode
);
if (EFI_ERROR (Status)) {
ASSERT (0);
break;
}
+
+ // If a CPC info is associated with the
+ // GicCinfo, create an _CPC method returning them.
+ if (GicCInfo->CpcToken != CM_NULL_TOKEN) {
+ Status = CreateAmlCpcNode (Generator, CfgMgrProtocol, &GicCInfo[Index], CpuNode);
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ break;
+ }
+ }
} // for

return Status;
--
2.25.1


[PATCH v3 1/3] DynamicTablesPkg: Add CM_ARM_CPC_INFO object

Jeff Brasen
 

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@...>
---
.../Include/ArmNameSpaceObjects.h | 148 ++++++++++++++++--
.../ConfigurationManagerObjectParser.c | 80 ++++++++++
2 files changed, 211 insertions(+), 17 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index 102e0f96be..d76cc08e14 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -63,6 +63,7 @@ typedef enum ArmObjectID {
EArmObjPciInterruptMapInfo, ///< 39 - Pci Interrupt Map Info
EArmObjRmr, ///< 40 - Reserved Memory Range Node
EArmObjMemoryRangeDescriptor, ///< 41 - Memory Range Descriptor
+ EArmObjCpcInfo, ///< 42 - Continuous Performance Control Info
EArmObjMax
} EARM_OBJECT_ID;

@@ -97,99 +98,105 @@ typedef struct CmArmPowerManagementProfileInfo {
*/
typedef struct CmArmGicCInfo {
/// The GIC CPU Interface number.
- UINT32 CPUInterfaceNumber;
+ UINT32 CPUInterfaceNumber;

/** The ACPI Processor UID. This must match the
_UID of the CPU Device object information described
in the DSDT/SSDT for the CPU.
*/
- UINT32 AcpiProcessorUid;
+ UINT32 AcpiProcessorUid;

/** The flags field as described by the GICC structure
in the ACPI Specification.
*/
- UINT32 Flags;
+ UINT32 Flags;

/** The parking protocol version field as described by
the GICC structure in the ACPI Specification.
*/
- UINT32 ParkingProtocolVersion;
+ UINT32 ParkingProtocolVersion;

/** The Performance Interrupt field as described by
the GICC structure in the ACPI Specification.
*/
- UINT32 PerformanceInterruptGsiv;
+ UINT32 PerformanceInterruptGsiv;

/** The CPU Parked address field as described by
the GICC structure in the ACPI Specification.
*/
- UINT64 ParkedAddress;
+ UINT64 ParkedAddress;

/** The base address for the GIC CPU Interface
as described by the GICC structure in the
ACPI Specification.
*/
- UINT64 PhysicalBaseAddress;
+ UINT64 PhysicalBaseAddress;

/** The base address for GICV interface
as described by the GICC structure in the
ACPI Specification.
*/
- UINT64 GICV;
+ UINT64 GICV;

/** The base address for GICH interface
as described by the GICC structure in the
ACPI Specification.
*/
- UINT64 GICH;
+ UINT64 GICH;

/** The GICV maintenance interrupt
as described by the GICC structure in the
ACPI Specification.
*/
- UINT32 VGICMaintenanceInterrupt;
+ UINT32 VGICMaintenanceInterrupt;

/** The base address for GICR interface
as described by the GICC structure in the
ACPI Specification.
*/
- UINT64 GICRBaseAddress;
+ UINT64 GICRBaseAddress;

/** The MPIDR for the CPU
as described by the GICC structure in the
ACPI Specification.
*/
- UINT64 MPIDR;
+ UINT64 MPIDR;

/** The Processor Power Efficiency class
as described by the GICC structure in the
ACPI Specification.
*/
- UINT8 ProcessorPowerEfficiencyClass;
+ UINT8 ProcessorPowerEfficiencyClass;

/** Statistical Profiling Extension buffer overflow GSIV. Zero if
unsupported by this processor. This field was introduced in
ACPI 6.3 (MADT revision 5) and is therefore ignored when
generating MADT revision 4 or lower.
*/
- UINT16 SpeOverflowInterrupt;
+ UINT16 SpeOverflowInterrupt;

/** The proximity domain to which the logical processor belongs.
This field is used to populate the GICC affinity structure
in the SRAT table.
*/
- UINT32 ProximityDomain;
+ UINT32 ProximityDomain;

/** The clock domain to which the logical processor belongs.
This field is used to populate the GICC affinity structure
in the SRAT table.
*/
- UINT32 ClockDomain;
+ UINT32 ClockDomain;

/** The GICC Affinity flags field as described by the GICC Affinity structure
in the SRAT table.
*/
- UINT32 AffinityFlags;
+ UINT32 AffinityFlags;
+
+ /** Optional field: Reference Token for the Cpc info of this processor.
+ Token identifying a CM_ARM_OBJ_REF structure, itself referencing
+ CM_ARM_CPC_INFO objects.
+ */
+ CM_OBJECT_TOKEN CpcToken;
} CM_ARM_GICC_INFO;

/** A structure that describes the
@@ -1070,6 +1077,113 @@ typedef struct CmArmRmrDescriptor {
UINT64 Length;
} CM_ARM_MEMORY_RANGE_DESCRIPTOR;

+/** A structure that describes the Cpc information.
+
+ Continuous Performance Control is described in DSDT/SSDT and associated
+ to cpus/clusters in the cpu topology.
+
+ Unsupported Optional registers should be encoded with NULL resource
+ Register {(SystemMemory, 0, 0, 0, 0)}
+
+ For values that support Integer or Buffer, integer will be used
+ if buffer is NULL resource.
+ If resource is not NULL then Integer must be 0
+
+ Cf. ACPI 6.4, s8.4.7.1 _CPC (Continuous Performance Control)
+
+ ID: EArmObjCpcInfo
+*/
+typedef struct CmArmCpcInfo {
+ /// The revision number of the _CPC package format.
+ UINT32 Revision;
+
+ /// Indicates the highest level of performance the processor
+ /// is theoretically capable of achieving.
+ EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE HighestPerformanceBuffer;
+ UINT32 HighestPerformanceInteger;
+
+ /// Indicates the highest sustained performance level of the processor.
+ EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE NominalPerformanceBuffer;
+ UINT32 NominalPerformanceInteger;
+
+ /// Indicates the lowest performance level of the processor with non-linear power savings.
+ EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE LowestNonlinearPerformanceBuffer;
+ UINT32 LowestNonlinearPerformanceInteger;
+
+ /// Indicates the lowest performance level of the processor..
+ EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE LowestPerformanceBuffer;
+ UINT32 LowestPerformanceInteger;
+
+ /// Guaranteed Performance Register Buffer.
+ /// Optional
+ EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE GuaranteedPerformanceRegister;
+
+ /// Desired Performance Register Buffer.
+ EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE DesiredPerformanceRegister;
+
+ /// Minimum Performance Register Buffer.
+ /// Optional
+ EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE MinimumPerformanceRegister;
+
+ /// Maximum Performance Register Buffer.
+ /// Optional
+ EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE MaximumPerformanceRegister;
+
+ /// Performance Reduction Tolerance Register.
+ /// Optional
+ EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE PerformanceReductionToleranceRegister;
+
+ /// Time Window Register.
+ /// Optional
+ EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE TimeWindowRegister;
+
+ /// Counter Wraparound Time
+ /// Optional
+ EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE CounterWraparoundTimeBuffer;
+ UINT32 CounterWraparoundTimeInteger;
+
+ /// Reference Performance Counter Register
+ EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE ReferencePerformanceCounterRegister;
+
+ /// Delivered Performance Counter Register
+ EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE DeliveredPerformanceCounterRegister;
+
+ /// Performance Limited Register
+ EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE PerformanceLimitedRegister;
+
+ /// CPPC EnableRegister
+ /// Optional
+ EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE CPPCEnableRegister;
+
+ /// Autonomous Selection Enable
+ /// Optional
+ EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE AutonomousSelectionEnableBuffer;
+ UINT32 AutonomousSelectionEnableInteger;
+
+ /// AutonomousActivity-WindowRegister
+ /// Optional
+ EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE AutonomousActivityWindowRegister;
+
+ /// EnergyPerformance-PreferenceRegister
+ /// Optional
+ EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE EnergyPerformancePreferenceRegister;
+
+ /// Reference Performance
+ /// Optional
+ EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE ReferencePerformanceBuffer;
+ UINT32 ReferencePerformanceInteger;
+
+ /// Lowest Frequency
+ /// Optional
+ EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE LowestFrequencyBuffer;
+ UINT32 LowestFrequencyInteger;
+
+ /// Nominal Frequency
+ /// Optional
+ EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE NominalFrequencyBuffer;
+ UINT32 NominalFrequencyInteger;
+} CM_ARM_CPC_INFO;
+
#pragma pack()

#endif // ARM_NAMESPACE_OBJECTS_H_
diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
index c1b21d24a4..c7e0d51397 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -423,6 +423,84 @@ STATIC CONST CM_OBJ_PARSER CmPciInterruptMapInfoParser[] = {
ARRAY_SIZE (CmArmGenericInterruptParser) },
};

+/** A parser for EArmObjCpcInfo.
+*/
+STATIC CONST CM_OBJ_PARSER CmArmCpcInfoParser[] = {
+ { "Revision", 4, "0x%llx", NULL },
+ { "HighestPerformanceBuffer", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "HighestPerformanceInteger", 4, "0x%llx", NULL },
+ { "NominalPerformanceBuffer", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "NominalPerformanceInteger", 4, "0x%llx", NULL },
+ { "LowestNonlinearPerformanceBuffer", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "LowestNonlinearPerformanceInteger", 4, "0x%llx", NULL },
+ { "LowestPerformanceBuffer", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "LowestPerformanceInteger", 4, "0x%llx", NULL },
+ { "GuaranteedPerformanceRegister", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "DesiredPerformanceRegister", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "MinimumPerformanceRegister", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "MaximumPerformanceRegister", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "PerformanceReductionToleranceRegister", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "TimeWindowRegister", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "CounterWraparoundTimeBuffer", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "CounterWraparoundTimeInteger", 4, "0x%llx", NULL },
+ { "ReferencePerformanceCounterRegister", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "DeliveredPerformanceCounterRegister", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "PerformanceLimitedRegister", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "CPPCEnableRegister", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "AutonomousSelectionEnableBuffer", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "AutonomousSelectionEnableInteger", 4, "0x%llx", NULL },
+ { "AutonomousActivityWindowRegister", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "EnergyPerformancePreferenceRegister", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "ReferencePerformanceBuffer", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "ReferencePerformanceInteger", 4, "0x%llx", NULL },
+ { "LowestFrequencyBuffer", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "LowestFrequencyInteger", 4, "0x%llx", NULL },
+ { "NominalFrequencyBuffer", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "NominalFrequencyInteger", 4, "0x%llx", NULL },
+};
+
/** A parser for Arm namespace objects.
*/
STATIC CONST CM_OBJ_PARSER_ARRAY ArmNamespaceObjectParser[] = {
@@ -501,6 +579,8 @@ STATIC CONST CM_OBJ_PARSER_ARRAY ArmNamespaceObjectParser[] = {
ARRAY_SIZE (CmArmPciAddressMapInfoParser) },
{ "EArmObjPciInterruptMapInfo", CmPciInterruptMapInfoParser,
ARRAY_SIZE (CmPciInterruptMapInfoParser) },
+ { "EArmObjCpcInfo", CmArmCpcInfoParser,
+ ARRAY_SIZE (CmArmCpcInfoParser) },
{ "EArmObjMax", NULL, 0 },
};

--
2.25.1


Re: [PATCH] Maintainers.txt: Update reviewers for IntelSiliconPkg

Ni, Ray
 

Reviewed-by: Ray Ni <ray.ni@...>

-----Original Message-----
From: S, Ashraf Ali <ashraf.ali.s@...>
Sent: Tuesday, August 23, 2022 3:25 PM
To: devel@edk2.groups.io
Cc: S, Ashraf Ali <ashraf.ali.s@...>; Ni, Ray <ray.ni@...>; Chaganty, Rangasai V
<rangasai.v.chaganty@...>; Oram, Isaac W <isaac.w.oram@...>
Subject: [PATCH] Maintainers.txt: Update reviewers for IntelSiliconPkg

Add Ashraf Ali S as IntelSiliconPkg reviewers

Signed-off-by: Ashraf Ali S <ashraf.ali.s@...>
Cc: Ray Ni <ray.ni@...>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@...>
Cc: Isaac Oram <isaac.w.oram@...>
---
Maintainers.txt | 1 +
1 file changed, 1 insertion(+)

diff --git a/Maintainers.txt b/Maintainers.txt
index 5e403ce851..e2ca67a0f2 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -277,6 +277,7 @@ F: Silicon/Intel/IntelSiliconPkg/
M: Ray Ni <ray.ni@...>
M: Rangasai V Chaganty <rangasai.v.chaganty@...>
M: Isaac Oram <isaac.w.oram@...>
+M: Ashraf Ali S <ashraf.ali.s@...>

Silicon/Intel/QuarkSocPkg
F: Silicon/Intel/QuarkSocPkg/
--
2.30.2.windows.1


Re: [PATCH v2 10/34] ShellPkg: Add LOONGARCH64 architecture for EDK2 CI.

Chao Li
 

Zhichao,
Ok, I will add all of R-B information in the V3. Thanks for reminding. :)


Thanks,
Chao
--------

On 9月 15 2022, at 4:56 下午, "Gao, Zhichao" <zhichao.gao@...> wrote:
Reviewed-by: Zhichao Gao <zhichao.gao@...>

Please add Mike's R-B. If the patches are not changed, you can keep the received R-B so the maintainers/reviewers can avoid review the same content again.

Thanks,
Zhichao

> -----Original Message-----
> From: Chao Li <lichao@...>
> Sent: Wednesday, September 14, 2022 5:36 PM
> To: devel@edk2.groups.io
> Cc: Ni, Ray <ray.ni@...>; Gao, Zhichao <zhichao.gao@...>
> Subject: [PATCH v2 10/34] ShellPkg: Add LOONGARCH64 architecture for
> EDK2 CI.
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4053
>
> Add LOONGARCH64 architecture to ShellPkg for EDK2 CI testing.
>
> Cc: Ray Ni <ray.ni@...>
> Cc: Zhichao Gao <zhichao.gao@...>
>
> Signed-off-by: Chao Li <lichao@...>
> ---
> ShellPkg/ShellPkg.dsc | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc index
> 38fde3dc71..dd0d88603f 100644
> --- a/ShellPkg/ShellPkg.dsc
> +++ b/ShellPkg/ShellPkg.dsc
> @@ -4,6 +4,7 @@
> # Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR> #
> Copyright (c) 2018 - 2020, Arm Limited. All rights reserved.<BR> # Copyright (c)
> 2020, Hewlett Packard Enterprise Development LP. All rights
> reserved.<BR>+# Copyright (c) 2022, Loongson Technology Corporation
> Limited. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-
> Patent #@@ -15,7 +16,7 @@
> PLATFORM_VERSION = 1.02 DSC_SPECIFICATION =
> 0x00010006 OUTPUT_DIRECTORY = Build/Shell-
> SUPPORTED_ARCHITECTURES = IA32|X64|EBC|ARM|AARCH64|RISCV64+
> SUPPORTED_ARCHITECTURES =
> IA32|X64|EBC|ARM|AARCH64|RISCV64|LOONGARCH64 BUILD_TARGETS
> = DEBUG|RELEASE|NOOPT SKUID_IDENTIFIER = DEFAULT --
> 2.27.0




Re: [edk2-platforms][PATCH 1/2] SbsaQemu/OemMiscLib: Update for new OemMiscLib APIs

Leif Lindholm
 

On Tue, Sep 13, 2022 at 13:17:34 +0700, Nhi Pham wrote:
This is to reflect the new APIs added to edk2/OemMiscLib library.

Signed-off-by: Nhi Pham <nhi@...>
Matching my comment on OemMiscLibNull - could you use
PcdSystemBiosRelease and PcdEmbeddedControllerFirmwareRelease here?

/
Leif

---
Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.inf | 3 ++
Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c | 42 ++++++++++++++++++++
2 files changed, 45 insertions(+)

diff --git a/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.inf b/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.inf
index 04a07a55cee9..94e368e50a3c 100644
--- a/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.inf
+++ b/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.inf
@@ -34,6 +34,9 @@ [LibraryClasses]
IoLib
PcdLib

+[Guids]
+ gZeroGuid
+
[Pcd]
gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdDeviceTreeBaseAddress

diff --git a/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c b/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c
index 326bb56bcfa3..f14c18ef0874 100644
--- a/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c
+++ b/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c
@@ -9,6 +9,7 @@
**/

#include <Uefi.h>
+#include <Guid/ZeroGuid.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/FdtHelperLib.h>
@@ -330,3 +331,44 @@ OemGetChassisNumPowerCords (
{
return 1;
}
+
+/**
+ Fetches the system UUID.
+
+ @param[out] SystemUuid The pointer to the buffer to store the System UUID.
+
+**/
+VOID
+EFIAPI
+OemGetSystemUuid (
+ OUT GUID *SystemUuid
+ )
+{
+ CopyGuid (SystemUuid, &gZeroGuid);
+}
+
+/** Fetches the BIOS release.
+
+ @return The BIOS release.
+**/
+UINT16
+EFIAPI
+OemGetBiosRelease (
+ VOID
+ )
+{
+ return 0xFFFF;
+}
+
+/** Fetches the embedded controller firmware release.
+
+ @return The embedded controller firmware release.
+**/
+UINT16
+EFIAPI
+OemGetEmbeddedControllerFirmwareRelease (
+ VOID
+ )
+{
+ return 0xFFFF;
+}
--
2.25.1


Re: [edk2-platforms][PATCH 2/2] SbsaQemu/OemMiscLib: Fix typo of "AssetTagType02"

Leif Lindholm
 

On Tue, Sep 13, 2022 at 13:17:35 +0700, Nhi Pham wrote:
This fixes the typo of AssetTagType02 according to the recent changes
from OemMiscLib.h in the edk2.

Signed-off-by: Nhi Pham <nhi@...>
Reviewed-by: Leif Lindholm <quic_llindhol@...>

---
Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c b/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c
index f14c18ef0874..a4b40bb8c6de 100644
--- a/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c
+++ b/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c
@@ -201,7 +201,7 @@ OemUpdateSmbiosInfo (
case FamilyType01:
String = (CHAR16*)PcdGetPtr (PcdSystemFamily);
break;
- case AssertTagType02:
+ case AssetTagType02:
String = (CHAR16*)PcdGetPtr (PcdBaseBoardAssetTag);
break;
case SerialNumberType02:
--
2.25.1


Re: [PATCH v3 6/6] ArmPkg/SmbiosMiscDxe: Get SMBIOS information from OemMiscLib

Leif Lindholm
 

On Tue, Sep 13, 2022 at 13:19:47 +0700, Nhi Pham wrote:
From: Minh Nguyen <minhn@...>

In some scenarios, the information of Bios Version, Bios Release
and Embedded Controller Firmware Release are fetched during UEFI
booting. This patch supports updating those fields dynamically
when the PCDs are empty.

Signed-off-by: Nhi Pham <nhi@...>
Reviewed-by: Rebecca Cran <rebecca@...>
Reviewed-by: Sami Mujawar <sami.mujawar@...>
Acked-by: Ard Biesheuvel <ardb@...>
---
ArmPkg/Include/Library/OemMiscLib.h | 21 +++++++++++++
ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c | 28 +++++++++++++++++
ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c | 32 +++++++++++++-------
3 files changed, 70 insertions(+), 11 deletions(-)

diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h
index 1936619d9b5b..541274999e5c 100644
--- a/ArmPkg/Include/Library/OemMiscLib.h
+++ b/ArmPkg/Include/Library/OemMiscLib.h
@@ -37,6 +37,7 @@ typedef struct {
} OEM_MISC_PROCESSOR_DATA;

typedef enum {
+ BiosVersionType00,
ProductNameType01,
SerialNumType01,
UuidType01,
@@ -247,4 +248,24 @@ OemGetSystemUuid (
OUT GUID *SystemUuid
);

+/** Fetches the BIOS release.
+
+ @return The BIOS release.
+**/
+UINT16
+EFIAPI
+OemGetBiosRelease (
+ VOID
+ );
+
+/** Fetches the embedded controller firmware release.
+
+ @return The embedded controller firmware release.
+**/
+UINT16
+EFIAPI
+OemGetEmbeddedControllerFirmwareRelease (
+ VOID
+ );
+
#endif // OEM_MISC_LIB_H_
diff --git a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
index 32f6d55c1a9a..788ccab9e8c1 100644
--- a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
+++ b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
@@ -254,3 +254,31 @@ OemGetSystemUuid (
ASSERT (FALSE);
CopyGuid (SystemUuid, &gZeroGuid);
}
+
+/** Fetches the BIOS release.
+
+ @return The BIOS release.
+**/
+UINT16
+EFIAPI
+OemGetBiosRelease (
+ VOID
+ )
+{
+ ASSERT (FALSE);
+ return 0xFFFF;
This is a change in behaviour.
The pre-existing behaviour would be preserved by returning the value
of PcdGet16 (PcdSystemBiosRelease), which defaults to 0xFFFF.

+}
+
+/** Fetches the embedded controller firmware release.
+
+ @return The embedded controller firmware release.
+**/
+UINT16
+EFIAPI
+OemGetEmbeddedControllerFirmwareRelease (
+ VOID
+ )
+{
+ ASSERT (FALSE);
+ return 0xFFFF;
Same as above, but PcdEmbeddedControllerFirmwareRelease.

No other comments on this set.
(Feel free to see that as Acked-by: Leif Lindholm <quic_llindhol@...>
for 1-5/6, but you already have the tags you need for those.)

/
Leif

+}
diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
index b49c4b754cab..e9106a8a2fec 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
@@ -1,5 +1,6 @@
/** @file

+ Copyright (c) 2022, Ampere Computing LLC. All rights reserved.<BR>
Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015, Hisilicon Limited. All rights reserved.<BR>
@@ -13,6 +14,7 @@
#include <Library/DebugLib.h>
#include <Library/HiiLib.h>
#include <Library/MemoryAllocationLib.h>
+#include <Library/OemMiscLib.h>
#include <Library/PrintLib.h>
#include <Library/UefiBootServicesTableLib.h>

@@ -191,11 +193,11 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) {
TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_VERSION);
HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL);
} else {
- Version = (CHAR16 *)PcdGetPtr (PcdFirmwareVersionString);
- if (StrLen (Version) > 0) {
- TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_VERSION);
- HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL);
- }
+ OemUpdateSmbiosInfo (
+ mSmbiosMiscHiiHandle,
+ STRING_TOKEN (STR_MISC_BIOS_VERSION),
+ BiosVersionType00
+ );
}

Char16String = GetBiosReleaseDate ();
@@ -251,13 +253,21 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) {
}
}

- SmbiosRecord->SystemBiosMajorRelease = (UINT8)(PcdGet16 (PcdSystemBiosRelease) >> 8);
- SmbiosRecord->SystemBiosMinorRelease = (UINT8)(PcdGet16 (PcdSystemBiosRelease) & 0xFF);
+ if (PcdGet16 (PcdSystemBiosRelease) != 0xFFFF) {
+ SmbiosRecord->SystemBiosMajorRelease = (UINT8)(PcdGet16 (PcdSystemBiosRelease) >> 8);
+ SmbiosRecord->SystemBiosMinorRelease = (UINT8)(PcdGet16 (PcdSystemBiosRelease) & 0xFF);
+ } else {
+ SmbiosRecord->SystemBiosMajorRelease = (UINT8)(OemGetBiosRelease () >> 8);
+ SmbiosRecord->SystemBiosMinorRelease = (UINT8)(OemGetBiosRelease () & 0xFF);
+ }

- SmbiosRecord->EmbeddedControllerFirmwareMajorRelease = (UINT16)
- (PcdGet16 (PcdEmbeddedControllerFirmwareRelease) >> 8);
- SmbiosRecord->EmbeddedControllerFirmwareMinorRelease = (UINT16)
- (PcdGet16 (PcdEmbeddedControllerFirmwareRelease) & 0xFF);
+ if (PcdGet16 (PcdEmbeddedControllerFirmwareRelease) != 0xFFFF) {
+ SmbiosRecord->EmbeddedControllerFirmwareMajorRelease = (UINT16)(PcdGet16 (PcdEmbeddedControllerFirmwareRelease) >> 8);
+ SmbiosRecord->EmbeddedControllerFirmwareMinorRelease = (UINT16)(PcdGet16 (PcdEmbeddedControllerFirmwareRelease) & 0xFF);
+ } else {
+ SmbiosRecord->EmbeddedControllerFirmwareMajorRelease = (UINT16)(OemGetEmbeddedControllerFirmwareRelease () >> 8);
+ SmbiosRecord->EmbeddedControllerFirmwareMinorRelease = (UINT16)(OemGetEmbeddedControllerFirmwareRelease () & 0xFF);
+ }

OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
UnicodeStrToAsciiStrS (Vendor, OptionalStrStart, VendorStrLen + 1);
--
2.25.1


Re: [edk2-platforms][PATCH V3 0/4] QemuOpenBoardPkg: Add QemuOpenBoardPkg

Leif Lindholm
 

We appear to be missing a Maintainers.txt entry for this new package.
Could someone cook one up?

/
Leif

On Wed, Sep 14, 2022 at 20:14:27 +0000, Oram, Isaac W wrote:
Series pushed as 9a7234827f..f4679715a4

-----Original Message-----
From: Kinney, Michael D <michael.d.kinney@...>
Sent: Tuesday, September 13, 2022 2:51 PM
To: Oram, Isaac W <isaac.w.oram@...>; Theo Jehl <theojehl76@...>; devel@edk2.groups.io; Kinney, Michael D <michael.d.kinney@...>
Cc: Leif Lindholm <quic_llindhol@...>; Pedro Falcato <pedro.falcato@...>; Gerd Hoffmann <kraxel@...>; Stefan Hajnoczi <stefanha@...>
Subject: RE: [edk2-devel][edk2-platforms][PATCH V3 0/4] QemuOpenBoardPkg: Add QemuOpenBoardPkg

Series Acked-by: Michael D Kinney <michael.d.kinney@...>

-----Original Message-----
From: Oram, Isaac W <isaac.w.oram@...>
Sent: Tuesday, September 13, 2022 2:46 PM
To: Theo Jehl <theojehl76@...>; devel@edk2.groups.io
Cc: Leif Lindholm <quic_llindhol@...>; Kinney, Michael D
<michael.d.kinney@...>; Pedro Falcato <pedro.falcato@...>;
Gerd Hoffmann <kraxel@...>; Stefan Hajnoczi
<stefanha@...>
Subject: RE: [edk2-devel][edk2-platforms][PATCH V3 0/4]
QemuOpenBoardPkg: Add QemuOpenBoardPkg

Series Reviewed-by: Isaac Oram <isaac.w.oram@...>

-----Original Message-----
From: Theo Jehl <theojehl76@...>
Sent: Tuesday, September 13, 2022 2:32 PM
To: devel@edk2.groups.io
Cc: Leif Lindholm <quic_llindhol@...>; Kinney, Michael D
<michael.d.kinney@...>; Oram, Isaac W <isaac.w.oram@...>;
Pedro Falcato <pedro.falcato@...>; Gerd Hoffmann
<kraxel@...>; Stefan Hajnoczi <stefanha@...>
Subject: [edk2-devel][edk2-platforms][PATCH V3 0/4] QemuOpenBoardPkg:
Add QemuOpenBoardPkg

QemuOpenBoardPkg adds a MinPlatform port to Qemu x86_64 It can boots
UEFI Linux and Windows, and works on PIIX4 and Q35 This board port provides a simple starting place for investigating edk2 and MinPlatform Arch.
Currently we implement up to stage 4 of the MinPlatform spec and can boot Windows/Linux.

V2 splits the package into several commits.
Each commit corresponding to a MinPlatform architecture stage.

The V3 removes specials characters in "Theo" from file headers.
Cleaned up whitespace, punctuation, commenting to better match coding
style and conventions Fixed Visual Studio build issue converting UINT64 to UINT32.
Fixed build issues related to sync with latest master.

Cc: Leif Lindholm <quic_llindhol@...>
Cc: Michael D Kinney <michael.d.kinney@...>
Cc: Isaac Oram <isaac.w.oram@...>
Cc: Pedro Falcato <pedro.falcato@...>
Cc: Gerd Hoffmann <kraxel@...>
Cc: Stefan Hajnoczi <stefanha@...>

Signed-off-by: Theo Jehl <theojehl76@...>

Theo Jehl (4):
QemuOpenBoardPkg: Add QemuOpenBoardPkg
QemuOpenBoardPkg: Enable stage 2
QemuOpenBoardPkg: Enable stage 3
QemuOpenBoardPkg: Enable stage 4

.../QemuOpenBoardPkg/QemuOpenBoardPkg.dec | 33 ++
.../Include/Dsc/Stage1.dsc.inc | 55 +++
.../Include/Dsc/Stage2.dsc.inc | 31 ++
.../Include/Dsc/Stage3.dsc.inc | 101 ++++++
.../Include/Dsc/Stage4.dsc.inc | 56 +++
.../QemuOpenBoardPkg/QemuOpenBoardPkg.dsc | 169 +++++++++
.../QemuOpenBoardPkg/QemuOpenBoardPkg.fdf | 328 ++++++++++++++++++
.../BoardBootManagerLib.inf | 39 +++
.../Library/BoardInitLib/BoardInitLib.inf | 29 ++
.../Library/PeiReportFvLib/PeiReportFvLib.inf | 63 ++++ .../Library/PlatformSecLib/PlatformSecLib.inf | 49 +++
.../QemuOpenFwCfgLib/QemuOpenFwCfgLib.inf | 23 ++
.../PlatformInitPei/PlatformInitPei.inf | 59 ++++
.../Include/Library/QemuOpenFwCfgLib.h | 105 ++++++
.../PlatformInitPei/PlatformInit.h | 59 ++++
.../BoardBootManagerLib/BoardBootManager.c | 105 ++++++
.../Library/BoardInitLib/BoardInitLib.c | 231 ++++++++++++
.../Library/PeiReportFvLib/PeiReportFvLib.c | 285 +++++++++++++++
.../Library/PlatformSecLib/PlatformSecLib.c | 140 ++++++++
.../QemuOpenFwCfgLib/QemuOpenFwCfgLib.c | 136 ++++++++
.../QemuOpenBoardPkg/PlatformInitPei/Cpu.c | 64 ++++
.../QemuOpenBoardPkg/PlatformInitPei/Memory.c | 254 ++++++++++++++
.../QemuOpenBoardPkg/PlatformInitPei/Pci.c | 70 ++++
.../QemuOpenBoardPkg/PlatformInitPei/Pcie.c | 106 ++++++
.../PlatformInitPei/PlatformInit.c | 75 ++++
.../Include/Fdf/FlashMap.fdf.inc | 94 +++++
.../Library/PlatformSecLib/Ia32/SecEntry.nasm | 117 +++++++
Platform/Qemu/QemuOpenBoardPkg/README.md | 53 +++
28 files changed, 2929 insertions(+)
create mode 100644
Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.dec
create mode 100644
Platform/Qemu/QemuOpenBoardPkg/Include/Dsc/Stage1.dsc.inc
create mode 100644
Platform/Qemu/QemuOpenBoardPkg/Include/Dsc/Stage2.dsc.inc
create mode 100644
Platform/Qemu/QemuOpenBoardPkg/Include/Dsc/Stage3.dsc.inc
create mode 100644
Platform/Qemu/QemuOpenBoardPkg/Include/Dsc/Stage4.dsc.inc
create mode 100644
Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.dsc
create mode 100644
Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.fdf
create mode 100644
Platform/Qemu/QemuOpenBoardPkg/Library/BoardBootManagerLib/BoardBootMa
nagerLib.inf create mode 100644
Platform/Qemu/QemuOpenBoardPkg/Library/BoardInitLib/BoardInitLib.inf
create mode 100644
Platform/Qemu/QemuOpenBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.i
nf create mode 100644
Platform/Qemu/QemuOpenBoardPkg/Library/PlatformSecLib/PlatformSecLib.i
nf create mode 100644
Platform/Qemu/QemuOpenBoardPkg/Library/QemuOpenFwCfgLib/QemuOpenFwCfgL
ib.inf create mode 100644
Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/PlatformInitPei.inf
create mode 100644
Platform/Qemu/QemuOpenBoardPkg/Include/Library/QemuOpenFwCfgLib.h
create mode 100644
Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/PlatformInit.h
create mode 100644
Platform/Qemu/QemuOpenBoardPkg/Library/BoardBootManagerLib/BoardBootMa
nager.c create mode 100644
Platform/Qemu/QemuOpenBoardPkg/Library/BoardInitLib/BoardInitLib.c
create mode 100644
Platform/Qemu/QemuOpenBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.c
create mode 100644
Platform/Qemu/QemuOpenBoardPkg/Library/PlatformSecLib/PlatformSecLib.c
create mode 100644
Platform/Qemu/QemuOpenBoardPkg/Library/QemuOpenFwCfgLib/QemuOpenFwCfgL
ib.c create mode 100644
Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/Cpu.c
create mode 100644
Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/Memory.c
create mode 100644
Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/Pci.c
create mode 100644
Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/Pcie.c
create mode 100644
Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/PlatformInit.c
create mode 100644
Platform/Qemu/QemuOpenBoardPkg/Include/Fdf/FlashMap.fdf.inc
create mode 100644
Platform/Qemu/QemuOpenBoardPkg/Library/PlatformSecLib/Ia32/SecEntry.na
sm create mode 100644 Platform/Qemu/QemuOpenBoardPkg/README.md

--
2.37.0 (Apple Git-136)


Re: [PATCH EDK2 v1 1/1] CryptoPkg/BaseCryptLib:Remove redundant init

Xiaoyu Lu
 

Reviewed-by: Xiaoyu Lu <xiaoyu1.lu@...>

-----Original Message-----
From: Wenyi Xie <xiewenyi2@...>
Sent: Thursday, September 15, 2022 5:26 PM
To: devel@edk2.groups.io; Yao, Jiewen <jiewen.yao@...>; Wang, Jian J <jian.j.wang@...>; Lu, Xiaoyu1 <xiaoyu1.lu@...>; Jiang, Guomin <guomin.jiang@...>
Cc: songdongkuang@...; xiewenyi2@...
Subject: [PATCH EDK2 v1 1/1] CryptoPkg/BaseCryptLib:Remove redundant init

CertCtx is used to be defined as a struct and ZeroMem is called to init this struct. But now CertCtx is defined as a point, so use ZeroMem (&CertCtx, sizeof (CertCtx)) is not correct any more.

Cc: Jiewen Yao <jiewen.yao@...>
Cc: Jian J Wang <jian.j.wang@...>
Cc: Xiaoyu Lu <xiaoyu1.lu@...>
Cc: Guomin Jiang <guomin.jiang@...>
Signed-off-by: Wenyi Xie <xiewenyi2@...>
---
CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyCommon.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyCommon.c b/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyCommon.c
index 3336d2f60a6a..f8028181e47f 100644
--- a/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyCommon.c
+++ b/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyCommon.c
@@ -502,8 +502,6 @@ Pkcs7GetCertificatesList (
OldBuf = NULL;
Signers = NULL;

- ZeroMem (&CertCtx, sizeof (CertCtx));
-
//
// Parameter Checking
//
--
2.20.1.windows.1


[PATCH EDK2 v1 1/1] CryptoPkg/BaseCryptLib:Remove redundant init

wenyi,xie
 

CertCtx is used to be defined as a struct and ZeroMem is called to
init this struct. But now CertCtx is defined as a point, so use
ZeroMem (&CertCtx, sizeof (CertCtx)) is not correct any more.

Cc: Jiewen Yao <jiewen.yao@...>
Cc: Jian J Wang <jian.j.wang@...>
Cc: Xiaoyu Lu <xiaoyu1.lu@...>
Cc: Guomin Jiang <guomin.jiang@...>
Signed-off-by: Wenyi Xie <xiewenyi2@...>
---
CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyCommon.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyCommon.c b/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyCommon.c
index 3336d2f60a6a..f8028181e47f 100644
--- a/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyCommon.c
+++ b/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyCommon.c
@@ -502,8 +502,6 @@ Pkcs7GetCertificatesList (
OldBuf = NULL;
Signers = NULL;

- ZeroMem (&CertCtx, sizeof (CertCtx));
-
//
// Parameter Checking
//
--
2.20.1.windows.1


[PATCH EDK2 v1 0/1] CryptoPkg/BaseCryptLib:Remove redundant init

wenyi,xie
 

Main Changes :
1.Remove redundant memory init.

Wenyi Xie (1):
CryptoPkg/BaseCryptLib:Remove redundant init

CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyCommon.c | 2 --
1 file changed, 2 deletions(-)

--
2.20.1.windows.1


Re: [PATCH v2 30/34] MdeModulePkg/Logo: Add LoongArch64 architecture.

Gao, Zhichao
 

Reviewed-by: Zhichao Gao <zhichao.gao@...>

Thanks,
Zhichao

-----Original Message-----
From: Chao Li <lichao@...>
Sent: Wednesday, September 14, 2022 5:42 PM
To: devel@edk2.groups.io
Cc: Gao, Zhichao <zhichao.gao@...>; Ni, Ray <ray.ni@...>
Subject: [PATCH v2 30/34] MdeModulePkg/Logo: Add LoongArch64
architecture.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4053

Add LoongArch64 architecture to the Logo.

Cc: Zhichao Gao <zhichao.gao@...>
Cc: Ray Ni <ray.ni@...>

Signed-off-by: Chao Li <lichao@...>
---
MdeModulePkg/Logo/Logo.inf | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Logo/Logo.inf b/MdeModulePkg/Logo/Logo.inf
index 70a66cae98..294482ccdc 100644
--- a/MdeModulePkg/Logo/Logo.inf
+++ b/MdeModulePkg/Logo/Logo.inf
@@ -3,6 +3,7 @@
# # Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> #
Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights
reserved.<BR>+# Copyright (c) 2022, Loongson Technology Corporation
Limited. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-
Patent@@ -21,7 +22,7 @@
# # The following information is for reference only and not required by the
build tools. #-# VALID_ARCHITECTURES = IA32 X64 EBC ARM AARCH64
RISCV64+# VALID_ARCHITECTURES = IA32 X64 EBC ARM AARCH64
RISCV64 LOONGARCH64 # [Binaries]--
2.27.0


Re: [PATCH v2 10/34] ShellPkg: Add LOONGARCH64 architecture for EDK2 CI.

Gao, Zhichao
 

Reviewed-by: Zhichao Gao <zhichao.gao@...>

Please add Mike's R-B. If the patches are not changed, you can keep the received R-B so the maintainers/reviewers can avoid review the same content again.

Thanks,
Zhichao

-----Original Message-----
From: Chao Li <lichao@...>
Sent: Wednesday, September 14, 2022 5:36 PM
To: devel@edk2.groups.io
Cc: Ni, Ray <ray.ni@...>; Gao, Zhichao <zhichao.gao@...>
Subject: [PATCH v2 10/34] ShellPkg: Add LOONGARCH64 architecture for
EDK2 CI.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4053

Add LOONGARCH64 architecture to ShellPkg for EDK2 CI testing.

Cc: Ray Ni <ray.ni@...>
Cc: Zhichao Gao <zhichao.gao@...>

Signed-off-by: Chao Li <lichao@...>
---
ShellPkg/ShellPkg.dsc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc index
38fde3dc71..dd0d88603f 100644
--- a/ShellPkg/ShellPkg.dsc
+++ b/ShellPkg/ShellPkg.dsc
@@ -4,6 +4,7 @@
# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR> #
Copyright (c) 2018 - 2020, Arm Limited. All rights reserved.<BR> # Copyright (c)
2020, Hewlett Packard Enterprise Development LP. All rights
reserved.<BR>+# Copyright (c) 2022, Loongson Technology Corporation
Limited. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-
Patent #@@ -15,7 +16,7 @@
PLATFORM_VERSION = 1.02 DSC_SPECIFICATION =
0x00010006 OUTPUT_DIRECTORY = Build/Shell-
SUPPORTED_ARCHITECTURES = IA32|X64|EBC|ARM|AARCH64|RISCV64+
SUPPORTED_ARCHITECTURES =
IA32|X64|EBC|ARM|AARCH64|RISCV64|LOONGARCH64 BUILD_TARGETS
= DEBUG|RELEASE|NOOPT SKUID_IDENTIFIER = DEFAULT --
2.27.0


[PATCH] Maintainers.txt: Update email address

Nickle Wang
 

Update Nickle's email address from csie.io to nvidia.com for those
packages which are reviewed by Nickle. Per suggestion from Abner,
change Nickle from reviewer to maintainer for RedfishPkg.

Cc: Andrew Fish <afish@...>
Cc: Leif Lindholm <quic_llindhol@...>
Cc: Michael D Kinney <michael.d.kinney@...>
Cc: Abner Chang <abner.chang@...>
Signed-off-by: Nickle Wang <nicklew@...>
---
Maintainers.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Maintainers.txt b/Maintainers.txt
index 73ce13126b..390f084c03 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -197,7 +197,7 @@ S: Maintained
EmulatorPkg: Redfish-related modules
F: EmulatorPkg/*Redfish*
M: Abner Chang <abner.chang@...> [changab]
-R: Nickle Wang <nickle@...> [nicklela]
+M: Nickle Wang <nicklew@...> [nicklela]

FatPkg
F: FatPkg/
@@ -544,7 +544,7 @@ R: Ankit Sinha <ankit.sinha@...> [ankit13s]
RedfishPkg: Redfish related modules
F: RedfishPkg/
M: Abner Chang <abner.chang@...> [changab]
-R: Nickle Wang <nickle@...> [nicklela]
+M: Nickle Wang <nicklew@...> [nicklela]

SecurityPkg
F: SecurityPkg/
--
2.34.1


Re: [PATCH v2 2/3] DynamicTablesPkg: AML Code generation to add _CPC entries

PierreGondois
 

Hello Jeff,
This patch looks good to me:
Reviewed-by: Pierre Gondois <pierre.gondois@...>

On 9/14/22 23:34, Jeff Brasen wrote:
_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@...>
---
.../Include/Library/AmlLib/AmlLib.h | 156 +++++
.../Common/AmlLib/CodeGen/AmlCodeGen.c | 543 ++++++++++++++++++
2 files changed, 699 insertions(+)
diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
index 39968660f2..3fafa6b0e8 100644
--- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
+++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
@@ -1336,6 +1336,162 @@ AmlAddNameIntegerPackage (
IN AML_OBJECT_NODE_HANDLE PackageNode
);
+/** Create a _CPC node.
+
+ Creates and optionally adds the following node
+ Name(_CPC, Package()
+ {
+ NumEntries, // Integer
+ Revision, // Integer
+ HighestPerformance, // Integer or Buffer (Resource Descriptor)
+ NominalPerformance, // Integer or Buffer (Resource Descriptor)
+ LowestNonlinearPerformance, // Integer or Buffer (Resource Descriptor)
+ LowestPerformance, // Integer or Buffer (Resource Descriptor)
+ GuaranteedPerformanceRegister, // Buffer (Resource Descriptor)
+ DesiredPerformanceRegister , // Buffer (Resource Descriptor)
+ MinimumPerformanceRegister , // Buffer (Resource Descriptor)
+ MaximumPerformanceRegister , // Buffer (Resource Descriptor)
+ PerformanceReductionToleranceRegister, // Buffer (Resource Descriptor)
+ TimeWindowRegister, // Buffer (Resource Descriptor)
+ CounterWraparoundTime, // Integer or Buffer (Resource Descriptor)
+ ReferencePerformanceCounterRegister, // Buffer (Resource Descriptor)
+ DeliveredPerformanceCounterRegister, // Buffer (Resource Descriptor)
+ PerformanceLimitedRegister, // Buffer (Resource Descriptor)
+ CPPCEnableRegister // Buffer (Resource Descriptor)
+ AutonomousSelectionEnable, // Integer or Buffer (Resource Descriptor)
+ AutonomousActivityWindowRegister, // Buffer (Resource Descriptor)
+ EnergyPerformancePreferenceRegister, // Buffer (Resource Descriptor)
+ ReferencePerformance // Integer or Buffer (Resource Descriptor)
+ LowestFrequency, // Integer or Buffer (Resource Descriptor)
+ NominalFrequency // Integer or Buffer (Resource Descriptor)
+ })
+
+ If resource buffer is NULL then integer will be used.
+
+ Cf. ACPI 6.4, s8.4.7.1 _CPC (Continuous Performance Control)
+
+ @ingroup CodeGenApis
+
+ @param [in] HighestPerformanceBuffer If provided, buffer that indicates the highest level
+ of performance the processor.
+ @param [in] HighestPerformanceInteger Indicates the highest level of performance the processor,
+ used if buffer is NULL.
+ @param [in] NominalPerformanceBuffer If provided buffer that indicates the highest sustained
+ performance level of the processor.
+ @param [in] NominalPerformanceInteger Indicates the highest sustained performance level
+ of the processor, used if buffer is NULL.
+ @param [in] LowestNonlinearPerformanceBuffer If provided, buffer that indicates the lowest performance level
+ of the processor with non-linear power savings.
+ @param [in] LowestNonlinearPerformanceInteger Indicates the lowest performance level of the processor with
+ non-linear power savings, used if buffer is NULL.
+ @param [in] LowestPerformanceBuffer If provided, buffer that indicates the
+ lowest performance level of the processor.
+ @param [in] LowestPerformanceInteger Indicates the lowest performance level of the processor,
+ used if buffer is NULL.
+ @param [in] GuaranteedPerformanceRegister If provided, Guaranteed Performance Register Buffer.
+ @param [in] DesiredPerformanceRegister If provided, Desired Performance Register Buffer.
+ @param [in] MinimumPerformanceRegister If provided, Minimum Performance Register Buffer.
+ @param [in] MaximumPerformanceRegister If provided, Maximum Performance Register Buffer.
+ @param [in] PerformanceReductionToleranceRegister If provided, Performance Reduction Tolerance Register.
+ @param [in] TimeWindowRegister If provided, Time Window Register.
+ @param [in] CounterWraparoundTimeBuffer If provided, Counter Wraparound Time buffer.
+ @param [in] CounterWraparoundTimeInteger Counter Wraparound Time, used if buffer is NULL.
+ @param [in] ReferencePerformanceCounterRegister Reference Performance Counter Register.
+ @param [in] DeliveredPerformanceCounterRegister Delivered Performance Counter Register.
+ @param [in] PerformanceLimitedRegister Performance Limited Register.
+ @param [in] CPPCEnableRegister If provided, CPPC EnableRegister.
+ @param [in] AutonomousSelectionEnableBuffer If provided, Autonomous Selection Enable buffer.
+ @param [in] AutonomousSelectionEnableInteger Autonomous Selection Enable, used if buffer is NULL.
+ @param [in] AutonomousActivityWindowRegister If provided, AutonomousActivity-WindowRegister.
+ @param [in] EnergyPerformancePreferenceRegister If provided, EnergyPerformance-PreferenceRegister.
+ @param [in] ReferencePerformanceBuffer If provided, Reference Performance buffer.
+ @param [in] ReferencePerformanceInteger Reference Performance, used if buffer is NULL.
+ @param [in] LowestFrequencyBuffer If provided, Lowest Frequency buffer.
+ @param [in] LowestFrequencyInteger Lowest Frequency, used if buffer is NULL.
+ @param [in] NominalFrequencyBuffer If provided, NominalFrequencyBuffer buffer.
+ @param [in] NominalFrequencyInteger NominalFrequencyBuffer, used if buffer is NULL.
+ @param [in] ParentNode If provided, set ParentNode as the parent
+ of the node created.
+ @param [out] NewCpcNode If success and provided, contains the created node.
+
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_INVALID_PARAMETER Invalid parameter.
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
+**/
+EFI_STATUS
+EFIAPI
+AmlCreateCpcNode (
+ /// The revision number of the _CPC package format.
+ IN UINT32 Revision,
+ /// Indicates the highest level of performance the processor
+ /// is theoretically capable of achieving.
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *HighestPerformanceBuffer OPTIONAL,
+ IN UINT32 HighestPerformanceInteger,
+ /// Indicates the highest sustained performance level of the processor.
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *NominalPerformanceBuffer OPTIONAL,
+ IN UINT32 NominalPerformanceInteger,
+ /// Indicates the lowest performance level of the processor with non-linear power savings.
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *LowestNonlinearPerformanceBuffer OPTIONAL,
+ IN UINT32 LowestNonlinearPerformanceInteger,
+ /// Indicates the lowest performance level of the processor..
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *LowestPerformanceBuffer OPTIONAL,
+ IN UINT32 LowestPerformanceInteger,
+ /// Guaranteed Performance Register Buffer.
+ /// Optional
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *GuaranteedPerformanceRegister OPTIONAL,
+ /// Desired Performance Register Buffer.
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *DesiredPerformanceRegister,
+ /// Minimum Performance Register Buffer.
+ /// Optional
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *MinimumPerformanceRegister OPTIONAL,
+ /// Maximum Performance Register Buffer.
+ /// Optional
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *MaximumPerformanceRegister OPTIONAL,
+ /// Performance Reduction Tolerance Register.
+ /// Optional
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *PerformanceReductionToleranceRegister OPTIONAL,
+ /// Time Window Register.
+ /// Optional
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *TimeWindowRegister OPTIONAL,
+ /// Counter Wraparound Time
+ /// Optional
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *CounterWraparoundTimeBuffer OPTIONAL,
+ IN UINT32 CounterWraparoundTimeInteger,
+ /// Reference Performance Counter Register
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *ReferencePerformanceCounterRegister,
+ /// Delivered Performance Counter Register
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *DeliveredPerformanceCounterRegister,
+ /// Performance Limited Register
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *PerformanceLimitedRegister,
+ /// CPPC EnableRegister
+ /// Optional
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *CPPCEnableRegister OPTIONAL,
+ /// Autonomous Selection Enable
+ /// Optional
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *AutonomousSelectionEnableBuffer OPTIONAL,
+ IN UINT32 AutonomousSelectionEnableInteger,
+ /// AutonomousActivity-WindowRegister
+ /// Optional
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *AutonomousActivityWindowRegister OPTIONAL,
+ /// EnergyPerformance-PreferenceRegister
+ /// Optional
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *EnergyPerformancePreferenceRegister OPTIONAL,
+ /// Reference Performance
+ /// Optional
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *ReferencePerformanceBuffer OPTIONAL,
+ IN UINT32 ReferencePerformanceInteger,
+ /// Lowest Frequency
+ /// Optional
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *LowestFrequencyBuffer OPTIONAL,
+ IN UINT32 LowestFrequencyInteger,
+ /// Nominal Frequency
+ /// Optional
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *NominalFrequencyBuffer OPTIONAL,
+ IN UINT32 NominalFrequencyInteger,
+ IN AML_NODE_HANDLE ParentNode OPTIONAL,
+ OUT AML_OBJECT_NODE_HANDLE *NewCpcNode OPTIONAL
+ );
+
// DEPRECATED APIS
#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
index 5fb39d077b..42f0d0002c 100644
--- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
+++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
@@ -2850,3 +2850,546 @@ error_handler:
return Status;
}
+
+/** Adds a register to the package
+
+ @ingroup CodeGenApis
+
+ @param [in] Register If provided, register that will be added to package.
+ otherwise NULL register will be added
+ @param [in] PackageNode Package to add value to
+
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_INVALID_PARAMETER Invalid parameter.
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+AmlAddRegisterToPackage (
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *Register OPTIONAL,
+ IN AML_OBJECT_NODE_HANDLE PackageNode
+ )
+{
+ EFI_STATUS Status;
+ AML_DATA_NODE_HANDLE RdNode;
+ AML_OBJECT_NODE_HANDLE ResourceTemplateNode;
+
+ RdNode = NULL;
+
+ Status = AmlCodeGenResourceTemplate (&ResourceTemplateNode);
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ return Status;
+ }
+
+ if (Register != NULL) {
+ Status = AmlCodeGenRdRegister (
+ Register->AddressSpaceId,
+ Register->RegisterBitWidth,
+ Register->RegisterBitOffset,
+ Register->Address,
+ Register->AccessSize,
+ NULL,
+ &RdNode
+ );
+ } else {
+ Status = AmlCodeGenRdRegister (
+ EFI_ACPI_6_4_SYSTEM_MEMORY,
+ 0,
+ 0,
+ 0,
+ 0,
+ NULL,
+ &RdNode
+ );
+ }
+
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ goto error_handler;
+ }
+
+ Status = AmlAppendRdNode (ResourceTemplateNode, RdNode);
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ goto error_handler;
+ }
+
+ RdNode = NULL;
+
+ Status = AmlVarListAddTail (
+ (AML_NODE_HANDLE)PackageNode,
+ (AML_NODE_HANDLE)ResourceTemplateNode
+ );
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ goto error_handler;
+ }
+
+ return Status;
+
+error_handler:
+ if (RdNode != NULL) {
+ AmlDeleteTree ((AML_NODE_HANDLE)RdNode);
+ }
+
+ if (ResourceTemplateNode != NULL) {
+ AmlDeleteTree ((AML_NODE_HANDLE)ResourceTemplateNode);
+ }
+
+ return Status;
+}
+
+/** Adds an integer or register to the package
+
+ @ingroup CodeGenApis
+
+ @param [in] Register If provided, register that will be added to package
+ @param [in] Integer If Register is NULL, integer that will be added to the package
+ @param [in] PackageNode Package to add value to
+
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_INVALID_PARAMETER Invalid parameter.
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+AmlAddRegisterOrIntegerToPackage (
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *Register OPTIONAL,
+ IN UINT32 Integer,
+ IN AML_OBJECT_NODE_HANDLE PackageNode
+ )
+{
+ EFI_STATUS Status;
+ AML_OBJECT_NODE_HANDLE IntegerNode;
+
+ IntegerNode = NULL;
+
+ if (Register != NULL) {
+ Status = AmlAddRegisterToPackage (Register, PackageNode);
+ } else {
+ Status = AmlCodeGenInteger (Integer, &IntegerNode);
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ return Status;
+ }
+
+ Status = AmlVarListAddTail (
+ (AML_NODE_HANDLE)PackageNode,
+ (AML_NODE_HANDLE)IntegerNode
+ );
+ }
+
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ if (IntegerNode != NULL) {
+ AmlDeleteTree ((AML_NODE_HANDLE)IntegerNode);
+ }
+ }
+
+ return Status;
+}
+
+/** Create a _CPC node.
+
+ Creates and optionally adds the following node
+ Name(_CPC, Package()
+ {
+ NumEntries, // Integer
+ Revision, // Integer
+ HighestPerformance, // Integer or Buffer (Resource Descriptor)
+ NominalPerformance, // Integer or Buffer (Resource Descriptor)
+ LowestNonlinearPerformance, // Integer or Buffer (Resource Descriptor)
+ LowestPerformance, // Integer or Buffer (Resource Descriptor)
+ GuaranteedPerformanceRegister, // Buffer (Resource Descriptor)
+ DesiredPerformanceRegister , // Buffer (Resource Descriptor)
+ MinimumPerformanceRegister , // Buffer (Resource Descriptor)
+ MaximumPerformanceRegister , // Buffer (Resource Descriptor)
+ PerformanceReductionToleranceRegister, // Buffer (Resource Descriptor)
+ TimeWindowRegister, // Buffer (Resource Descriptor)
+ CounterWraparoundTime, // Integer or Buffer (Resource Descriptor)
+ ReferencePerformanceCounterRegister, // Buffer (Resource Descriptor)
+ DeliveredPerformanceCounterRegister, // Buffer (Resource Descriptor)
+ PerformanceLimitedRegister, // Buffer (Resource Descriptor)
+ CPPCEnableRegister // Buffer (Resource Descriptor)
+ AutonomousSelectionEnable, // Integer or Buffer (Resource Descriptor)
+ AutonomousActivityWindowRegister, // Buffer (Resource Descriptor)
+ EnergyPerformancePreferenceRegister, // Buffer (Resource Descriptor)
+ ReferencePerformance // Integer or Buffer (Resource Descriptor)
+ LowestFrequency, // Integer or Buffer (Resource Descriptor)
+ NominalFrequency // Integer or Buffer (Resource Descriptor)
+ })
+
+ If resource buffer is NULL then integer will be used.
+
+ Cf. ACPI 6.4, s8.4.7.1 _CPC (Continuous Performance Control)
+
+ @ingroup CodeGenApis
+
+ @param [in] HighestPerformanceBuffer If provided, buffer that indicates the highest level
+ of performance the processor.
+ @param [in] HighestPerformanceInteger Indicates the highest level of performance the processor,
+ used if buffer is NULL.
+ @param [in] NominalPerformanceBuffer If provided buffer that indicates the highest sustained
+ performance level of the processor.
+ @param [in] NominalPerformanceInteger Indicates the highest sustained performance level
+ of the processor, used if buffer is NULL.
+ @param [in] LowestNonlinearPerformanceBuffer If provided, buffer that indicates the lowest performance level
+ of the processor with non-linear power savings.
+ @param [in] LowestNonlinearPerformanceInteger Indicates the lowest performance level of the processor with
+ non-linear power savings, used if buffer is NULL.
+ @param [in] LowestPerformanceBuffer If provided, buffer that indicates the
+ lowest performance level of the processor.
+ @param [in] LowestPerformanceInteger Indicates the lowest performance level of the processor,
+ used if buffer is NULL.
+ @param [in] GuaranteedPerformanceRegister If provided, Guaranteed Performance Register Buffer.
+ @param [in] DesiredPerformanceRegister If provided, Desired Performance Register Buffer.
+ @param [in] MinimumPerformanceRegister If provided, Minimum Performance Register Buffer.
+ @param [in] MaximumPerformanceRegister If provided, Maximum Performance Register Buffer.
+ @param [in] PerformanceReductionToleranceRegister If provided, Performance Reduction Tolerance Register.
+ @param [in] TimeWindowRegister If provided, Time Window Register.
+ @param [in] CounterWraparoundTimeBuffer If provided, Counter Wraparound Time buffer.
+ @param [in] CounterWraparoundTimeInteger Counter Wraparound Time, used if buffer is NULL.
+ @param [in] ReferencePerformanceCounterRegister Reference Performance Counter Register.
+ @param [in] DeliveredPerformanceCounterRegister Delivered Performance Counter Register.
+ @param [in] PerformanceLimitedRegister Performance Limited Register.
+ @param [in] CPPCEnableRegister If provided, CPPC EnableRegister.
+ @param [in] AutonomousSelectionEnableBuffer If provided, Autonomous Selection Enable buffer.
+ @param [in] AutonomousSelectionEnableInteger Autonomous Selection Enable, used if buffer is NULL.
+ @param [in] AutonomousActivityWindowRegister If provided, AutonomousActivity-WindowRegister.
+ @param [in] EnergyPerformancePreferenceRegister If provided, EnergyPerformance-PreferenceRegister.
+ @param [in] ReferencePerformanceBuffer If provided, Reference Performance buffer.
+ @param [in] ReferencePerformanceInteger Reference Performance, used if buffer is NULL.
+ @param [in] LowestFrequencyBuffer If provided, Lowest Frequency buffer.
+ @param [in] LowestFrequencyInteger Lowest Frequency, used if buffer is NULL.
+ @param [in] NominalFrequencyBuffer If provided, NominalFrequencyBuffer buffer.
+ @param [in] NominalFrequencyInteger NominalFrequencyBuffer, used if buffer is NULL.
+ @param [in] ParentNode If provided, set ParentNode as the parent
+ of the node created.
+ @param [out] NewCpcNode If success and provided, contains the created node.
+
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_INVALID_PARAMETER Invalid parameter.
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
+**/
+EFI_STATUS
+EFIAPI
+AmlCreateCpcNode (
+ /// The revision number of the _CPC package format.
+ IN UINT32 Revision,
+ /// Indicates the highest level of performance the processor
+ /// is theoretically capable of achieving.
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *HighestPerformanceBuffer OPTIONAL,
+ IN UINT32 HighestPerformanceInteger,
+ /// Indicates the highest sustained performance level of the processor.
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *NominalPerformanceBuffer OPTIONAL,
+ IN UINT32 NominalPerformanceInteger,
+ /// Indicates the lowest performance level of the processor with non-linear power savings.
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *LowestNonlinearPerformanceBuffer OPTIONAL,
+ IN UINT32 LowestNonlinearPerformanceInteger,
+ /// Indicates the lowest performance level of the processor..
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *LowestPerformanceBuffer OPTIONAL,
+ IN UINT32 LowestPerformanceInteger,
+ /// Guaranteed Performance Register Buffer.
+ /// Optional
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *GuaranteedPerformanceRegister OPTIONAL,
+ /// Desired Performance Register Buffer.
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *DesiredPerformanceRegister,
+ /// Minimum Performance Register Buffer.
+ /// Optional
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *MinimumPerformanceRegister OPTIONAL,
+ /// Maximum Performance Register Buffer.
+ /// Optional
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *MaximumPerformanceRegister OPTIONAL,
+ /// Performance Reduction Tolerance Register.
+ /// Optional
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *PerformanceReductionToleranceRegister OPTIONAL,
+ /// Time Window Register.
+ /// Optional
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *TimeWindowRegister OPTIONAL,
+ /// Counter Wraparound Time
+ /// Optional
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *CounterWraparoundTimeBuffer OPTIONAL,
+ IN UINT32 CounterWraparoundTimeInteger,
+ /// Reference Performance Counter Register
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *ReferencePerformanceCounterRegister,
+ /// Delivered Performance Counter Register
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *DeliveredPerformanceCounterRegister,
+ /// Performance Limited Register
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *PerformanceLimitedRegister,
+ /// CPPC EnableRegister
+ /// Optional
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *CPPCEnableRegister OPTIONAL,
+ /// Autonomous Selection Enable
+ /// Optional
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *AutonomousSelectionEnableBuffer OPTIONAL,
+ IN UINT32 AutonomousSelectionEnableInteger,
+ /// AutonomousActivity-WindowRegister
+ /// Optional
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *AutonomousActivityWindowRegister OPTIONAL,
+ /// EnergyPerformance-PreferenceRegister
+ /// Optional
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *EnergyPerformancePreferenceRegister OPTIONAL,
+ /// Reference Performance
+ /// Optional
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *ReferencePerformanceBuffer OPTIONAL,
+ IN UINT32 ReferencePerformanceInteger,
+ /// Lowest Frequency
+ /// Optional
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *LowestFrequencyBuffer OPTIONAL,
+ IN UINT32 LowestFrequencyInteger,
+ /// Nominal Frequency
+ /// Optional
+ IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *NominalFrequencyBuffer OPTIONAL,
+ IN UINT32 NominalFrequencyInteger,
+ IN AML_NODE_HANDLE ParentNode OPTIONAL,
+ OUT AML_OBJECT_NODE_HANDLE *NewCpcNode OPTIONAL
+ )
+{
+ EFI_STATUS Status;
+ AML_OBJECT_NODE_HANDLE CpcNode;
+ AML_OBJECT_NODE_HANDLE CpcPackage;
+ UINT32 NumberOfEntries;
+
+ // Revision 3 per ACPI 6.4 specification
+ if (Revision == 3) {
+ // NumEntries 23 per ACPI 6.4 specification
+ NumberOfEntries = 23;
+ } else {
+ ASSERT (0);
+ return EFI_INVALID_PARAMETER;
+ }
+
+ if (((HighestPerformanceBuffer == NULL) && (HighestPerformanceInteger == 0)) ||
+ ((NominalPerformanceBuffer == NULL) && (NominalPerformanceInteger == 0)) ||
+ ((LowestNonlinearPerformanceBuffer == NULL) && (LowestNonlinearPerformanceInteger == 0)) ||
+ ((LowestPerformanceBuffer == NULL) && (LowestPerformanceInteger == 0)) ||
+ (DesiredPerformanceRegister == NULL) ||
+ (ReferencePerformanceCounterRegister == NULL) ||
+ (DeliveredPerformanceCounterRegister == NULL) ||
+ (PerformanceLimitedRegister == NULL) ||
+ ((ParentNode == NULL) && (NewCpcNode == NULL)))
+ {
+ ASSERT (0);
+ return EFI_INVALID_PARAMETER;
+ }
+
+ CpcPackage = NULL;
+
+ Status = AmlCodeGenNamePackage ("_CPC", NULL, &CpcNode);
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ return Status;
+ }
+
+ // Get the Package object node of the _CPC node,
+ // which is the 2nd fixed argument (i.e. index 1).
+ CpcPackage = (AML_OBJECT_NODE_HANDLE)AmlGetFixedArgument (
+ CpcNode,
+ EAmlParseIndexTerm1
+ );
+ if ((CpcPackage == NULL) ||
+ (AmlGetNodeType ((AML_NODE_HANDLE)CpcPackage) != EAmlNodeObject) ||
+ (!AmlNodeHasOpCode (CpcPackage, AML_PACKAGE_OP, 0)))
+ {
+ ASSERT (0);
+ Status = EFI_INVALID_PARAMETER;
+ goto error_handler;
+ }
+
+ Status = AmlAddRegisterOrIntegerToPackage (
+ NULL,
+ NumberOfEntries,
+ CpcPackage
+ );
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ goto error_handler;
+ }
+
+ Status = AmlAddRegisterOrIntegerToPackage (
+ NULL,
+ Revision,
+ CpcPackage
+ );
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ goto error_handler;
+ }
+
+ Status = AmlAddRegisterOrIntegerToPackage (
+ HighestPerformanceBuffer,
+ HighestPerformanceInteger,
+ CpcPackage
+ );
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ goto error_handler;
+ }
+
+ Status = AmlAddRegisterOrIntegerToPackage (
+ NominalPerformanceBuffer,
+ NominalPerformanceInteger,
+ CpcPackage
+ );
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ goto error_handler;
+ }
+
+ Status = AmlAddRegisterOrIntegerToPackage (
+ LowestNonlinearPerformanceBuffer,
+ LowestNonlinearPerformanceInteger,
+ CpcPackage
+ );
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ goto error_handler;
+ }
+
+ Status = AmlAddRegisterOrIntegerToPackage (
+ LowestPerformanceBuffer,
+ LowestPerformanceInteger,
+ CpcPackage
+ );
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ goto error_handler;
+ }
+
+ Status = AmlAddRegisterToPackage (GuaranteedPerformanceRegister, CpcPackage);
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ goto error_handler;
+ }
+
+ Status = AmlAddRegisterToPackage (DesiredPerformanceRegister, CpcPackage);
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ goto error_handler;
+ }
+
+ Status = AmlAddRegisterToPackage (MinimumPerformanceRegister, CpcPackage);
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ goto error_handler;
+ }
+
+ Status = AmlAddRegisterToPackage (MaximumPerformanceRegister, CpcPackage);
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ goto error_handler;
+ }
+
+ Status = AmlAddRegisterToPackage (PerformanceReductionToleranceRegister, CpcPackage);
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ goto error_handler;
+ }
+
+ Status = AmlAddRegisterToPackage (TimeWindowRegister, CpcPackage);
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ goto error_handler;
+ }
+
+ Status = AmlAddRegisterOrIntegerToPackage (
+ CounterWraparoundTimeBuffer,
+ CounterWraparoundTimeInteger,
+ CpcPackage
+ );
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ goto error_handler;
+ }
+
+ Status = AmlAddRegisterToPackage (ReferencePerformanceCounterRegister, CpcPackage);
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ goto error_handler;
+ }
+
+ Status = AmlAddRegisterToPackage (DeliveredPerformanceCounterRegister, CpcPackage);
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ goto error_handler;
+ }
+
+ Status = AmlAddRegisterToPackage (PerformanceLimitedRegister, CpcPackage);
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ goto error_handler;
+ }
+
+ Status = AmlAddRegisterToPackage (CPPCEnableRegister, CpcPackage);
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ goto error_handler;
+ }
+
+ Status = AmlAddRegisterOrIntegerToPackage (
+ AutonomousSelectionEnableBuffer,
+ AutonomousSelectionEnableInteger,
+ CpcPackage
+ );
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ goto error_handler;
+ }
+
+ Status = AmlAddRegisterToPackage (AutonomousActivityWindowRegister, CpcPackage);
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ goto error_handler;
+ }
+
+ Status = AmlAddRegisterToPackage (EnergyPerformancePreferenceRegister, CpcPackage);
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ goto error_handler;
+ }
+
+ Status = AmlAddRegisterOrIntegerToPackage (
+ ReferencePerformanceBuffer,
+ ReferencePerformanceInteger,
+ CpcPackage
+ );
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ goto error_handler;
+ }
+
+ Status = AmlAddRegisterOrIntegerToPackage (
+ LowestFrequencyBuffer,
+ LowestFrequencyInteger,
+ CpcPackage
+ );
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ goto error_handler;
+ }
+
+ Status = AmlAddRegisterOrIntegerToPackage (
+ NominalFrequencyBuffer,
+ NominalFrequencyInteger,
+ CpcPackage
+ );
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ goto error_handler;
+ }
+
+ Status = LinkNode (CpcNode, ParentNode, NewCpcNode);
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ goto error_handler;
+ }
+
+ return Status;
+
+error_handler:
+ AmlDeleteTree ((AML_NODE_HANDLE)CpcNode);
+ return Status;
+}


Re: [PATCH v2 3/3] DynamicTablesPkg: SSDT CPU _CPC generator

PierreGondois
 

Hello Jeff,
Just one remark:

On 9/14/22 23:34, Jeff Brasen wrote:
Add code to use a token attached to GICC to generate _CPC object on cpus.
Signed-off-by: Jeff Brasen <jbrasen@...>
---
.../SsdtCpuTopologyGenerator.c | 223 +++++++++++++++++-
1 file changed, 217 insertions(+), 6 deletions(-)
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
index 8561f48e1f..56741e7b58 100644
[snip]

@@ -934,10 +1134,11 @@ CreateTopologyFromGicC (
IN AML_OBJECT_NODE_HANDLE ScopeNode
)
{
- EFI_STATUS Status;
- CM_ARM_GICC_INFO *GicCInfo;
- UINT32 GicCInfoCount;
- UINT32 Index;
+ EFI_STATUS Status;
+ CM_ARM_GICC_INFO *GicCInfo;
+ UINT32 GicCInfoCount;
+ UINT32 Index;
+ AML_OBJECT_NODE_HANDLE CpuNode;
ASSERT (Generator != NULL);
ASSERT (CfgMgrProtocol != NULL);
@@ -961,12 +1162,22 @@ CreateTopologyFromGicC (
ScopeNode,
&GicCInfo[Index],
Index,
- NULL
+ &CpuNode
);
if (EFI_ERROR (Status)) {
ASSERT (0);
break;
}
+
+ // If a CPC info is associated with the
+ // GicCinfo, create an _CPC method returning them.
+ if (GicCInfo->CpcToken != CM_NULL_TOKEN) {
+ Status = CreateAmlCpcNode (Generator, CfgMgrProtocol, &GicCInfo[Index], CpuNode);
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ return Status;
Could it be replaced with a 'break' just to be consistent in the loop ?

+ }
+ }
} // for
return Status;


Re: [PATCH v2 1/3] DynamicTablesPkg: Add CM_ARM_CPC_INFO object

PierreGondois
 

Hello Jeff,
Just one remark:

On 9/14/22 23:34, Jeff Brasen wrote:
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@...>
---
.../Include/ArmNameSpaceObjects.h | 148 ++++++++++++++++--
.../ConfigurationManagerObjectParser.c | 79 ++++++++++
2 files changed, 210 insertions(+), 17 deletions(-)
[snip]

diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
index c1b21d24a4..e2c608443b 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -423,6 +423,83 @@ STATIC CONST CM_OBJ_PARSER CmPciInterruptMapInfoParser[] = {
ARRAY_SIZE (CmArmGenericInterruptParser) },
};
+/** A parser for EArmObjCpcInfo.
+*/
+STATIC CONST CM_OBJ_PARSER CmArmCpcInfoParser[] = {
+ { "HighestPerformanceBuffer", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
Could it be move to 6_4 aswell ?

+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "HighestPerformanceInteger", 4, "0x%llx", NULL },
+ { "NominalPerformanceBuffer", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "NominalPerformanceInteger", 4, "0x%llx", NULL },
+ { "LowestNonlinearPerformanceBuffer", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "LowestNonlinearPerformanceInteger", 4, "0x%llx", NULL },
+ { "LowestPerformanceBuffer", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "LowestPerformanceInteger", 4, "0x%llx", NULL },
+ { "GuaranteedPerformanceRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "DesiredPerformanceRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "MinimumPerformanceRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "MaximumPerformanceRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "PerformanceReductionToleranceRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "TimeWindowRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "CounterWraparoundTimeBuffer", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "CounterWraparoundTimeInteger", 4, "0x%llx", NULL },
+ { "ReferencePerformanceCounterRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "DeliveredPerformanceCounterRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "PerformanceLimitedRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "CPPCEnableRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "AutonomousSelectionEnableBuffer", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "AutonomousSelectionEnableInteger", 4, "0x%llx", NULL },
+ { "AutonomousActivityWindowRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "EnergyPerformancePreferenceRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "ReferencePerformanceBuffer", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "ReferencePerformanceInteger", 4, "0x%llx", NULL },
+ { "LowestFrequencyBuffer", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "LowestFrequencyInteger", 4, "0x%llx", NULL },
+ { "NominalFrequencyBuffer", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
+ NULL, NULL, AcpiGenericAddressParser,
+ ARRAY_SIZE (AcpiGenericAddressParser) },
+ { "NominalFrequencyInteger", 4, "0x%llx", NULL },
+};
+
/** A parser for Arm namespace objects.
*/
STATIC CONST CM_OBJ_PARSER_ARRAY ArmNamespaceObjectParser[] = {
@@ -501,6 +578,8 @@ STATIC CONST CM_OBJ_PARSER_ARRAY ArmNamespaceObjectParser[] = {
ARRAY_SIZE (CmArmPciAddressMapInfoParser) },
{ "EArmObjPciInterruptMapInfo", CmPciInterruptMapInfoParser,
ARRAY_SIZE (CmPciInterruptMapInfoParser) },
+ { "EArmObjCpcInfo", CmArmCpcInfoParser,
+ ARRAY_SIZE (CmArmCpcInfoParser) },
{ "EArmObjMax", NULL, 0 },
};


Re: 回复: edk2-devel] [PATCH v2 34/34] BaseTools: Add LoongArch64 binding.

Chao Li
 

Liming,
Ok, in V3, I will put this patch together with BaseTools changes.


Thanks,
Chao
--------

On 9月 15 2022, at 2:34 下午, "gaoliming" <gaoliming@...> wrote:
Chao:
This change should be placed together with other changes in BaseTools. I
mean their commits can be placed together.

The code change is good to me. Reviewed-by: Liming Gao <gaoliming@byosoft.
com.cn>

Thanks
Liming
> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Chao Li
> 发送时间: 2022年9月14日 17:43
> 收件人: devel@edk2.groups.io
> 抄送: Bob Feng <bob.c.feng@...>; Liming Gao
> <gaoliming@...>; Yuwei Chen <yuwei.chen@...>; Baoqi
> Zhang <zhangbaoqi@...>
> 主题: [edk2-devel] [PATCH v2 34/34] BaseTools: Add LoongArch64 binding.
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4053
>
> Add LoongArch64 ProcessorBin.h and add LoongArch to Makefiles.
>
> Cc: Bob Feng <bob.c.feng@...>
> Cc: Liming Gao <gaoliming@...>
> Cc: Yuwei Chen <yuwei.chen@...>
>
> Signed-off-by: Chao Li <lichao@...>
> Co-authored-by: Baoqi Zhang <zhangbaoqi@...>
> ---
> BaseTools/Source/C/GNUmakefile | 3 +
> .../C/Include/LoongArch64/ProcessorBind.h | 80
> +++++++++++++++++++
> 2 files changed, 83 insertions(+)
> create mode 100644
> BaseTools/Source/C/Include/LoongArch64/ProcessorBind.h
>
> diff --git a/BaseTools/Source/C/GNUmakefile
> b/BaseTools/Source/C/GNUmakefile
> index 8c191e0c38..5275f657ef 100644
> --- a/BaseTools/Source/C/GNUmakefile
> +++ b/BaseTools/Source/C/GNUmakefile
> @@ -29,6 +29,9 @@ ifndef HOST_ARCH
> ifneq (,$(findstring riscv64,$(uname_m)))
>
> HOST_ARCH=RISCV64
>
> endif
>
> + ifneq (,$(findstring loongarch64,$(uname_m)))
>
> + HOST_ARCH=LOONGARCH64
>
> + endif
>
> ifndef HOST_ARCH
>
> $(info Could not detected HOST_ARCH from uname results)
>
> $(error HOST_ARCH is not defined!)
>
> diff --git a/BaseTools/Source/C/Include/LoongArch64/ProcessorBind.h
> b/BaseTools/Source/C/Include/LoongArch64/ProcessorBind.h
> new file mode 100644
> index 0000000000..0267859dee
> --- /dev/null
> +++ b/BaseTools/Source/C/Include/LoongArch64/ProcessorBind.h
> @@ -0,0 +1,80 @@
> +/** @file
>
> + Processor or Compiler specific defines and types for LoongArch
>
> +
>
> + Copyright (c) 2022, Loongson Technology Corporation Limited. All rights
> reserved.<BR>
>
> +
>
> + SPDX-License-Identifier: BSD-2-Clause-Patent
>
> +
>
> +**/
>
> +#ifndef PROCESSOR_BIND_H_
>
> +#define PROCESSOR_BIND_H_
>
> +
>
> +//
>
> +// Define the processor type so other code can make processor based
> choices
>
> +//
>
> +#define MDE_CPU_LOONGARCH64
>
> +
>
> +#define EFIAPI
>
> +
>
> +//
>
> +// Make sure we are using the correct packing rules per EFI specification
>
> +//
>
> +#ifndef __GNUC__
>
> +#pragma pack()
>
> +#endif
>
> +
>
> +//
>
> +// Use ANSI C 2000 stdint.h integer width declarations
>
> +//
>
> +#include <stdint.h>
>
> +typedef uint8_t BOOLEAN;
>
> +typedef int8_t INT8;
>
> +typedef uint8_t UINT8;
>
> +typedef int16_t INT16;
>
> +typedef uint16_t UINT16;
>
> +typedef int32_t INT32;
>
> +typedef uint32_t UINT32;
>
> +typedef int64_t INT64;
>
> +typedef uint64_t UINT64;
>
> +typedef char CHAR8;
>
> +typedef uint16_t CHAR16;
>
> +
>
> +//
>
> +// Unsigned value of native width. (4 bytes on supported 32-bit
processor
> instructions,
>
> +// 8 bytes on supported 64-bit processor instructions)
>
> +//
>
> +typedef UINT64 UINTN;
>
> +
>
> +//
>
> +// Signed value of native width. (4 bytes on supported 32-bit processor
> instructions,
>
> +// 8 bytes on supported 64-bit processor instructions)
>
> +//
>
> +typedef INT64 INTN;
>
> +
>
> +//
>
> +// Processor specific defines
>
> +//
>
> +
>
> +//
>
> +// A value of native width with the highest bit set.
>
> +//
>
> +#define MAX_BIT 0x8000000000000000ULL
>
> +//
>
> +// A value of native width with the two highest bits set.
>
> +//
>
> +#define MAX_2_BITS 0xC000000000000000ULL
>
> +
>
> +#if defined (__GNUC__)
>
> +//
>
> +// For GNU assembly code, .global or .globl can declare global symbols.
>
> +// Define this macro to unify the usage.
>
> +//
>
> +#define ASM_GLOBAL .globl
>
> +#endif
>
> +
>
> +//
>
> +// The stack alignment required for LoongArch
>
> +//
>
> +#define CPU_STACK_ALIGNMENT 16
>
> +
>
> +#endif
>
> --
> 2.27.0
>
>
>
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#93776): https://edk2.groups.io/g/devel/message/93776
> Mute This Topic: https://groups.io/mt/93674251/4905953
> Group Owner: devel+owner@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub
> [gaoliming@...]
> -=-=-=-=-=-=
>






Re: 回复: PATCH v2 17/34] BaseTools: BaseTools changes for LoongArch platform.

Chao Li
 

Liming,
Ok, I will change the commit title in the V3.


Thanks,
Chao
--------

On 9月 15 2022, at 2:30 下午, "gaoliming" <gaoliming@...> wrote:
Chao:
This change is to update BaseTools build tool to support new LoongArch.
Please update commit message title.

The code change is good to me. Reviewed-by: Liming Gao
<gaoliming@...>

Thanks
Liming
> -----邮件原件-----
> 发件人: Chao Li <lichao@...>
> 发送时间: 2022年9月14日 17:41
> 收件人: devel@edk2.groups.io
> 抄送: Bob Feng <bob.c.feng@...>; Liming Gao
> <gaoliming@...>; Yuwei Chen <yuwei.chen@...>; Baoqi
> Zhang <zhangbaoqi@...>
> 主题: [PATCH v2 17/34] BaseTools: BaseTools changes for LoongArch
> platform.
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4053
>
> Python code changes for building EDK2 LoongArch platform.
>
> Cc: Bob Feng <bob.c.feng@...>
> Cc: Liming Gao <gaoliming@...>
> Cc: Yuwei Chen <yuwei.chen@...>
>
> Signed-off-by: Chao Li <lichao@...>
> Co-authored-by: Baoqi Zhang <zhangbaoqi@...>
> ---
> BaseTools/Source/Python/Common/DataType.py | 21
> ++++++++++++++--
> .../Source/Python/UPT/Library/DataType.py | 24
> ++++++++++++++++++-
> BaseTools/Source/Python/build/buildoptions.py | 3 ++-
> 3 files changed, 44 insertions(+), 4 deletions(-)
>
> diff --git a/BaseTools/Source/Python/Common/DataType.py
> b/BaseTools/Source/Python/Common/DataType.py
> index dc49623333..48dbf16495 100644
> --- a/BaseTools/Source/Python/Common/DataType.py
> +++ b/BaseTools/Source/Python/Common/DataType.py
> @@ -4,6 +4,7 @@
> # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
>
> # Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
>
> # Portions Copyright (c) 2020, Hewlett Packard Enterprise Development LP.
> All rights reserved.<BR>
>
> +# Portions Copyright (c) 2022, Loongson Technology Corporation Limited.
All
> rights reserved.<BR>
>
> # SPDX-License-Identifier: BSD-2-Clause-Patent
>
>
>
> ##
>
> @@ -52,10 +53,10 @@ TAB_ARCH_X64 = 'X64'
> TAB_ARCH_ARM = 'ARM'
>
> TAB_ARCH_EBC = 'EBC'
>
> TAB_ARCH_AARCH64 = 'AARCH64'
>
> -
>
> TAB_ARCH_RISCV64 = 'RISCV64'
>
> +TAB_ARCH_LOONGARCH64 = 'LOONGARCH64'
>
>
>
> -ARCH_SET_FULL = {TAB_ARCH_IA32, TAB_ARCH_X64, TAB_ARCH_ARM,
> TAB_ARCH_EBC, TAB_ARCH_AARCH64, TAB_ARCH_RISCV64,
> TAB_ARCH_COMMON}
>
> +ARCH_SET_FULL = {TAB_ARCH_IA32, TAB_ARCH_X64, TAB_ARCH_ARM,
> TAB_ARCH_EBC, TAB_ARCH_AARCH64, TAB_ARCH_RISCV64,
> TAB_ARCH_LOONGARCH64, TAB_ARCH_COMMON}
>
>
>
> SUP_MODULE_BASE = 'BASE'
>
> SUP_MODULE_SEC = 'SEC'
>
> @@ -138,6 +139,7 @@ TAB_SOURCES_X64 = TAB_SOURCES + TAB_SPLIT +
> TAB_ARCH_X64
> TAB_SOURCES_ARM = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_ARM
>
> TAB_SOURCES_EBC = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_EBC
>
> TAB_SOURCES_AARCH64 = TAB_SOURCES + TAB_SPLIT +
> TAB_ARCH_AARCH64
>
> +TAB_SOURCES_LOONGARCH64 = TAB_SOURCES + TAB_SPLIT +
> TAB_ARCH_LOONGARCH64
>
>
>
> TAB_BINARIES = 'Binaries'
>
> TAB_BINARIES_COMMON = TAB_BINARIES + TAB_SPLIT +
> TAB_ARCH_COMMON
>
> @@ -146,6 +148,7 @@ TAB_BINARIES_X64 = TAB_BINARIES + TAB_SPLIT +
> TAB_ARCH_X64
> TAB_BINARIES_ARM = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_ARM
>
> TAB_BINARIES_EBC = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_EBC
>
> TAB_BINARIES_AARCH64 = TAB_BINARIES + TAB_SPLIT +
> TAB_ARCH_AARCH64
>
> +TAB_BINARIES_LOONGARCH64 = TAB_BINARIES + TAB_SPLIT +
> TAB_ARCH_LOONGARCH64
>
>
>
> TAB_INCLUDES = 'Includes'
>
> TAB_INCLUDES_COMMON = TAB_INCLUDES + TAB_SPLIT +
> TAB_ARCH_COMMON
>
> @@ -154,6 +157,7 @@ TAB_INCLUDES_X64 = TAB_INCLUDES + TAB_SPLIT +
> TAB_ARCH_X64
> TAB_INCLUDES_ARM = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_ARM
>
> TAB_INCLUDES_EBC = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_EBC
>
> TAB_INCLUDES_AARCH64 = TAB_INCLUDES + TAB_SPLIT +
> TAB_ARCH_AARCH64
>
> +TAB_INCLUDES_LOONGARCH64 = TAB_INCLUDES + TAB_SPLIT +
> TAB_ARCH_LOONGARCH64
>
>
>
> TAB_GUIDS = 'Guids'
>
> TAB_GUIDS_COMMON = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_COMMON
>
> @@ -162,6 +166,7 @@ TAB_GUIDS_X64 = TAB_GUIDS + TAB_SPLIT +
> TAB_ARCH_X64
> TAB_GUIDS_ARM = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_ARM
>
> TAB_GUIDS_EBC = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_EBC
>
> TAB_GUIDS_AARCH64 = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_AARCH64
>
> +TAB_GUIDS_LOONGARCH64 = TAB_GUIDS + TAB_SPLIT +
> TAB_ARCH_LOONGARCH64
>
>
>
> TAB_PROTOCOLS = 'Protocols'
>
> TAB_PROTOCOLS_COMMON = TAB_PROTOCOLS + TAB_SPLIT +
> TAB_ARCH_COMMON
>
> @@ -170,6 +175,7 @@ TAB_PROTOCOLS_X64 = TAB_PROTOCOLS +
> TAB_SPLIT + TAB_ARCH_X64
> TAB_PROTOCOLS_ARM = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_ARM
>
> TAB_PROTOCOLS_EBC = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_EBC
>
> TAB_PROTOCOLS_AARCH64 = TAB_PROTOCOLS + TAB_SPLIT +
> TAB_ARCH_AARCH64
>
> +TAB_PROTOCOLS_LOONGARCH64 = TAB_PROTOCOLS + TAB_SPLIT +
> TAB_ARCH_LOONGARCH64
>
>
>
> TAB_PPIS = 'Ppis'
>
> TAB_PPIS_COMMON = TAB_PPIS + TAB_SPLIT + TAB_ARCH_COMMON
>
> @@ -178,6 +184,7 @@ TAB_PPIS_X64 = TAB_PPIS + TAB_SPLIT +
> TAB_ARCH_X64
> TAB_PPIS_ARM = TAB_PPIS + TAB_SPLIT + TAB_ARCH_ARM
>
> TAB_PPIS_EBC = TAB_PPIS + TAB_SPLIT + TAB_ARCH_EBC
>
> TAB_PPIS_AARCH64 = TAB_PPIS + TAB_SPLIT + TAB_ARCH_AARCH64
>
> +TAB_PPIS_LOONGARCH64 = TAB_PPIS + TAB_SPLIT +
> TAB_ARCH_LOONGARCH64
>
>
>
> TAB_LIBRARY_CLASSES = 'LibraryClasses'
>
> TAB_LIBRARY_CLASSES_COMMON = TAB_LIBRARY_CLASSES + TAB_SPLIT +
> TAB_ARCH_COMMON
>
> @@ -186,6 +193,7 @@ TAB_LIBRARY_CLASSES_X64 =
> TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_X64
> TAB_LIBRARY_CLASSES_ARM = TAB_LIBRARY_CLASSES + TAB_SPLIT +
> TAB_ARCH_ARM
>
> TAB_LIBRARY_CLASSES_EBC = TAB_LIBRARY_CLASSES + TAB_SPLIT +
> TAB_ARCH_EBC
>
> TAB_LIBRARY_CLASSES_AARCH64 = TAB_LIBRARY_CLASSES + TAB_SPLIT +
> TAB_ARCH_AARCH64
>
> +TAB_LIBRARY_CLASSES_LOONGARCH64 = TAB_LIBRARY_CLASSES +
> TAB_SPLIT + TAB_ARCH_LOONGARCH64
>
>
>
> TAB_PACKAGES = 'Packages'
>
> TAB_PACKAGES_COMMON = TAB_PACKAGES + TAB_SPLIT +
> TAB_ARCH_COMMON
>
> @@ -194,6 +202,7 @@ TAB_PACKAGES_X64 = TAB_PACKAGES + TAB_SPLIT +
> TAB_ARCH_X64
> TAB_PACKAGES_ARM = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_ARM
>
> TAB_PACKAGES_EBC = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_EBC
>
> TAB_PACKAGES_AARCH64 = TAB_PACKAGES + TAB_SPLIT +
> TAB_ARCH_AARCH64
>
> +TAB_PACKAGES_LOONGARCH64 = TAB_PACKAGES + TAB_SPLIT +
> TAB_ARCH_LOONGARCH64
>
>
>
> TAB_PCDS = 'Pcds'
>
> TAB_PCDS_FIXED_AT_BUILD = 'FixedAtBuild'
>
> @@ -221,6 +230,7 @@ TAB_PCDS_FIXED_AT_BUILD_X64 = TAB_PCDS +
> TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + T
> TAB_PCDS_FIXED_AT_BUILD_ARM = TAB_PCDS +
> TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_ARM
>
> TAB_PCDS_FIXED_AT_BUILD_EBC = TAB_PCDS +
> TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_EBC
>
> TAB_PCDS_FIXED_AT_BUILD_AARCH64 = TAB_PCDS +
> TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_AARCH64
>
> +TAB_PCDS_FIXED_AT_BUILD_LOONGARCH64 = TAB_PCDS +
> TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_LOONGARCH64
>
>
>
> TAB_PCDS_PATCHABLE_IN_MODULE_NULL = TAB_PCDS +
> TAB_PCDS_PATCHABLE_IN_MODULE
>
> TAB_PCDS_PATCHABLE_IN_MODULE_COMMON = TAB_PCDS +
> TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_COMMON
>
> @@ -229,6 +239,7 @@ TAB_PCDS_PATCHABLE_IN_MODULE_X64 =
> TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + TAB
> TAB_PCDS_PATCHABLE_IN_MODULE_ARM = TAB_PCDS +
> TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_ARM
>
> TAB_PCDS_PATCHABLE_IN_MODULE_EBC = TAB_PCDS +
> TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_EBC
>
> TAB_PCDS_PATCHABLE_IN_MODULE_AARCH64 = TAB_PCDS +
> TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_AARCH64
>
> +TAB_PCDS_PATCHABLE_IN_MODULE_LOONGARCH64 = TAB_PCDS +
> TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT +
> TAB_ARCH_LOONGARCH64
>
>
>
> TAB_PCDS_FEATURE_FLAG_NULL = TAB_PCDS + TAB_PCDS_FEATURE_FLAG
>
> TAB_PCDS_FEATURE_FLAG_COMMON = TAB_PCDS +
> TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_COMMON
>
> @@ -237,6 +248,7 @@ TAB_PCDS_FEATURE_FLAG_X64 = TAB_PCDS +
> TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_A
> TAB_PCDS_FEATURE_FLAG_ARM = TAB_PCDS + TAB_PCDS_FEATURE_FLAG
> + TAB_SPLIT + TAB_ARCH_ARM
>
> TAB_PCDS_FEATURE_FLAG_EBC = TAB_PCDS + TAB_PCDS_FEATURE_FLAG +
> TAB_SPLIT + TAB_ARCH_EBC
>
> TAB_PCDS_FEATURE_FLAG_AARCH64 = TAB_PCDS +
> TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_AARCH64
>
> +TAB_PCDS_FEATURE_FLAG_LOONGARCH64 = TAB_PCDS +
> TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_LOONGARCH64
>
>
>
> TAB_PCDS_DYNAMIC_EX_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_EX
>
> TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL = TAB_PCDS +
> TAB_PCDS_DYNAMIC_EX_DEFAULT
>
> @@ -248,6 +260,7 @@ TAB_PCDS_DYNAMIC_EX_X64 = TAB_PCDS +
> TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_
> TAB_PCDS_DYNAMIC_EX_ARM = TAB_PCDS + TAB_PCDS_DYNAMIC_EX +
> TAB_SPLIT + TAB_ARCH_ARM
>
> TAB_PCDS_DYNAMIC_EX_EBC = TAB_PCDS + TAB_PCDS_DYNAMIC_EX +
> TAB_SPLIT + TAB_ARCH_EBC
>
> TAB_PCDS_DYNAMIC_EX_AARCH64 = TAB_PCDS + TAB_PCDS_DYNAMIC_EX
> + TAB_SPLIT + TAB_ARCH_AARCH64
>
> +TAB_PCDS_DYNAMIC_EX_LOONGARCH64 = TAB_PCDS +
> TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_LOONGARCH64
>
>
>
> TAB_PCDS_DYNAMIC_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC
>
> TAB_PCDS_DYNAMIC_DEFAULT_NULL = TAB_PCDS +
> TAB_PCDS_DYNAMIC_DEFAULT
>
> @@ -259,6 +272,7 @@ TAB_PCDS_DYNAMIC_X64 = TAB_PCDS +
> TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_X64
> TAB_PCDS_DYNAMIC_ARM = TAB_PCDS + TAB_PCDS_DYNAMIC +
> TAB_SPLIT + TAB_ARCH_ARM
>
> TAB_PCDS_DYNAMIC_EBC = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT
> + TAB_ARCH_EBC
>
> TAB_PCDS_DYNAMIC_AARCH64 = TAB_PCDS + TAB_PCDS_DYNAMIC +
> TAB_SPLIT + TAB_ARCH_AARCH64
>
> +TAB_PCDS_DYNAMIC_LOONGARCH64 = TAB_PCDS + TAB_PCDS_DYNAMIC
> + TAB_SPLIT + TAB_ARCH_LOONGARCH64
>
>
>
> TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_PEI_PAGE_SIZE =
> 'PcdLoadFixAddressPeiCodePageNumber'
>
> TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_PEI_PAGE_SIZE_DATA_TYPE =
> 'UINT32'
>
> @@ -285,6 +299,7 @@ TAB_DEPEX_X64 = TAB_DEPEX + TAB_SPLIT +
> TAB_ARCH_X64
> TAB_DEPEX_ARM = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_ARM
>
> TAB_DEPEX_EBC = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_EBC
>
> TAB_DEPEX_AARCH64 = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_AARCH64
>
> +TAB_DEPEX_LOONGARCH64 = TAB_DEPEX + TAB_SPLIT +
> TAB_ARCH_LOONGARCH64
>
>
>
> TAB_SKUIDS = 'SkuIds'
>
> TAB_DEFAULT_STORES = 'DefaultStores'
>
> @@ -297,6 +312,7 @@ TAB_LIBRARIES_X64 = TAB_LIBRARIES + TAB_SPLIT +
> TAB_ARCH_X64
> TAB_LIBRARIES_ARM = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_ARM
>
> TAB_LIBRARIES_EBC = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_EBC
>
> TAB_LIBRARIES_AARCH64 = TAB_LIBRARIES + TAB_SPLIT +
> TAB_ARCH_AARCH64
>
> +TAB_LIBRARIES_LOONGARCH64 = TAB_LIBRARIES + TAB_SPLIT +
> TAB_ARCH_LOONGARCH64
>
>
>
> TAB_COMPONENTS = 'Components'
>
> TAB_COMPONENTS_COMMON = TAB_COMPONENTS + TAB_SPLIT +
> TAB_ARCH_COMMON
>
> @@ -305,6 +321,7 @@ TAB_COMPONENTS_X64 = TAB_COMPONENTS +
> TAB_SPLIT + TAB_ARCH_X64
> TAB_COMPONENTS_ARM = TAB_COMPONENTS + TAB_SPLIT +
> TAB_ARCH_ARM
>
> TAB_COMPONENTS_EBC = TAB_COMPONENTS + TAB_SPLIT +
> TAB_ARCH_EBC
>
> TAB_COMPONENTS_AARCH64 = TAB_COMPONENTS + TAB_SPLIT +
> TAB_ARCH_AARCH64
>
> +TAB_COMPONENTS_LOONGARCH64 = TAB_COMPONENTS + TAB_SPLIT +
> TAB_ARCH_LOONGARCH64
>
>
>
> TAB_BUILD_OPTIONS = 'BuildOptions'
>
>
>
> diff --git a/BaseTools/Source/Python/UPT/Library/DataType.py
> b/BaseTools/Source/Python/UPT/Library/DataType.py
> index 2033149aa6..0e47f35670 100644
> --- a/BaseTools/Source/Python/UPT/Library/DataType.py
> +++ b/BaseTools/Source/Python/UPT/Library/DataType.py
> @@ -2,6 +2,7 @@
> # This file is used to define class for data type structure
>
> #
>
> # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
>
> +# Portions Copyright (c) 2022, Loongson Technology Corporation Limited.
All
> rights reserved.
>
> #
>
> # SPDX-License-Identifier: BSD-2-Clause-Patent
>
>
>
> @@ -367,10 +368,11 @@ TAB_ARCH_IA32 = 'IA32'
> TAB_ARCH_X64 = 'X64'
>
> TAB_ARCH_IPF = 'IPF'
>
> TAB_ARCH_ARM = 'ARM'
>
> +TAB_ARCH_LOONGARCH64 = 'LOONGARCH64'
>
> TAB_ARCH_EBC = 'EBC'
>
>
>
> ARCH_LIST = \
>
> -[TAB_ARCH_IA32, TAB_ARCH_X64, TAB_ARCH_IPF, TAB_ARCH_ARM,
> TAB_ARCH_EBC]
>
> +[TAB_ARCH_IA32, TAB_ARCH_X64, TAB_ARCH_IPF, TAB_ARCH_ARM,
> TAB_ARCH_LOONGARCH64, TAB_ARCH_EBC]
>
>
>
> SUP_MODULE_BASE = 'BASE'
>
> SUP_MODULE_SEC = 'SEC'
>
> @@ -454,6 +456,7 @@ TAB_SOURCES_IA32 = TAB_SOURCES + TAB_SPLIT +
> TAB_ARCH_IA32
> TAB_SOURCES_X64 = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_X64
>
> TAB_SOURCES_IPF = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_IPF
>
> TAB_SOURCES_ARM = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_ARM
>
> +TAB_SOURCES_LOONGARCH64 = TAB_SOURCES + TAB_SPLIT +
> TAB_ARCH_LOONGARCH64
>
> TAB_SOURCES_EBC = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_EBC
>
>
>
> TAB_BINARIES = 'Binaries'
>
> @@ -462,6 +465,7 @@ TAB_BINARIES_IA32 = TAB_BINARIES + TAB_SPLIT +
> TAB_ARCH_IA32
> TAB_BINARIES_X64 = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_X64
>
> TAB_BINARIES_IPF = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_IPF
>
> TAB_BINARIES_ARM = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_ARM
>
> +TAB_BINARIES_LOONGARCH64 = TAB_BINARIES + TAB_SPLIT +
> TAB_ARCH_LOONGARCH64
>
> TAB_BINARIES_EBC = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_EBC
>
>
>
> TAB_INCLUDES = 'Includes'
>
> @@ -470,6 +474,7 @@ TAB_INCLUDES_IA32 = TAB_INCLUDES + TAB_SPLIT +
> TAB_ARCH_IA32
> TAB_INCLUDES_X64 = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_X64
>
> TAB_INCLUDES_IPF = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_IPF
>
> TAB_INCLUDES_ARM = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_ARM
>
> +TAB_INCLUDES_LOONGARCH64 = TAB_INCLUDES + TAB_SPLIT +
> TAB_ARCH_LOONGARCH64
>
> TAB_INCLUDES_EBC = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_EBC
>
>
>
> TAB_GUIDS = 'Guids'
>
> @@ -478,6 +483,7 @@ TAB_GUIDS_IA32 = TAB_GUIDS + TAB_SPLIT +
> TAB_ARCH_IA32
> TAB_GUIDS_X64 = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_X64
>
> TAB_GUIDS_IPF = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_IPF
>
> TAB_GUIDS_ARM = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_ARM
>
> +TAB_GUIDS_LOONGARCH64 = TAB_GUIDS + TAB_SPLIT +
> TAB_ARCH_LOONGARCH64
>
> TAB_GUIDS_EBC = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_EBC
>
>
>
> TAB_PROTOCOLS = 'Protocols'
>
> @@ -486,6 +492,7 @@ TAB_PROTOCOLS_IA32 = TAB_PROTOCOLS +
> TAB_SPLIT + TAB_ARCH_IA32
> TAB_PROTOCOLS_X64 = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_X64
>
> TAB_PROTOCOLS_IPF = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_IPF
>
> TAB_PROTOCOLS_ARM = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_ARM
>
> +TAB_PROTOCOLS_LOONGARCH64 = TAB_PROTOCOLS + TAB_SPLIT +
> TAB_ARCH_LOONGARCH64
>
> TAB_PROTOCOLS_EBC = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_EBC
>
>
>
> TAB_PPIS = 'Ppis'
>
> @@ -494,6 +501,7 @@ TAB_PPIS_IA32 = TAB_PPIS + TAB_SPLIT +
> TAB_ARCH_IA32
> TAB_PPIS_X64 = TAB_PPIS + TAB_SPLIT + TAB_ARCH_X64
>
> TAB_PPIS_IPF = TAB_PPIS + TAB_SPLIT + TAB_ARCH_IPF
>
> TAB_PPIS_ARM = TAB_PPIS + TAB_SPLIT + TAB_ARCH_ARM
>
> +TAB_PPIS_LOONGARCH64 = TAB_PPIS + TAB_SPLIT +
> TAB_ARCH_LOONGARCH64
>
> TAB_PPIS_EBC = TAB_PPIS + TAB_SPLIT + TAB_ARCH_EBC
>
>
>
> TAB_LIBRARY_CLASSES = 'LibraryClasses'
>
> @@ -502,6 +510,7 @@ TAB_LIBRARY_CLASSES_IA32 =
> TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_IA32
> TAB_LIBRARY_CLASSES_X64 = TAB_LIBRARY_CLASSES + TAB_SPLIT +
> TAB_ARCH_X64
>
> TAB_LIBRARY_CLASSES_IPF = TAB_LIBRARY_CLASSES + TAB_SPLIT +
> TAB_ARCH_IPF
>
> TAB_LIBRARY_CLASSES_ARM = TAB_LIBRARY_CLASSES + TAB_SPLIT +
> TAB_ARCH_ARM
>
> +TAB_LIBRARY_CLASSES_LOONGARCH64 = TAB_LIBRARY_CLASSES +
> TAB_SPLIT + TAB_ARCH_LOONGARCH64
>
> TAB_LIBRARY_CLASSES_EBC = TAB_LIBRARY_CLASSES + TAB_SPLIT +
> TAB_ARCH_EBC
>
>
>
> TAB_PACKAGES = 'Packages'
>
> @@ -510,6 +519,7 @@ TAB_PACKAGES_IA32 = TAB_PACKAGES + TAB_SPLIT +
> TAB_ARCH_IA32
> TAB_PACKAGES_X64 = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_X64
>
> TAB_PACKAGES_IPF = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_IPF
>
> TAB_PACKAGES_ARM = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_ARM
>
> +TAB_PACKAGES_LOONGARCH64 = TAB_PACKAGES + TAB_SPLIT +
> TAB_ARCH_LOONGARCH64
>
> TAB_PACKAGES_EBC = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_EBC
>
>
>
> TAB_PCDS = 'Pcds'
>
> @@ -548,6 +558,8 @@ TAB_PCDS_FIXED_AT_BUILD_IPF = TAB_PCDS +
> TAB_PCDS_FIXED_AT_BUILD + \
> TAB_SPLIT + TAB_ARCH_IPF
>
> TAB_PCDS_FIXED_AT_BUILD_ARM = TAB_PCDS +
> TAB_PCDS_FIXED_AT_BUILD + \
>
> TAB_SPLIT + TAB_ARCH_ARM
>
> +TAB_PCDS_FIXED_AT_BUILD_LOONGARCH64 = TAB_PCDS +
> TAB_PCDS_FIXED_AT_BUILD + \
>
> +TAB_SPLIT + TAB_ARCH_LOONGARCH64
>
> TAB_PCDS_FIXED_AT_BUILD_EBC = TAB_PCDS +
> TAB_PCDS_FIXED_AT_BUILD + \
>
> TAB_SPLIT + TAB_ARCH_EBC
>
>
>
> @@ -562,6 +574,8 @@ TAB_PCDS_PATCHABLE_IN_MODULE_IPF =
> TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + \
> TAB_SPLIT + TAB_ARCH_IPF
>
> TAB_PCDS_PATCHABLE_IN_MODULE_ARM = TAB_PCDS +
> TAB_PCDS_PATCHABLE_IN_MODULE + \
>
> TAB_SPLIT + TAB_ARCH_ARM
>
> +TAB_PCDS_PATCHABLE_IN_MODULE_LOONGARCH64 = TAB_PCDS +
> TAB_PCDS_PATCHABLE_IN_MODULE + \
>
> +TAB_SPLIT + TAB_ARCH_LOONGARCH64
>
> TAB_PCDS_PATCHABLE_IN_MODULE_EBC = TAB_PCDS +
> TAB_PCDS_PATCHABLE_IN_MODULE + \
>
> TAB_SPLIT + TAB_ARCH_EBC
>
>
>
> @@ -576,6 +590,8 @@ TAB_PCDS_FEATURE_FLAG_IPF = TAB_PCDS +
> TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + \
> TAB_ARCH_IPF
>
> TAB_PCDS_FEATURE_FLAG_ARM = TAB_PCDS + TAB_PCDS_FEATURE_FLAG
> + TAB_SPLIT + \
>
> TAB_ARCH_ARM
>
> +TAB_PCDS_FEATURE_FLAG_LOONGARCH64 = TAB_PCDS +
> TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + \
>
> +TAB_ARCH_LOONGARCH64
>
> TAB_PCDS_FEATURE_FLAG_EBC = TAB_PCDS + TAB_PCDS_FEATURE_FLAG +
> TAB_SPLIT + \
>
> TAB_ARCH_EBC
>
>
>
> @@ -593,6 +609,8 @@ TAB_PCDS_DYNAMIC_EX_IPF = TAB_PCDS +
> TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + \
> TAB_ARCH_IPF
>
> TAB_PCDS_DYNAMIC_EX_ARM = TAB_PCDS + TAB_PCDS_DYNAMIC_EX +
> TAB_SPLIT + \
>
> TAB_ARCH_ARM
>
> +TAB_PCDS_DYNAMIC_EX_LOONGARCH64 = TAB_PCDS +
> TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + \
>
> +TAB_ARCH_LOONGARCH64
>
> TAB_PCDS_DYNAMIC_EX_EBC = TAB_PCDS + TAB_PCDS_DYNAMIC_EX +
> TAB_SPLIT + \
>
> TAB_ARCH_EBC
>
>
>
> @@ -606,6 +624,7 @@ TAB_PCDS_DYNAMIC_IA32 = TAB_PCDS +
> TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_IA32
> TAB_PCDS_DYNAMIC_X64 = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT
> + TAB_ARCH_X64
>
> TAB_PCDS_DYNAMIC_IPF = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT
> + TAB_ARCH_IPF
>
> TAB_PCDS_DYNAMIC_ARM = TAB_PCDS + TAB_PCDS_DYNAMIC +
> TAB_SPLIT + TAB_ARCH_ARM
>
> +TAB_PCDS_DYNAMIC_LOONGARCH64 = TAB_PCDS + TAB_PCDS_DYNAMIC
> + TAB_SPLIT + TAB_ARCH_LOONGARCH64
>
> TAB_PCDS_DYNAMIC_EBC = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT
> + TAB_ARCH_EBC
>
>
>
> TAB_PCD_DYNAMIC_TYPE_LIST = [TAB_PCDS_DYNAMIC_DEFAULT_NULL, \
>
> @@ -646,6 +665,7 @@ TAB_DEPEX_IA32 = TAB_DEPEX + TAB_SPLIT +
> TAB_ARCH_IA32
> TAB_DEPEX_X64 = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_X64
>
> TAB_DEPEX_IPF = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_IPF
>
> TAB_DEPEX_ARM = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_ARM
>
> +TAB_DEPEX_LOONGARCH64 = TAB_DEPEX + TAB_SPLIT +
> TAB_ARCH_LOONGARCH64
>
> TAB_DEPEX_EBC = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_EBC
>
>
>
> TAB_SKUIDS = 'SkuIds'
>
> @@ -656,6 +676,7 @@ TAB_LIBRARIES_IA32 = TAB_LIBRARIES + TAB_SPLIT +
> TAB_ARCH_IA32
> TAB_LIBRARIES_X64 = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_X64
>
> TAB_LIBRARIES_IPF = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_IPF
>
> TAB_LIBRARIES_ARM = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_ARM
>
> +TAB_LIBRARIES_LOONGARCH64 = TAB_LIBRARIES + TAB_SPLIT +
> TAB_ARCH_LOONGARCH64
>
> TAB_LIBRARIES_EBC = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_EBC
>
>
>
> TAB_COMPONENTS = 'Components'
>
> @@ -664,6 +685,7 @@ TAB_COMPONENTS_IA32 = TAB_COMPONENTS +
> TAB_SPLIT + TAB_ARCH_IA32
> TAB_COMPONENTS_X64 = TAB_COMPONENTS + TAB_SPLIT +
> TAB_ARCH_X64
>
> TAB_COMPONENTS_IPF = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_IPF
>
> TAB_COMPONENTS_ARM = TAB_COMPONENTS + TAB_SPLIT +
> TAB_ARCH_ARM
>
> +TAB_COMPONENTS_LOONGARCH64 = TAB_COMPONENTS + TAB_SPLIT +
> TAB_ARCH_LOONGARCH64
>
> TAB_COMPONENTS_EBC = TAB_COMPONENTS + TAB_SPLIT +
> TAB_ARCH_EBC
>
>
>
> TAB_BUILD_OPTIONS = 'BuildOptions'
>
> diff --git a/BaseTools/Source/Python/build/buildoptions.py
> b/BaseTools/Source/Python/build/buildoptions.py
> index 39d92cff20..8334604b46 100644
> --- a/BaseTools/Source/Python/build/buildoptions.py
> +++ b/BaseTools/Source/Python/build/buildoptions.py
> @@ -4,6 +4,7 @@
> # Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
>
> # Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
>
> # Copyright (c) 2018 - 2020, Hewlett Packard Enterprise Development,
> L.P.<BR>
>
> +# Copyright (c) 2022, Loongson Technology Corporation Limited. All
rights
> reserved.<BR>
>
> #
>
> # SPDX-License-Identifier: BSD-2-Clause-Patent
>
> #
>
> @@ -41,7 +42,7 @@ class MyOptionParser():
> def GetOption(self):
>
> Parser = OptionParser(description=__copyright__,
> version=__version__, prog="build.exe", usage="%prog [options]
> [all|fds|genc|genmake|clean|cleanall|cleanlib|modules|libraries|run]")
>
> Parser.add_option("-a", "--arch", action="append",
> dest="TargetArch",
>
> - help="ARCHS is one of list: IA32, X64, ARM, AARCH64,
> RISCV64 or EBC, which overrides target.txt's TARGET_ARCH definition. To
> specify more archs, please repeat this option.")
>
> + help="ARCHS is one of list: IA32, X64, ARM, AARCH64,
> RISCV64, LOONGARCH64 or EBC, which overrides target.txt's TARGET_ARCH
> definition. To specify more archs, please repeat this option.")
>
> Parser.add_option("-p", "--platform", action="callback",
> type="string", dest="PlatformFile", callback=SingleCheckCallback,
>
> help="Build the platform specified by the DSC file name
> argument, overriding target.txt's ACTIVE_PLATFORM definition.")
>
> Parser.add_option("-m", "--module", action="callback",
> type="string", dest="ModuleFile", callback=SingleCheckCallback,
>
> --
> 2.27.0