Hi Pierre,

Thank you for this patch.
I just have a minor suggestion marked inline as [SAMI].
Otherwise, this patch looks good to me.
With that addressed,
Reviewed-by: Sami Mujawar <[email protected]>

Regards,

Sami Mujawar

On 12/12/2023, 09:31, "[email protected] <mailto:[email protected]>" 
<[email protected] <mailto:[email protected]>> wrote:


From: Pierre Gondois <[email protected] <mailto:[email protected]>>


The SsdtCpuTopologyGenerator can generate _PSD objects.
Add _PSD information and handling to the Configuration Manager
to generate them.


Signed-off-by: Pierre Gondois <[email protected] 
<mailto:[email protected]>>
---
.../ConfigurationManager.c | 98 +++++++++++++++++--
.../ConfigurationManager.h | 24 ++++-
2 files changed, 113 insertions(+), 9 deletions(-)


diff --git 
a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
 
b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
index 2fdb15cc4caf..15292f810a28 100644
--- 
a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
+++ 
b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
@@ -129,12 +129,12 @@ EDKII_PLATFORM_REPOSITORY_INFO 
ArmJunoPlatformRepositoryInfo = {
GIC_ENTRY (CPUInterfaceNumber, Mpidr, PmuIrq, VGicIrq, EnergyEfficiency)
*/
{
- GICC_ENTRY (0, GET_MPID (0, 0), 34, 25, 1),
- GICC_ENTRY (1, GET_MPID (0, 1), 38, 25, 1),
- GICC_ENTRY (2, GET_MPID (1, 0), 50, 25, 0),
- GICC_ENTRY (3, GET_MPID (1, 1), 54, 25, 0),
- GICC_ENTRY (4, GET_MPID (1, 2), 58, 25, 0),
- GICC_ENTRY (5, GET_MPID (1, 3), 62, 25, 0)
+ GICC_ENTRY (0, GET_MPID (0, 0), 34, 25, 1, REFERENCE_TOKEN 
(PsdInfo[PSD_BIG_DOMAIN_ID])),
+ GICC_ENTRY (1, GET_MPID (0, 1), 38, 25, 1, REFERENCE_TOKEN 
(PsdInfo[PSD_BIG_DOMAIN_ID])),
+ GICC_ENTRY (2, GET_MPID (1, 0), 50, 25, 0, REFERENCE_TOKEN 
(PsdInfo[PSD_LITTLE_DOMAIN_ID])),
+ GICC_ENTRY (3, GET_MPID (1, 1), 54, 25, 0, REFERENCE_TOKEN 
(PsdInfo[PSD_LITTLE_DOMAIN_ID])),
+ GICC_ENTRY (4, GET_MPID (1, 2), 58, 25, 0, REFERENCE_TOKEN 
(PsdInfo[PSD_LITTLE_DOMAIN_ID])),
+ GICC_ENTRY (5, GET_MPID (1, 3), 62, 25, 0, REFERENCE_TOKEN 
(PsdInfo[PSD_LITTLE_DOMAIN_ID])),
},


// GIC Distributor Info
@@ -733,7 +733,29 @@ EDKII_PLATFORM_REPOSITORY_INFO 
ArmJunoPlatformRepositoryInfo = {
{
{ REFERENCE_TOKEN (LpiInfo[1]) },
{ REFERENCE_TOKEN (LpiInfo[2]) },
- }
+ },
+ { // Power domains
+ { // 0: big cores
+ // Revision
+ EFI_ACPI_6_5_AML_PSD_REVISION,
+ // Domain
+ PSD_BIG_DOMAIN_ID,
+ // CoordType
+ ACPI_AML_COORD_TYPE_SW_ANY,
+ // NumProc
+ 2,
+ },
+ { // 1: little cores
+ // Revision
+ EFI_ACPI_6_5_AML_PSD_REVISION,
+ // Domain
+ PSD_LITTLE_DOMAIN_ID,
+ // CoordType
+ ACPI_AML_COORD_TYPE_SW_ANY,
+ // NumProc
+ 4,
+ },
+ },
};


