From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id D9FF59418F7 for ; Tue, 21 Nov 2023 16:51:54 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=EI9r4t7iI+UEKmwJdSfDaZ43phNb9qBCiHGaQ/Igzro=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1700585513; v=1; b=ebn5n04KAlhaBVNw+mwU4UTpOHmvX9DsM6BQVuPdWae2Debr4/oUIZ8kp3834fKvRErd2dQW Kipe6idCN+1ay8Zwfe+ie3DywfDUoYtXgmVsou5RViPzhJBCc+oMkaR2mZ7FHuUswhbvyezzQSj Av1w4D2Kx4uD7v+S81p8yRfY= X-Received: by 127.0.0.2 with SMTP id 8ubAYY7687511x9f6v4XRwzS; Tue, 21 Nov 2023 08:51:53 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.46845.1700585512879228237 for ; Tue, 21 Nov 2023 08:51:53 -0800 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5B6261042; Tue, 21 Nov 2023 08:52:39 -0800 (PST) X-Received: from e126645.nice.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 4A0783F6C4; Tue, 21 Nov 2023 08:51:51 -0800 (PST) From: "PierreGondois" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Thomas Abraham Subject: [edk2-devel] [PATCH v3 2/3] Platform/ARM: Juno: Generate _PSD objects Date: Tue, 21 Nov 2023 17:51:34 +0100 Message-Id: <20231121165135.1547708-3-pierre.gondois@arm.com> In-Reply-To: <20231121165135.1547708-1-pierre.gondois@arm.com> References: <20231121165135.1547708-1-pierre.gondois@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pierre.gondois@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: m3U2Xdugzzj9JWu7BS6SgmxLx7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=ebn5n04K; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io The SsdtCpuTopologyGenerator can generate _PSD objects. Add _PSD information and handling to the Configuration Manager to generate them. Change-Id: I4bb23582d250d43c173a3e6ee86eb6b0349f1b03 Signed-off-by: Pierre Gondois --- .../ConfigurationManager.c | 98 +++++++++++++++++-- .../ConfigurationManager.h | 24 ++++- 2 files changed, 113 insertions(+), 9 deletions(-) diff --git a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager= Dxe/ConfigurationManager.c b/Platform/ARM/JunoPkg/ConfigurationManager/Conf= igurationManagerDxe/ConfigurationManager.c index 2fdb15cc4caf..6a4f6e626d3f 100644 --- a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Con= figurationManager.c +++ b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Con= figurationManager.c @@ -129,12 +129,12 @@ EDKII_PLATFORM_REPOSITORY_INFO ArmJunoPlatformReposit= oryInfo =3D { GIC_ENTRY (CPUInterfaceNumber, Mpidr, PmuIrq, VGicIrq, EnergyEfficien= cy)=0D */=0D {=0D - GICC_ENTRY (0, GET_MPID (0, 0), 34, 25, 1),=0D - GICC_ENTRY (1, GET_MPID (0, 1), 38, 25, 1),=0D - GICC_ENTRY (2, GET_MPID (1, 0), 50, 25, 0),=0D - GICC_ENTRY (3, GET_MPID (1, 1), 54, 25, 0),=0D - GICC_ENTRY (4, GET_MPID (1, 2), 58, 25, 0),=0D - GICC_ENTRY (5, GET_MPID (1, 3), 62, 25, 0)=0D + GICC_ENTRY (0, GET_MPID (0, 0), 34, 25, 1, REFERENCE_TOKEN (PsdInfo[PS= D_BIG_DOMAIN_ID])),=0D + GICC_ENTRY (1, GET_MPID (0, 1), 38, 25, 1, REFERENCE_TOKEN (PsdInfo[PS= D_BIG_DOMAIN_ID])),=0D + GICC_ENTRY (2, GET_MPID (1, 0), 50, 25, 0, REFERENCE_TOKEN (PsdInfo[PS= D_LITTLE_DOMAIN_ID])),=0D + GICC_ENTRY (3, GET_MPID (1, 1), 54, 25, 0, REFERENCE_TOKEN (PsdInfo[PS= D_LITTLE_DOMAIN_ID])),=0D + GICC_ENTRY (4, GET_MPID (1, 2), 58, 25, 0, REFERENCE_TOKEN (PsdInfo[PS= D_LITTLE_DOMAIN_ID])),=0D + GICC_ENTRY (5, GET_MPID (1, 3), 62, 25, 0, REFERENCE_TOKEN (PsdInfo[PS= D_LITTLE_DOMAIN_ID])),=0D },=0D =0D // GIC Distributor Info=0D @@ -733,7 +733,29 @@ EDKII_PLATFORM_REPOSITORY_INFO ArmJunoPlatformReposito= ryInfo =3D { {=0D { REFERENCE_TOKEN (LpiInfo[1]) },=0D { REFERENCE_TOKEN (LpiInfo[2]) },=0D - }=0D + },=0D + { // Power domains=0D + { // 0: big cores=0D + // Revision=0D + EFI_ACPI_6_5_AML_PSD_REVISION_V0,=0D + // Domain=0D + PSD_BIG_DOMAIN_ID,=0D + // CoordType=0D + EFI_ACPI_6_5_AML_STATE_COORD_TYPE_SW_ANY,=0D + // NumProc=0D + 2,=0D + },=0D + { // 1: little cores=0D + // Revision=0D + EFI_ACPI_6_5_AML_PSD_REVISION_V0,=0D + // Domain=0D + PSD_LITTLE_DOMAIN_ID,=0D + // CoordType=0D + EFI_ACPI_6_5_AML_STATE_COORD_TYPE_SW_ANY,=0D + // NumProc=0D + 4,=0D + },=0D + },=0D };=0D =0D /** A helper function for returning the Configuration Manager Objects.=0D @@ -1141,6 +1163,55 @@ GetPciInterruptMapInfo ( return EFI_NOT_FOUND;=0D }=0D =0D +/** Return Psd Info.=0D +=0D + @param [in] This Pointer to the Configuration Manager Pro= tocol.=0D + @param [in] CmObjectId The Object ID of the CM object requested= =0D + @param [in] SearchToken A unique token for identifying the reque= sted=0D + CM_ARM_PCI_INTERRUPT_MAP_INFO object.=0D + @param [in, out] CmObject Pointer to the Configuration Manager Obj= ect=0D + descriptor describing the requested Obje= ct.=0D +=0D + @retval EFI_SUCCESS Success.=0D + @retval EFI_INVALID_PARAMETER A parameter is invalid.=0D + @retval EFI_NOT_FOUND The required object information is not f= ound.=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +GetPsdInfo (=0D + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST This,=0D + IN CONST CM_OBJECT_ID CmObjectId,=0D + IN CONST CM_OBJECT_TOKEN SearchToken,=0D + IN OUT CM_OBJ_DESCRIPTOR * CONST CmObject=0D + )=0D +{=0D + EDKII_PLATFORM_REPOSITORY_INFO * PlatformRepo;=0D + UINT32 TotalObjCount;=0D + UINT32 ObjIndex;=0D +=0D + if ((This =3D=3D NULL) || (CmObject =3D=3D NULL)) {=0D + ASSERT (This !=3D NULL);=0D + ASSERT (CmObject !=3D NULL);=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + PlatformRepo =3D This->PlatRepoInfo;=0D +=0D + TotalObjCount =3D ARRAY_SIZE (PlatformRepo->PsdInfo);=0D +=0D + for (ObjIndex =3D 0; ObjIndex < TotalObjCount; ObjIndex++) {=0D + if (SearchToken =3D=3D (CM_OBJECT_TOKEN)&PlatformRepo->PsdInfo[ObjInde= x]) {=0D + CmObject->ObjectId =3D CmObjectId;=0D + CmObject->Size =3D sizeof (PlatformRepo->PsdInfo[ObjIndex]);=0D + CmObject->Data =3D (VOID*)&PlatformRepo->PsdInfo[ObjIndex];=0D + CmObject->Count =3D 1;=0D + return EFI_SUCCESS;=0D + }=0D + }=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D /** Return a list of Configuration Manager object references pointed to by= the=0D given input token.=0D =0D @@ -1549,6 +1620,19 @@ GetArmNameSpaceObject ( );=0D break;=0D =0D + case EArmObjPsdInfo:=0D + Status =3D HandleCmObjectRefByToken (=0D + This,=0D + CmObjectId,=0D + PlatformRepo->PsdInfo,=0D + sizeof (PlatformRepo->PsdInfo),=0D + ARRAY_SIZE (PlatformRepo->PsdInfo),=0D + Token,=0D + GetPsdInfo,=0D + CmObject=0D + );=0D + break;=0D +=0D default: {=0D Status =3D EFI_NOT_FOUND;=0D DEBUG ((=0D diff --git a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager= Dxe/ConfigurationManager.h b/Platform/ARM/JunoPkg/ConfigurationManager/Conf= igurationManagerDxe/ConfigurationManager.h index 5b5e62427f2b..e58e9cbecb23 100644 --- a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Con= figurationManager.h +++ b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Con= figurationManager.h @@ -41,7 +41,8 @@ extern CHAR8 ssdtpci_aml_code[]; Mpidr, \= =0D PmuIrq, \= =0D VGicIrq, \= =0D - EnergyEfficiency \= =0D + EnergyEfficiency, \= =0D + PsdToken \= =0D ) { \= =0D CPUInterfaceNumber, /* UINT32 CPUInterfaceNumber */ \= =0D CPUInterfaceNumber, /* UINT32 AcpiProcessorUid */ \= =0D @@ -57,7 +58,15 @@ extern CHAR8 ssdtpci_aml_code[]; VGicIrq, /* UINT32 VGICMaintenanceInterrupt */ \= =0D 0, /* UINT64 GICRBaseAddress */ \= =0D Mpidr, /* UINT64 MPIDR */ \= =0D - EnergyEfficiency /* UINT8 ProcessorPowerEfficiencyClass*/ \= =0D + EnergyEfficiency, /* UINT8 ProcessorPowerEfficiencyClass*/ \= =0D + 0, /* UINT16 SpeOverflowInterrupt */ \= =0D + 0, /* UINT32 ProximityDomain */ \= =0D + 0, /* UINT32 ClockDomain */ \= =0D + 0, /* UINT32 AffinityFlags */ \= =0D + CM_NULL_TOKEN, /* CM_OBJECT_TOKEN CpcToken */ \= =0D + 0, /* UINT16 TrbeInterrupt */ \= =0D + CM_NULL_TOKEN, /* CM_OBJECT_TOKEN EtToken */ \= =0D + PsdToken, /* CM_OBJECT_TOKEN PsdToken */ \= =0D }=0D =0D /** A helper macro for populating the Processor Hierarchy Node flags=0D @@ -196,6 +205,14 @@ typedef EFI_STATUS (*CM_OBJECT_HANDLER_PROC) ( #define LPI_STATE_COUNT (CORES_LPI_STATE_COUNT + = \=0D CLUSTERS_LPI_STATE_COUNT)=0D =0D +/** Psd domains:=0D + - 0: big cores=0D + - 1: little cores=0D +*/=0D +#define PSD_BIG_DOMAIN_ID 0=0D +#define PSD_LITTLE_DOMAIN_ID 1=0D +#define PSD_DOMAIN_COUNT 2=0D +=0D /** A structure describing the platform configuration=0D manager repository information=0D */=0D @@ -283,6 +300,9 @@ typedef struct PlatformRepositoryInfo { // Cores Low Power Idle state references (LPI)=0D CM_ARM_OBJ_REF CoresLpiRef[CORES_LPI_STATE_COUNT]= ;=0D =0D + // Power domains=0D + CM_ARM_PSD_INFO PsdInfo[PSD_DOMAIN_COUNT];=0D +=0D /// Juno Board Revision=0D UINT32 JunoRevision;=0D } EDKII_PLATFORM_REPOSITORY_INFO;=0D --=20 2.25.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111581): https://edk2.groups.io/g/devel/message/111581 Mute This Topic: https://groups.io/mt/102732065/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-