From nobody Thu Apr 25 15:12:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+89350+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+89350+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1651071600; cv=none; d=zohomail.com; s=zohoarc; b=c+TPmdf+1MYYzmGWPqyCqN1JwNZNl0Mz39p+3IwvC7nxkvA5AEEUWkuBLw3m1u6xPa5KKIIsV0wmHMMBuWjV7gu05k1yvDnV9lPMCbI1wXjEgt9QGaTBgg+qIg1bjfU/f7x3gNAVTjTUjKcCNyh9fyVut6MhUbAXTSQdiusfMkQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1651071600; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=omK2E5jn07szzG6Gz/cMz78kNBPhhX9mbm0ooEBHrIs=; b=TaPZMWHubVOrB6XytGBBdkOv6uvP9SzkzoQBljxlPn0Pob5errbsnR8g78KqKQTHY3GHJsSF7clU0X0QVvawcT5rf+ht4P3ZOfePM5AaJnPQZlPk0uqhvH0cPonefr0mpbvUy76RyVlblu8v/MPl3Wd/+IFdc6eeTA9lglD4V54= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+89350+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1651071600915960.6238443623087; Wed, 27 Apr 2022 08:00:00 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id RYYWYY1788612xcOnILe64xk; Wed, 27 Apr 2022 08:00:00 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web09.9353.1651071599744902050 for ; Wed, 27 Apr 2022 08:00:00 -0700 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 7708F143D; Wed, 27 Apr 2022 07:59:59 -0700 (PDT) X-Received: from pierre123.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 39E753F73B; Wed, 27 Apr 2022 07:59:58 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Sami Mujawar Subject: [edk2-devel] [PATCH edk2-platforms v1 1/3] Platform/ARM: Juno: Generate ASL description of CPU topology Date: Wed, 27 Apr 2022 16:59:41 +0200 Message-Id: <20220427145943.402487-2-Pierre.Gondois@arm.com> In-Reply-To: <20220427145943.402487-1-Pierre.Gondois@arm.com> References: <20220427145943.402487-1-Pierre.Gondois@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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 X-Gm-Message-State: Vf0UaV565DmF4mpvcgoxlzpmx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1651071600; bh=o0kZUFYedCsDcPwkpkc0wk7QfDmlXK8MAu1ou/iCB4o=; h=Cc:Date:From:Reply-To:Subject:To; b=VPFuRByzHTLKwdM6y7VfgJLibgdDuCEHoqgETRPKLA02sgZwQ7alQhYqJOXPc3wVIbg RjzQs6HjZ19TLr6VQtMM2iCQExZ15WEt3FUqLf5TEf6/luKottvztRHFqUrotVN3iaAqb IaxKQigIWDwZCKKgtMNc0j0xyyxJ97Kx3ls= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1651071601481100002 Content-Type: text/plain; charset="utf-8" From: Pierre Gondois The Dynamic Tables Framework has been updated to add support for generating an ASL description of a CPU topology and its _LPI states. This patch: - Describes the _LPI states in the Configuration Manager of the Juno - Add the generation of a new SSDT table describing the CPU topology and its _LPI states - Removes the CPU topology description of the DSDT table Signed-off-by: Pierre Gondois Reviewed-by: Sami Mujawar --- .../AslTables/Dsdt.asl | 198 ------------------ .../ConfigurationManager.c | 196 ++++++++++++++++- .../ConfigurationManager.h | 20 +- 3 files changed, 206 insertions(+), 208 deletions(-) diff --git a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager= Dxe/AslTables/Dsdt.asl b/Platform/ARM/JunoPkg/ConfigurationManager/Configur= ationManagerDxe/AslTables/Dsdt.asl index 63c70c1e4f06..2270b517cd12 100644 --- a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Asl= Tables/Dsdt.asl +++ b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Asl= Tables/Dsdt.asl @@ -33,204 +33,6 @@ DefinitionBlock("DsdtTable.aml", "DSDT", 1, "ARMLTD", "= ARM-JUNO", EFI_ACPI_ARM_O } Return (Arg3) } - Device (CLU0) { // Cluster0 state - Name(_HID, "ACPI0010") - Name(_UID, 1) - Name (_LPI, Package() { - 0, // Version - 0, // Level Index - 1, // Count - Package() { // Power Gating state for Cluster - 2500, // Min residency (uS) - 1150, // Wake latency (uS) - 1, // Flags - 1, // Arch Context Flags - 100, //Residency Counter Frequency - 0, // No Parent State - 0x01000000, // Integer Entry method - ResourceTemplate() { // Null Residency Counter - Register (SystemMemory, 0, 0, 0, 0) - }, - ResourceTemplate() { // Null Usage Counter - Register (SystemMemory, 0, 0, 0, 0) - }, - "CluPwrDn" - }, - }) - Name(PLPI, Package() { - 0, // Version - 0, // Level Index - 2, // Count - Package() { // WFI for CPU - 1, // Min residency (uS) - 1, // Wake latency (uS) - 1, // Flags - 0, // Arch Context Flags - 100, //Residency Counter Frequency - 0, // No parent state - ResourceTemplate () { - // Register Entry method - Register (FFixedHW, - 0x20, // Bit Width - 0x00, // Bit Offset - 0xFFFFFFFF, // Address - 0x03, // Access Size - ) - }, - ResourceTemplate() { // Null Residency Counter - Register (SystemMemory, 0, 0, 0, 0) - }, - ResourceTemplate() { // Null Usage Counter - Register (SystemMemory, 0, 0, 0, 0) - }, - "WFI", - }, - Package() { // Power Gating state for CPU - 150, // Min residency (uS) - 350, // Wake latency (uS) - 1, // Flags - 1, // Arch Context Flags - 100, //Residency Counter Frequency - 1, // Parent node can be in any state - ResourceTemplate () { - // Register Entry method - Register (FFixedHW, - 0x20, // Bit Width - 0x00, // Bit Offset - 0x00010000, // Address - 0x03, // Access Size - ) - }, - ResourceTemplate() { // Null Residency Counter - Register (SystemMemory, 0, 0, 0, 0) - }, - ResourceTemplate() { // Null Usage Counter - Register (SystemMemory, 0, 0, 0, 0) - }, - "CorePwrDn" - }, - }) - Device(CPU0) { // A57-0: Cluster 0, Cpu 0 - Name(_HID, "ACPI0007") - Name(_UID, 0) - Method (_LPI, 0, NotSerialized) { - return(PLPI) - } - } - Device(CPU1) { // A57-1: Cluster 0, Cpu 1 - Name(_HID, "ACPI0007") - Name(_UID, 1) - Method (_LPI, 0, NotSerialized) { - return(PLPI) - } - } - } - Device (CLU1) { // Cluster1 state - Name(_HID, "ACPI0010") - Name(_UID, 2) - Name (_LPI, Package() { - 0, // Version - 0, // Level Index - 1, // Count - Package() { // Power Gating state for Cluster - 2500, // Min residency (uS) - 1150, // Wake latency (uS) - 1, // Flags - 1, // Arch Context Flags - 100, //Residency Counter Frequency - 0, // No Parent State - 0x01000000, // Integer Entry method - ResourceTemplate() { // Null Residency Counter - Register (SystemMemory, 0, 0, 0, 0) - }, - ResourceTemplate() { // Null Usage Counter - Register (SystemMemory, 0, 0, 0, 0) - }, - "CluPwrDn" - }, - }) - Name(PLPI, Package() { - 0, // Version - 0, // Level Index - 2, // Count - Package() { // WFI for CPU - 1, // Min residency (uS) - 1, // Wake latency (uS) - 1, // Flags - 0, // Arch Context Flags - 100, //Residency Counter Frequency - 0, // No parent state - ResourceTemplate () { - // Register Entry method - Register (FFixedHW, - 0x20, // Bit Width - 0x00, // Bit Offset - 0xFFFFFFFF, // Address - 0x03, // Access Size - ) - }, - ResourceTemplate() { // Null Residency Counter - Register (SystemMemory, 0, 0, 0, 0) - }, - ResourceTemplate() { // Null Usage Counter - Register (SystemMemory, 0, 0, 0, 0) - }, - "WFI", - }, - Package() { // Power Gating state for CPU - 150, // Min residency (uS) - 350, // Wake latency (uS) - 1, // Flags - 1, // Arch Context Flags - 100, //Residency Counter Frequency - 1, // Parent node can be in any state - ResourceTemplate () { - // Register Entry method - Register (FFixedHW, - 0x20, // Bit Width - 0x00, // Bit Offset - 0x00010000, // Address - 0x03, // Access Size - ) - }, - ResourceTemplate() { // Null Residency Counter - Register (SystemMemory, 0, 0, 0, 0) - }, - ResourceTemplate() { // Null Usage Counter - Register (SystemMemory, 0, 0, 0, 0) - }, - "CorePwrDn" - }, - }) - Device(CPU2) { // A53-0: Cluster 1, Cpu 0 - Name(_HID, "ACPI0007") - Name(_UID, 2) - Method (_LPI, 0, NotSerialized) { - return(PLPI) - } - } - Device(CPU3) { // A53-1: Cluster 1, Cpu 1 - Name(_HID, "ACPI0007") - Name(_UID, 3) - Method (_LPI, 0, NotSerialized) { - return(PLPI) - } - } - Device(CPU4) { // A53-2: Cluster 1, Cpu 2 - Name(_HID, "ACPI0007") - Name(_UID, 4) - Method (_LPI, 0, NotSerialized) { - return(PLPI) - } - } - Device(CPU5) { // A53-3: Cluster 1, Cpu 3 - Name(_HID, "ACPI0007") - Name(_UID, 5) - Method (_LPI, 0, NotSerialized) { - return(PLPI) - } - } - } =20 // // LAN9118 Ethernet diff --git a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager= Dxe/ConfigurationManager.c b/Platform/ARM/JunoPkg/ConfigurationManager/Conf= igurationManagerDxe/ConfigurationManager.c index 8a0464c5f637..977aba5da5c4 100644 --- a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Con= figurationManager.c +++ b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Con= figurationManager.c @@ -1,7 +1,7 @@ /** @file Configuration Manager Dxe =20 - Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.
+ Copyright (c) 2017 - 2022, Arm Limited. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -90,6 +90,14 @@ EDKII_PLATFORM_REPOSITORY_INFO ArmJunoPlatformRepository= Info =3D { CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdPptt), NULL }, + // SSDT Table (Cpu topology) + { + EFI_ACPI_6_3_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, + 0, // Unused + CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdSsdtCpuTopology), + NULL, + SIGNATURE_64 ('C','P','U','-','T','O','P','O') + }, /* PCI MCFG Table PCIe is only available on Juno R1 and R2. Add the PCI table entries at the end of the table so that @@ -277,6 +285,8 @@ EDKII_PLATFORM_REPOSITORY_INFO ArmJunoPlatformRepositor= yInfo =3D { // UINT32 NoOfPrivateResources 0, // CM_OBJECT_TOKEN PrivateResourcesArrayToken + CM_NULL_TOKEN, + // CM_OBJECT_TOKEN LpiToken CM_NULL_TOKEN }, // 'big' cluster @@ -298,7 +308,9 @@ EDKII_PLATFORM_REPOSITORY_INFO ArmJunoPlatformRepositor= yInfo =3D { // UINT32 NoOfPrivateResources BIG_CLUSTER_RESOURCE_COUNT, // CM_OBJECT_TOKEN PrivateResourcesArrayToken - REFERENCE_TOKEN (BigClusterResources) + REFERENCE_TOKEN (BigClusterResources), + // CM_OBJECT_TOKEN LpiToken + REFERENCE_TOKEN (ClustersLpiRef) }, // 'LITTLE' cluster { @@ -319,7 +331,9 @@ EDKII_PLATFORM_REPOSITORY_INFO ArmJunoPlatformRepositor= yInfo =3D { // UINT32 NoOfPrivateResources LITTLE_CLUSTER_RESOURCE_COUNT, // CM_OBJECT_TOKEN PrivateResourcesArrayToken - REFERENCE_TOKEN (LittleClusterResources) + REFERENCE_TOKEN (LittleClusterResources), + // CM_OBJECT_TOKEN LpiToken + REFERENCE_TOKEN (ClustersLpiRef) }, // Two 'big' cores { @@ -340,7 +354,9 @@ EDKII_PLATFORM_REPOSITORY_INFO ArmJunoPlatformRepositor= yInfo =3D { // UINT32 NoOfPrivateResources BIG_CORE_RESOURCE_COUNT, // CM_OBJECT_TOKEN PrivateResourcesArrayToken - REFERENCE_TOKEN (BigCoreResources) + REFERENCE_TOKEN (BigCoreResources), + // CM_OBJECT_TOKEN LpiToken + REFERENCE_TOKEN (CoresLpiRef) }, { // CM_OBJECT_TOKEN Token @@ -360,7 +376,9 @@ EDKII_PLATFORM_REPOSITORY_INFO ArmJunoPlatformRepositor= yInfo =3D { // UINT32 NoOfPrivateResources BIG_CORE_RESOURCE_COUNT, // CM_OBJECT_TOKEN PrivateResourcesArrayToken - REFERENCE_TOKEN (BigCoreResources) + REFERENCE_TOKEN (BigCoreResources), + // CM_OBJECT_TOKEN LpiToken + REFERENCE_TOKEN (CoresLpiRef) }, // Four 'LITTLE' cores { @@ -381,7 +399,9 @@ EDKII_PLATFORM_REPOSITORY_INFO ArmJunoPlatformRepositor= yInfo =3D { // UINT32 NoOfPrivateResources LITTLE_CORE_RESOURCE_COUNT, // CM_OBJECT_TOKEN PrivateResourcesArrayToken - REFERENCE_TOKEN (LittleCoreResources) + REFERENCE_TOKEN (LittleCoreResources), + // CM_OBJECT_TOKEN LpiToken + REFERENCE_TOKEN (CoresLpiRef) }, { // CM_OBJECT_TOKEN Token @@ -401,7 +421,9 @@ EDKII_PLATFORM_REPOSITORY_INFO ArmJunoPlatformRepositor= yInfo =3D { // UINT32 NoOfPrivateResources LITTLE_CORE_RESOURCE_COUNT, // CM_OBJECT_TOKEN PrivateResourcesArrayToken - REFERENCE_TOKEN (LittleCoreResources) + REFERENCE_TOKEN (LittleCoreResources), + // CM_OBJECT_TOKEN LpiToken + REFERENCE_TOKEN (CoresLpiRef) }, { // CM_OBJECT_TOKEN Token @@ -421,7 +443,9 @@ EDKII_PLATFORM_REPOSITORY_INFO ArmJunoPlatformRepositor= yInfo =3D { // UINT32 NoOfPrivateResources LITTLE_CORE_RESOURCE_COUNT, // CM_OBJECT_TOKEN PrivateResourcesArrayToken - REFERENCE_TOKEN (LittleCoreResources) + REFERENCE_TOKEN (LittleCoreResources), + // CM_OBJECT_TOKEN LpiToken + REFERENCE_TOKEN (CoresLpiRef) }, { // CM_OBJECT_TOKEN Token @@ -441,7 +465,9 @@ EDKII_PLATFORM_REPOSITORY_INFO ArmJunoPlatformRepositor= yInfo =3D { // UINT32 NoOfPrivateResources LITTLE_CORE_RESOURCE_COUNT, // CM_OBJECT_TOKEN PrivateResourcesArrayToken - REFERENCE_TOKEN (LittleCoreResources) + REFERENCE_TOKEN (LittleCoreResources), + // CM_OBJECT_TOKEN LpiToken + REFERENCE_TOKEN (CoresLpiRef) } }, =20 @@ -549,6 +575,84 @@ EDKII_PLATFORM_REPOSITORY_INFO ArmJunoPlatformReposito= ryInfo =3D { { { REFERENCE_TOKEN (CacheInfo[4]) }, // -> 'LITTLE' core's L1 I-cache { REFERENCE_TOKEN (CacheInfo[5]) } // -> 'LITTLE' core's L1 D-cache + }, + + // Low Power Idle state information (LPI) for all cores/clusters + { + { // LpiInfo[0] -> Clusters CluPwrDn + 2500, // MinResidency + 1150, // WorstCaseWakeLatency + 1, // Flags + 1, // ArchFlags + 100, // ResCntFreq + 0, // EnableParentState + 1, // IsInteger + 0x01000000, // IntegerEntryMethod + // RegisterEntryMethod (NULL, use IntegerEntryMethod) + { EFI_ACPI_6_3_SYSTEM_MEMORY, 0, 0, 0, 0 }, + // ResidencyCounterRegister (NULL) + { EFI_ACPI_6_3_SYSTEM_MEMORY, 0, 0, 0, 0 }, + // UsageCounterRegister (NULL) + { EFI_ACPI_6_3_SYSTEM_MEMORY, 0, 0, 0, 0 }, + "CluPwrDn" // StateName + }, + // LpiInfo[1] -> Cores WFI + { + 1, // MinResidency + 1, // WorstCaseWakeLatency + 1, // Flags + 0, // ArchFlags + 100, // ResCntFreq + 0, // EnableParentState + 0, // IsInteger + 0, // IntegerEntryMethod (0, use RegisterEntryMethod) + // RegisterEntryMethod + { + EFI_ACPI_6_3_FUNCTIONAL_FIXED_HARDWARE, // AddressSpaceId + 0x20, // RegisterBitWidth + 0x00, // RegisterBitOffset + 0x03, // AccessSize + 0xFFFFFFFF // Address + }, + // ResidencyCounterRegister (NULL) + { EFI_ACPI_6_3_SYSTEM_MEMORY, 0, 0, 0, 0 }, + // UsageCounterRegister (NULL) + { EFI_ACPI_6_3_SYSTEM_MEMORY, 0, 0, 0, 0 }, + "WFI" // StateName + }, + // LpiInfo[2] -> Cores CorePwrDn + { + 150, // MinResidency + 350, // WorstCaseWakeLatency + 1, // Flags + 1, // ArchFlags + 100, // ResCntFreq + 1, // EnableParentState + 0, // IsInteger + 0, // IntegerEntryMethod (0, use RegisterEntryMethod) + // RegisterEntryMethod + { + EFI_ACPI_6_3_FUNCTIONAL_FIXED_HARDWARE, // AddressSpaceId + 0x20, // RegisterBitWidth + 0x00, // RegisterBitOffset + 0x03, // AccessSize + 0x00010000 // Address + }, + // ResidencyCounterRegister (NULL) + { EFI_ACPI_6_3_SYSTEM_MEMORY, 0, 0, 0, 0 }, + // UsageCounterRegister (NULL) + { EFI_ACPI_6_3_SYSTEM_MEMORY, 0, 0, 0, 0 }, + "CorePwrDn" // StateName + }, + }, + // Cluster Low Power Idle state references (LPI) + { + { REFERENCE_TOKEN (LpiInfo[0]) } + }, + // Cores Low Power Idle state references (LPI) + { + { REFERENCE_TOKEN (LpiInfo[1]) }, + { REFERENCE_TOKEN (LpiInfo[2]) }, } }; =20 @@ -809,6 +913,55 @@ GetGicCInfo ( return EFI_NOT_FOUND; } =20 +/** Return Lpi State Infor. + + @param [in] This Pointer to the Configuration Manager Pro= tocol. + @param [in] CmObjectId The Object ID of the CM object requested + @param [in] SearchToken A unique token for identifying the reque= sted + CM_ARM_LPI_INFO object. + @param [in, out] CmObject Pointer to the Configuration Manager Obj= ect + descriptor describing the requested Obje= ct. + + @retval EFI_SUCCESS Success. + @retval EFI_INVALID_PARAMETER A parameter is invalid. + @retval EFI_NOT_FOUND The required object information is not f= ound. +**/ +EFI_STATUS +EFIAPI +GetLpiInfo ( + 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 =3D=3D NULL) || (CmObject =3D=3D NULL)) { + ASSERT (This !=3D NULL); + ASSERT (CmObject !=3D NULL); + return EFI_INVALID_PARAMETER; + } + + PlatformRepo =3D This->PlatRepoInfo; + + TotalObjCount =3D ARRAY_SIZE (PlatformRepo->LpiInfo); + + for (ObjIndex =3D 0; ObjIndex < TotalObjCount; ObjIndex++) { + if (SearchToken =3D=3D (CM_OBJECT_TOKEN)&PlatformRepo->LpiInfo[ObjInde= x]) { + CmObject->ObjectId =3D CmObjectId; + CmObject->Size =3D sizeof (PlatformRepo->LpiInfo[ObjIndex]); + CmObject->Data =3D (VOID*)&PlatformRepo->LpiInfo[ObjIndex]; + CmObject->Count =3D 1; + return EFI_SUCCESS; + } + } + + return EFI_NOT_FOUND; +} + /** Return a list of Configuration Manager object references pointed to by= the given input token. =20 @@ -866,6 +1019,18 @@ GetCmObjRefs ( CmObject->Count =3D ARRAY_SIZE (PlatformRepo->LittleCoreResources); return EFI_SUCCESS; } + if (SearchToken =3D=3D (CM_OBJECT_TOKEN)&PlatformRepo->ClustersLpiRef) { + CmObject->Size =3D sizeof (PlatformRepo->ClustersLpiRef); + CmObject->Data =3D (VOID*)&PlatformRepo->ClustersLpiRef; + CmObject->Count =3D ARRAY_SIZE (PlatformRepo->ClustersLpiRef); + return EFI_SUCCESS; + } + if (SearchToken =3D=3D (CM_OBJECT_TOKEN)&PlatformRepo->CoresLpiRef) { + CmObject->Size =3D sizeof (PlatformRepo->CoresLpiRef); + CmObject->Data =3D (VOID*)&PlatformRepo->CoresLpiRef; + CmObject->Count =3D ARRAY_SIZE (PlatformRepo->CoresLpiRef); + return EFI_SUCCESS; + } =20 return EFI_NOT_FOUND; } @@ -1142,6 +1307,19 @@ GetArmNameSpaceObject ( } break; =20 + case EArmObjLpiInfo: + Status =3D HandleCmObjectRefByToken ( + This, + CmObjectId, + NULL, + 0, + 0, + Token, + GetLpiInfo, + CmObject + ); + break; + default: { Status =3D EFI_NOT_FOUND; DEBUG (( diff --git a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager= Dxe/ConfigurationManager.h b/Platform/ARM/JunoPkg/ConfigurationManager/Conf= igurationManagerDxe/ConfigurationManager.h index 771b00c31b9e..1bc242bc9d85 100644 --- a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Con= figurationManager.h +++ b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Con= figurationManager.h @@ -115,7 +115,7 @@ typedef EFI_STATUS (*CM_OBJECT_HANDLER_PROC) ( =20 /** The number of ACPI tables to install */ -#define PLAT_ACPI_TABLE_COUNT 10 +#define PLAT_ACPI_TABLE_COUNT 11 =20 /** The number of platform generic timer blocks */ @@ -172,6 +172,15 @@ typedef EFI_STATUS (*CM_OBJECT_HANDLER_PROC) ( */ #define LITTLE_CORE_RESOURCE_COUNT 2 =20 +/** The number of Lpi states for the platform: + - two for the cores + - one for the clusters +*/ +#define CORES_LPI_STATE_COUNT 2 +#define CLUSTERS_LPI_STATE_COUNT 1 +#define LPI_STATE_COUNT (CORES_LPI_STATE_COUNT + = \ + CLUSTERS_LPI_STATE_COUNT) + /** A structure describing the platform configuration manager repository information */ @@ -238,6 +247,15 @@ typedef struct PlatformRepositoryInfo { // 'LITTLE' core private resources CM_ARM_OBJ_REF LittleCoreResources[LITTLE_CORE_RE= SOURCE_COUNT]; =20 + // Low Power Idle state information (LPI) for all cores/clusters + CM_ARM_LPI_INFO LpiInfo[LPI_STATE_COUNT]; + + // Clusters Low Power Idle state references (LPI) + CM_ARM_OBJ_REF ClustersLpiRef[CLUSTERS_LPI_STATE_= COUNT]; + + // Cores Low Power Idle state references (LPI) + CM_ARM_OBJ_REF CoresLpiRef[CORES_LPI_STATE_COUNT]; + /// Juno Board Revision UINT32 JunoRevision; } EDKII_PLATFORM_REPOSITORY_INFO; --=20 2.25.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#89350): https://edk2.groups.io/g/devel/message/89350 Mute This Topic: https://groups.io/mt/90732525/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 15:12:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+89351+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+89351+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1651071602; cv=none; d=zohomail.com; s=zohoarc; b=bYRU8MX0tvljEp0Dy3QxALyKJlaAYca+pL47+b5bpp4x6KkMqLEKVwm7t9j9+o1eFG9I6DMZeM7BkceqUW56c5RVMDiR3DckGe+54BTmgdJWeExHRdCZYaXnToA7v+if7fBrJSTMakWj6UjX4d87gDf9quX3bTB+5aXltgnwlVs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1651071602; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=kSvCR7EXv0PF4c17OZNtcaS8IC4H7+JfHgLn1C6Pn8w=; b=jL37cWz393ALtsOnBvmoRXN4dQksoYEMW1QZanJecnV3FOApGEx1AKlENgRATzM5LkHIrXw3Y80i6VY5Zq6tzJ1HKRHiu9Xnp80uoTbc0uBKvosiz5oXLjbpE3Gl2svP28y4lI9b1bHrCpytqFYL1yD2owER51FtB9df9BM2wzw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+89351+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1651071602294768.798260117463; Wed, 27 Apr 2022 08:00:02 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id ArD4YY1788612xhZwsJY0hL7; Wed, 27 Apr 2022 08:00:02 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web08.9486.1651071601251549739 for ; Wed, 27 Apr 2022 08:00:01 -0700 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 E0D5CED1; Wed, 27 Apr 2022 08:00:00 -0700 (PDT) X-Received: from pierre123.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C59123F73B; Wed, 27 Apr 2022 07:59:59 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Sami Mujawar Subject: [edk2-devel] [PATCH edk2-platforms v1 2/3] Platform/ARM: Juno: Print debug values in right order Date: Wed, 27 Apr 2022 16:59:42 +0200 Message-Id: <20220427145943.402487-3-Pierre.Gondois@arm.com> In-Reply-To: <20220427145943.402487-1-Pierre.Gondois@arm.com> References: <20220427145943.402487-1-Pierre.Gondois@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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 X-Gm-Message-State: AIQ15P8da35fFPsrCUHMLmcCx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1651071602; bh=KjSLG663HeZEPVG/4rWQJ5tEJQuf9SnwzYW9eMQYnuY=; h=Cc:Date:From:Reply-To:Subject:To; b=SBzFsHkAoqvYEyZ3ESXcYtrFZwtXJWD/34nz1Nk3u5ium64SsIi+D4Tmipxreu6HdfY mSP9IlGCvf7+RKGkioZcBaI6Q0cyS4zdQSzHI+lwS/5CJBAqumvc1l2nd7FkUyissCg/e SIBwvl7g+cTOvrBcrxgE0fIkS6RVNHJJQ5o= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1651071603390100009 Content-Type: text/plain; charset="utf-8" From: Pierre Gondois The values printed in the 'DEBUG' are not printed in the right order. Re-order them. Signed-off-by: Pierre Gondois Reviewed-by: Sami Mujawar --- .../ConfigurationManagerDxe/ConfigurationManager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager= Dxe/ConfigurationManager.c b/Platform/ARM/JunoPkg/ConfigurationManager/Conf= igurationManagerDxe/ConfigurationManager.c index 977aba5da5c4..d147bbc317db 100644 --- a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Con= figurationManager.c +++ b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Con= figurationManager.c @@ -790,8 +790,8 @@ HandleCmObjectSearchPlatformRepo ( DEBUG (( DEBUG_INFO, "INFO: Token =3D 0x%p, CmObjectId =3D %x, Ptr =3D 0x%p, Size =3D %d, C= ount =3D %d\n", - CmObjectId, (VOID*)Token, + CmObjectId, CmObjectDesc->Data, CmObjectDesc->Size, CmObjectDesc->Count --=20 2.25.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#89351): https://edk2.groups.io/g/devel/message/89351 Mute This Topic: https://groups.io/mt/90732526/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 15:12:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+89352+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+89352+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1651071604; cv=none; d=zohomail.com; s=zohoarc; b=RAtccdB99WTn8DuyJwapEp+No9bzmLFJfCl8AqEyHdVwmFmKEDKoPIH2GfWY4Kc1Uw+0ku9pDPA6XMfR9t/70zXNbAgvkHZQnx4b17dCMb2k/HUKOlb91nJKd2QGoWu/TaqAqmG/zxiEvfBwUHE+BT6nPowY4lLkXHeXo1l2/ds= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1651071604; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=V8VjFYXhK+kf7s7Ryh2AV/iUZKAmnJ/neZoihhzDDMw=; b=WS17QM09TYCAIsemAcNLiWIr1YrPv5xjsoMdz5OD70KxEO/MEw5iwuz3uYjYZ7JPKiF2GDRDC0bzRk8gGacsemEuYanfnXo6LtcdhypAr7njMe/Z5T23S98BijbwRza6i1oz7DyDiAQ3iof2VVgH/SWEeqZiI3XsEVYjQ3aq1f4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+89352+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1651071604681276.1412870514905; Wed, 27 Apr 2022 08:00:04 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id V3UjYY1788612xqOhDfiVqCK; Wed, 27 Apr 2022 08:00:04 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.9366.1651071602792509885 for ; Wed, 27 Apr 2022 08:00:03 -0700 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 6715A1474; Wed, 27 Apr 2022 08:00:02 -0700 (PDT) X-Received: from pierre123.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 4B8433F73B; Wed, 27 Apr 2022 08:00:01 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Sami Mujawar Subject: [edk2-devel] [PATCH edk2-platforms v1 3/3] Platform/ARM: Juno: Generate ASL description of a PCIe bus Date: Wed, 27 Apr 2022 16:59:43 +0200 Message-Id: <20220427145943.402487-4-Pierre.Gondois@arm.com> In-Reply-To: <20220427145943.402487-1-Pierre.Gondois@arm.com> References: <20220427145943.402487-1-Pierre.Gondois@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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 X-Gm-Message-State: o5cBwYB1xFDUgLhPRMwIfR8px1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1651071604; bh=vde5QhJF97NBYB9xfTdzn7sZz4lig6G/JLt7FZJ+gHY=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=odLZxx5x41MH3Igvh8L1tONBk4gyxn2OdGTAIZYCISQP3GrnA++ioMbTQIkcFDgwGAr mtEwcVeDOYbvmOXzEcKTdbwZXfWX0MxiqgqQ/T1JxUZXBv9LrV/1rhJiPfEQeDM9No/N6 jaOnBi7IWGr2J3lROoAblWsi3jHLcmIK1ok= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1651071605368100011 Content-Type: text/plain; charset="utf-8" From: Pierre Gondois The Dynamic Tables Framework has been updated to add support for generating an ASL description of PCIe busses. This patch: - Describes the PCI address-range mapping and PCI devices legacy interrupts in the Configuration Manager of the Juno - Add the generation of a new SSDT table describing the PCIe bus - Removes the existing (and hard-coded) SSDT table describing the PCIe bus Signed-off-by: Pierre Gondois Reviewed-by: Sami Mujawar --- .../AslTables/SsdtPci.asl | 195 --------------- .../ConfigurationManager.c | 227 +++++++++++++++++- .../ConfigurationManager.h | 27 +++ .../ConfigurationManagerDxe.inf | 1 - 4 files changed, 249 insertions(+), 201 deletions(-) delete mode 100644 Platform/ARM/JunoPkg/ConfigurationManager/Configuration= ManagerDxe/AslTables/SsdtPci.asl diff --git a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager= Dxe/AslTables/SsdtPci.asl b/Platform/ARM/JunoPkg/ConfigurationManager/Confi= gurationManagerDxe/AslTables/SsdtPci.asl deleted file mode 100644 index 2ed37ea83c6c..000000000000 --- a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Asl= Tables/SsdtPci.asl +++ /dev/null @@ -1,195 +0,0 @@ -/** @file - SSDT for Juno PCIe - - Copyright (c) 2014 - 2019, ARM Ltd. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include "ArmPlatform.h" - -/* - See ACPI 6.1 Section 6.2.13 - - There are two ways that _PRT can be used. - - In the first model, a PCI Link device is used to provide additional - configuration information such as whether the interrupt is Level or - Edge triggered, it is active High or Low, Shared or Exclusive, etc. - - In the second model, the PCI interrupts are hardwired to specific - interrupt inputs on the interrupt controller and are not - configurable. In this case, the Source field in _PRT does not - reference a device, but instead contains the value zero, and the - Source Index field contains the global system interrupt to which the - PCI interrupt is hardwired. - - We use the first model with link indirection to set the correct - interrupt type as PCI defaults (Level Triggered, Active Low) are not - compatible with GICv2. -*/ -#define LNK_DEVICE(Unique_Id, Link_Name, irq) \ - Device(Link_Name) { \ - Name(_HID, EISAID("PNP0C0F")) \ - Name(_UID, Unique_Id) \ - Name(_PRS, ResourceTemplate() { \ - Interrupt(ResourceProducer, Level, ActiveHigh, Exclusive) { irq } \ - }) \ - Method (_CRS, 0) { Return (_PRS) } \ - Method (_SRS, 1) { } \ - Method (_DIS) { } \ -} - -#define PRT_ENTRY(Address, Pin, Link) = \ - Package (4) { = \ - Address, /* uses the same format as _ADR */ = \ - Pin, /* The PCI pin number of the device (0-INTA, 1-INTB, 2-INTC,= 3-INTD) */ \ - Link, /* Interrupt allocated via Link device */ = \ - Zero /* global system interrupt number (no used) */ = \ -} - -/* - See Reference [1] 6.1.1 - "High word=E2=80=93Device #, Low word=E2=80=93Function #. (for example, = device 3, - function 2 is 0x00030002). To refer to all the functions on a device #, - use a function number of FFFF)." -*/ -#define ROOT_PRT_ENTRY(Pin, Link) PRT_ENTRY(0x0000FFFF, Pin, Link) - // Device 0 for Bridge. - -DefinitionBlock("SsdtPci.aml", "SSDT", 1, "ARMLTD", "ARM-JUNO", EFI_ACPI_A= RM_OEM_REVISION) { - Scope(_SB) { - // - // PCI Root Complex - // - LNK_DEVICE(1, LNKA, 168) - LNK_DEVICE(2, LNKB, 169) - LNK_DEVICE(3, LNKC, 170) - LNK_DEVICE(4, LNKD, 171) - - Device(PCI0) - { - Name(_HID, EISAID("PNP0A08")) // PCI Express Root Bridge - Name(_CID, EISAID("PNP0A03")) // Compatible PCI Root Bridge - Name(_SEG, Zero) // PCI Segment Group number - Name(_BBN, Zero) // PCI Base Bus Number - Name(_CCA, 1) // Initially mark the PCI coherent (for JunoR1) - - // Root Complex 0 - Device (RP0) { - Name(_ADR, 0xF0000000) // Dev 0, Func 0 - } - - // PCI Routing Table - Name(_PRT, Package() { - ROOT_PRT_ENTRY(0, LNKA), // INTA - ROOT_PRT_ENTRY(1, LNKB), // INTB - ROOT_PRT_ENTRY(2, LNKC), // INTC - ROOT_PRT_ENTRY(3, LNKD), // INTD - }) - // Root complex resources - Method (_CRS, 0, Serialized) { - Name (RBUF, ResourceTemplate () { - WordBusNumber ( // Bus numbers assigned to this root - ResourceProducer, - MinFixed, MaxFixed, PosDecode, - 0, // AddressGranularity - 0, // AddressMinimum - Minimum Bus Number - 255, // AddressMaximum - Maximum Bus Number - 0, // AddressTranslation - Set to 0 - 256 // RangeLength - Number of Busses - ) - - DWordMemory ( // 32-bit BAR Windows - ResourceProducer, PosDecode, - MinFixed, MaxFixed, - Cacheable, ReadWrite, - 0x00000000, // Granularity - 0x50000000, // Min Base Address - 0x57FFFFFF, // Max Base Address - 0x00000000, // Translate - 0x08000000 // Length - ) - - QWordMemory ( // 64-bit BAR Windows - ResourceProducer, PosDecode, - MinFixed, MaxFixed, - Cacheable, ReadWrite, - 0x00000000, // Granularity - 0x4000000000, // Min Base Address - 0x40FFFFFFFF, // Max Base Address - 0x00000000, // Translate - 0x100000000 // Length - ) - - DWordIo ( // IO window - ResourceProducer, - MinFixed, - MaxFixed, - PosDecode, - EntireRange, - 0x00000000, // Granularity - 0x00000000, // Min Base Address - 0x007fffff, // Max Base Address - 0x5f800000, // Translate - 0x00800000, // Length - ,,,TypeTranslation - ) - }) // Name(RBUF) - - Return (RBUF) - } // Method(_CRS) - - // - // OS Control Handoff - // - Name(SUPP, Zero) // PCI _OSC Support Field value - Name(CTRL, Zero) // PCI _OSC Control Field value - - /* - See [1] 6.2.10, [2] 4.5 - */ - Method(_OSC,4) { - // Check for proper UUID - If(LEqual(Arg0,ToUUID("33DB4D5B-1FF7-401C-9657-7441C03DD766"))) { - // Create DWord-adressable fields from the Capabilities Buffer - CreateDWordField(Arg3,0,CDW1) - CreateDWordField(Arg3,4,CDW2) - CreateDWordField(Arg3,8,CDW3) - - // Save Capabilities DWord2 & 3 - Store(CDW2,SUPP) - Store(CDW3,CTRL) - - // Only allow native hot plug control if OS supports: - // * ASPM - // * Clock PM - // * MSI/MSI-X - If(LNotEqual(And(SUPP, 0x16), 0x16)) { - And(CTRL,0x1E,CTRL) // Mask bit 0 (and undefined bits) - } - - // Always allow native PME, AER (no dependencies) - - // Never allow SHPC (no SHPC controller in this system) - And(CTRL,0x1D,CTRL) - - If(LNotEqual(Arg1,One)) { // Unknown revision - Or(CDW1,0x08,CDW1) - } - - If(LNotEqual(CDW3,CTRL)) { // Capabilities bits were mask= ed - Or(CDW1,0x10,CDW1) - } - - // Update DWORD3 in the buffer - Store(CTRL,CDW3) - Return(Arg3) - } Else { - Or(CDW1,4,CDW1) // Unrecognized UUID - Return(Arg3) - } - } // End _OSC - } // PCI0 - } -} diff --git a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager= Dxe/ConfigurationManager.c b/Platform/ARM/JunoPkg/ConfigurationManager/Conf= igurationManagerDxe/ConfigurationManager.c index d147bbc317db..61c704411620 100644 --- a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Con= figurationManager.c +++ b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Con= figurationManager.c @@ -111,11 +111,12 @@ EDKII_PLATFORM_REPOSITORY_INFO ArmJunoPlatformReposit= oryInfo =3D { }, // SSDT table describing the PCI root complex { - EFI_ACPI_6_2_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_6_3_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, 0, // Unused - CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdSsdt), - (EFI_ACPI_DESCRIPTION_HEADER*)ssdtpci_aml_code - } + CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdSsdtPciExpress), + NULL, + SIGNATURE_64 ('S','S','D','T','-','P','C','I') + }, }, =20 // Boot architecture information @@ -244,7 +245,86 @@ EDKII_PLATFORM_REPOSITORY_INFO ArmJunoPlatformReposito= ryInfo =3D { // The start bus number FixedPcdGet32 (PcdPciBusMin), // The end bus number - FixedPcdGet32 (PcdPciBusMax) + FixedPcdGet32 (PcdPciBusMax), + // AddressMapToken + REFERENCE_TOKEN (PciAddressMapRef), + // InterruptMapToken + REFERENCE_TOKEN (PciInterruptMapRef) + }, + + // PCI address-range mapping references + { + { REFERENCE_TOKEN (PciAddressMapInfo[0]) }, + { REFERENCE_TOKEN (PciAddressMapInfo[1]) }, + { REFERENCE_TOKEN (PciAddressMapInfo[2]) } + }, + // PCI address-range mapping information + { + { // PciAddressMapInfo[0] -> 32-bit BAR Window + PCI_SS_M32, // SpaceCode + 0x50000000, // PciAddress + 0x50000000, // CpuAddress + 0x08000000 // AddressSize + }, + { // PciAddressMapInfo[1] -> 64-bit BAR Window + PCI_SS_M64, // SpaceCode + 0x4000000000, // PciAddress + 0x4000000000, // CpuAddress + 0x0100000000 // AddressSize + }, + { // PciAddressMapInfo[2] -> IO BAR Window + PCI_SS_IO, // SpaceCode + 0x00000000, // PciAddress + 0x5f800000, // CpuAddress + 0x00800000 // AddressSize + }, + }, + + // PCI device legacy interrupts mapping information + { + { REFERENCE_TOKEN (PciInterruptMapInfo[0]) }, + { REFERENCE_TOKEN (PciInterruptMapInfo[1]) }, + { REFERENCE_TOKEN (PciInterruptMapInfo[2]) }, + { REFERENCE_TOKEN (PciInterruptMapInfo[3]) } + }, + // PCI device legacy interrupts mapping information + { + { // PciInterruptMapInfo[0] -> Device 0, INTA + 0, // PciBus + 0, // PciDevice + 0, // PciInterrupt + { + 168, // Interrupt + 0x0 // Flags + } + }, + { // PciInterruptMapInfo[1] -> Device 0, INTB + 0, // PciBus + 0, // PciDevice + 1, // PciInterrupt + { + 169, // Interrupt + 0x0 // Flags + } + }, + { // PciInterruptMapInfo[2] -> Device 0, INTC + 0, // PciBus + 0, // PciDevice + 2, // PciInterrupt + { + 170, // Interrupt + 0x0 // Flags + } + }, + { // PciInterruptMapInfo[3] -> Device 0, INTD + 0, // PciBus + 0, // PciDevice + 3, // PciInterrupt + { + 171, // Interrupt + 0x0 // Flags + } + }, }, =20 // GIC Msi Frame Info @@ -962,6 +1042,105 @@ GetLpiInfo ( return EFI_NOT_FOUND; } =20 + +/** Return PCI address-range mapping Info. + + @param [in] This Pointer to the Configuration Manager Pro= tocol. + @param [in] CmObjectId The Object ID of the CM object requested + @param [in] SearchToken A unique token for identifying the reque= sted + CM_ARM_PCI_ADDRESS_MAP_INFO object. + @param [in, out] CmObject Pointer to the Configuration Manager Obj= ect + descriptor describing the requested Obje= ct. + + @retval EFI_SUCCESS Success. + @retval EFI_INVALID_PARAMETER A parameter is invalid. + @retval EFI_NOT_FOUND The required object information is not f= ound. +**/ +EFI_STATUS +EFIAPI +GetPciAddressMapInfo ( + 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 =3D=3D NULL) || (CmObject =3D=3D NULL)) { + ASSERT (This !=3D NULL); + ASSERT (CmObject !=3D NULL); + return EFI_INVALID_PARAMETER; + } + + PlatformRepo =3D This->PlatRepoInfo; + + TotalObjCount =3D ARRAY_SIZE (PlatformRepo->PciAddressMapInfo); + + for (ObjIndex =3D 0; ObjIndex < TotalObjCount; ObjIndex++) { + if (SearchToken =3D=3D (CM_OBJECT_TOKEN)&PlatformRepo->PciAddressMapIn= fo[ObjIndex]) { + CmObject->ObjectId =3D CmObjectId; + CmObject->Size =3D sizeof (PlatformRepo->PciAddressMapInfo[ObjIndex]= ); + CmObject->Data =3D (VOID*)&PlatformRepo->PciAddressMapInfo[ObjIndex]; + CmObject->Count =3D 1; + return EFI_SUCCESS; + } + } + + return EFI_NOT_FOUND; +} + +/** Return PCI device legacy interrupt mapping Info. + + @param [in] This Pointer to the Configuration Manager Pro= tocol. + @param [in] CmObjectId The Object ID of the CM object requested + @param [in] SearchToken A unique token for identifying the reque= sted + CM_ARM_PCI_INTERRUPT_MAP_INFO object. + @param [in, out] CmObject Pointer to the Configuration Manager Obj= ect + descriptor describing the requested Obje= ct. + + @retval EFI_SUCCESS Success. + @retval EFI_INVALID_PARAMETER A parameter is invalid. + @retval EFI_NOT_FOUND The required object information is not f= ound. +**/ +EFI_STATUS +EFIAPI +GetPciInterruptMapInfo ( + 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 =3D=3D NULL) || (CmObject =3D=3D NULL)) { + ASSERT (This !=3D NULL); + ASSERT (CmObject !=3D NULL); + return EFI_INVALID_PARAMETER; + } + + PlatformRepo =3D This->PlatRepoInfo; + + TotalObjCount =3D ARRAY_SIZE (PlatformRepo->PciInterruptMapInfo); + + for (ObjIndex =3D 0; ObjIndex < TotalObjCount; ObjIndex++) { + if (SearchToken =3D=3D (CM_OBJECT_TOKEN)&PlatformRepo->PciInterruptMap= Info[ObjIndex]) { + CmObject->ObjectId =3D CmObjectId; + CmObject->Size =3D sizeof (PlatformRepo->PciInterruptMapInfo[ObjInde= x]); + CmObject->Data =3D (VOID*)&PlatformRepo->PciInterruptMapInfo[ObjInde= x]; + CmObject->Count =3D 1; + return EFI_SUCCESS; + } + } + + return EFI_NOT_FOUND; +} + /** Return a list of Configuration Manager object references pointed to by= the given input token. =20 @@ -1031,6 +1210,18 @@ GetCmObjRefs ( CmObject->Count =3D ARRAY_SIZE (PlatformRepo->CoresLpiRef); return EFI_SUCCESS; } + if (SearchToken =3D=3D (CM_OBJECT_TOKEN)&PlatformRepo->PciAddressMapRef)= { + CmObject->Size =3D sizeof (PlatformRepo->PciAddressMapRef); + CmObject->Data =3D (VOID*)&PlatformRepo->PciAddressMapRef; + CmObject->Count =3D ARRAY_SIZE (PlatformRepo->PciAddressMapRef); + return EFI_SUCCESS; + } + if (SearchToken =3D=3D (CM_OBJECT_TOKEN)&PlatformRepo->PciInterruptMapRe= f) { + CmObject->Size =3D sizeof (PlatformRepo->PciInterruptMapRef); + CmObject->Data =3D (VOID*)&PlatformRepo->PciInterruptMapRef; + CmObject->Count =3D ARRAY_SIZE (PlatformRepo->PciInterruptMapRef); + return EFI_SUCCESS; + } =20 return EFI_NOT_FOUND; } @@ -1320,6 +1511,32 @@ GetArmNameSpaceObject ( ); break; =20 + case EArmObjPciAddressMapInfo: + Status =3D HandleCmObjectRefByToken ( + This, + CmObjectId, + PlatformRepo->PciAddressMapInfo, + sizeof (PlatformRepo->PciAddressMapInfo), + ARRAY_SIZE (PlatformRepo->PciAddressMapInfo), + Token, + GetPciAddressMapInfo, + CmObject + ); + break; + + case EArmObjPciInterruptMapInfo: + Status =3D HandleCmObjectRefByToken ( + This, + CmObjectId, + PlatformRepo->PciInterruptMapInfo, + sizeof (PlatformRepo->PciInterruptMapInfo), + ARRAY_SIZE (PlatformRepo->PciInterruptMapInfo), + Token, + GetPciInterruptMapInfo, + CmObject + ); + break; + default: { Status =3D EFI_NOT_FOUND; DEBUG (( diff --git a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager= Dxe/ConfigurationManager.h b/Platform/ARM/JunoPkg/ConfigurationManager/Conf= igurationManagerDxe/ConfigurationManager.h index 1bc242bc9d85..5b5e62427f2b 100644 --- a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Con= figurationManager.h +++ b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Con= figurationManager.h @@ -90,6 +90,21 @@ extern CHAR8 ssdtpci_aml_code[]; (WritePolicy << 4) \ ) =20 +/** PCI space codes. +*/ +#define PCI_SS_CONFIG 0 +#define PCI_SS_IO 1 +#define PCI_SS_M32 2 +#define PCI_SS_M64 3 + +/** Count of PCI address-range mapping struct. +*/ +#define PCI_ADDRESS_MAP_COUNT 3 + +/** Count of PCI device legacy interrupt mapping struct. +*/ +#define PCI_INTERRUPT_MAP_COUNT 4 + /** A function that prepares Configuration Manager Objects for returning. =20 @param [in] This Pointer to the Configuration Manager Protocol. @@ -226,6 +241,18 @@ typedef struct PlatformRepositoryInfo { /// PCI configuration space information CM_ARM_PCI_CONFIG_SPACE_INFO PciConfigInfo; =20 + // PCI address-range mapping references + CM_ARM_OBJ_REF PciAddressMapRef[PCI_ADDRESS_MAP_C= OUNT]; + + // PCI address-range mapping information + CM_ARM_PCI_ADDRESS_MAP_INFO PciAddressMapInfo[PCI_ADDRESS_MAP_= COUNT]; + + // PCI device legacy interrupts mapping references + CM_ARM_OBJ_REF PciInterruptMapRef[PCI_INTERRUPT_M= AP_COUNT]; + + // PCI device legacy interrupts mapping information + CM_ARM_PCI_INTERRUPT_MAP_INFO PciInterruptMapInfo[PCI_INTERRUPT_= MAP_COUNT]; + /// GIC MSI Frame information CM_ARM_GIC_MSI_FRAME_INFO GicMsiFrameInfo; =20 diff --git a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager= Dxe/ConfigurationManagerDxe.inf b/Platform/ARM/JunoPkg/ConfigurationManager= /ConfigurationManagerDxe/ConfigurationManagerDxe.inf index 7ca134d6674b..91bffe8d5d82 100644 --- a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Con= figurationManagerDxe.inf +++ b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Con= figurationManagerDxe.inf @@ -24,7 +24,6 @@ [Sources] ConfigurationManager.c AslTables/Dsdt.asl AslTables/SsdtJunoUsb.asl - AslTables/SsdtPci.asl =20 [Packages] ArmPkg/ArmPkg.dec --=20 2.25.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#89352): https://edk2.groups.io/g/devel/message/89352 Mute This Topic: https://groups.io/mt/90732534/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-