/** A helper function for returning the Configuration Manager Objects.
@@ -1141,6 +1163,55 @@ GetPciInterruptMapInfo (
return EFI_NOT_FOUND;
}


+/** Return Psd Info.
+
+ @param [in] This Pointer to the Configuration Manager Protocol.
+ @param [in] CmObjectId The Object ID of the CM object requested
+ @param [in] SearchToken A unique token for identifying the requested
+ CM_ARM_PCI_INTERRUPT_MAP_INFO object.
+ @param [in, out] CmObject Pointer to the Configuration Manager Object
+ descriptor describing the requested Object.
+
+ @retval EFI_SUCCESS Success.
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.
+ @retval EFI_NOT_FOUND The required object information is not found.
+**/
+EFI_STATUS
+EFIAPI
+GetPsdInfo (
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST This,
+ IN CONST CM_OBJECT_ID CmObjectId,
+ IN CONST CM_OBJECT_TOKEN SearchToken,
+ IN OUT CM_OBJ_DESCRIPTOR * CONST CmObject
+ )
+{
+ EDKII_PLATFORM_REPOSITORY_INFO * PlatformRepo;
+ UINT32 TotalObjCount;
+ UINT32 ObjIndex;
+
+ if ((This == NULL) || (CmObject == NULL)) {
+ ASSERT (This != NULL);
+ ASSERT (CmObject != NULL);
+ return EFI_INVALID_PARAMETER;
+ }
+
+ PlatformRepo = This->PlatRepoInfo;
+
+ TotalObjCount = ARRAY_SIZE (PlatformRepo->PsdInfo);
+
+ for (ObjIndex = 0; ObjIndex < TotalObjCount; ObjIndex++) {
+ if (SearchToken == (CM_OBJECT_TOKEN)&PlatformRepo->PsdInfo[ObjIndex]) {
+ CmObject->ObjectId = CmObjectId;
+ CmObject->Size = sizeof (PlatformRepo->PsdInfo[ObjIndex]);
+ CmObject->Data = (VOID*)&PlatformRepo->PsdInfo[ObjIndex];
+ CmObject->Count = 1;
+ return EFI_SUCCESS;
+ }
+ }
+
+ return EFI_SUCCESS;
+}
+
/** Return a list of Configuration Manager object references pointed to by the
given input token.


@@ -1549,6 +1620,19 @@ GetArmNameSpaceObject (
);
break;


+ case EArmObjPsdInfo:
+ Status = HandleCmObjectRefByToken (
+ This,
+ CmObjectId,
+ PlatformRepo->PsdInfo,
+ sizeof (PlatformRepo->PsdInfo),
+ ARRAY_SIZE (PlatformRepo->PsdInfo),
+ Token,
+ GetPsdInfo,
+ CmObject
+ );
+ break;
+
default: {
Status = EFI_NOT_FOUND;
DEBUG ((
diff --git 
a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
 
b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
index 5b5e62427f2b..e58e9cbecb23 100644
--- 
a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
+++ 
b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
@@ -41,7 +41,8 @@ extern CHAR8 ssdtpci_aml_code[];
Mpidr, \
PmuIrq, \
VGicIrq, \
- EnergyEfficiency \
+ EnergyEfficiency, \
+ PsdToken \
) { \
CPUInterfaceNumber, /* UINT32 CPUInterfaceNumber */ \
CPUInterfaceNumber, /* UINT32 AcpiProcessorUid */ \
@@ -57,7 +58,15 @@ extern CHAR8 ssdtpci_aml_code[];
VGicIrq, /* UINT32 VGICMaintenanceInterrupt */ \
0, /* UINT64 GICRBaseAddress */ \
Mpidr, /* UINT64 MPIDR */ \
- EnergyEfficiency /* UINT8 ProcessorPowerEfficiencyClass*/ \
+ EnergyEfficiency, /* UINT8 ProcessorPowerEfficiencyClass*/ \
+ 0, /* UINT16 SpeOverflowInterrupt */ \
+ 0, /* UINT32 ProximityDomain */ \
+ 0, /* UINT32 ClockDomain */ \
+ 0, /* UINT32 AffinityFlags */ \
+ CM_NULL_TOKEN, /* CM_OBJECT_TOKEN CpcToken */ \
+ 0, /* UINT16 TrbeInterrupt */ \
+ CM_NULL_TOKEN, /* CM_OBJECT_TOKEN EtToken */ \
+ PsdToken, /* CM_OBJECT_TOKEN PsdToken */ \
}


/** A helper macro for populating the Processor Hierarchy Node flags
@@ -196,6 +205,14 @@ typedef EFI_STATUS (*CM_OBJECT_HANDLER_PROC) (
#define LPI_STATE_COUNT (CORES_LPI_STATE_COUNT + \
CLUSTERS_LPI_STATE_COUNT)


+/** Psd domains:
+ - 0: big cores
+ - 1: little cores
+*/
+#define PSD_BIG_DOMAIN_ID 0
+#define PSD_LITTLE_DOMAIN_ID 1
+#define PSD_DOMAIN_COUNT 2
+
/** A structure describing the platform configuration
manager repository information
*/
@@ -283,6 +300,9 @@ typedef struct PlatformRepositoryInfo {
// Cores Low Power Idle state references (LPI)
CM_ARM_OBJ_REF CoresLpiRef[CORES_LPI_STATE_COUNT];


+ // Power domains
[SAMI] The comment could also say that this information is dynamically 
populated by the configuration manager.
+ CM_ARM_PSD_INFO PsdInfo[PSD_DOMAIN_COUNT];
+
/// Juno Board Revision
UINT32 JunoRevision;
} EDKII_PLATFORM_REPOSITORY_INFO;
-- 
2.25.1







-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114388): https://edk2.groups.io/g/devel/message/114388
Mute This Topic: https://groups.io/mt/103127067/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to