From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=0EmXRGHW; spf=pass (domain: arm.com, ip: 40.107.13.53, mailfrom: krzysztof.koch@arm.com) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (EUR01-HE1-obe.outbound.protection.outlook.com [40.107.13.53]) by groups.io with SMTP; Wed, 12 Jun 2019 02:32:20 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RFeheeo1Xv6K8C/NqUqfTTzQnHbKDvmLM46stEeKt4Q=; b=0EmXRGHWy6RigrG1E0H8zPwm/XbZsC5Kin4iUDP0nqgx81FjWAMCVYWX3IHiS4xB8ovnqzd/JQIeL/JzMdkIS+2Xlm7jVUZw1LMyMtYfmti8RVG2Zm2BSmmsEF6z0vbSgpXpZiYfPTr34yg3ZauQA3WvxdGD7W46B7oxa12g8jw= Received: from AM4PR08CA0046.eurprd08.prod.outlook.com (2603:10a6:205:2::17) by AM0PR08MB3924.eurprd08.prod.outlook.com (2603:10a6:208:131::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1965.15; Wed, 12 Jun 2019 09:32:15 +0000 Received: from AM5EUR03FT010.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::202) by AM4PR08CA0046.outlook.office365.com (2603:10a6:205:2::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1965.12 via Frontend Transport; Wed, 12 Jun 2019 09:32:15 +0000 Authentication-Results: spf=temperror (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=temperror action=none header.from=arm.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT010.mail.protection.outlook.com (10.152.16.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.1965.12 via Frontend Transport; Wed, 12 Jun 2019 09:32:14 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1415.2; Wed, 12 Jun 2019 09:32:04 +0000 Received: from E119924.Arm.com (10.1.199.124) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Wed, 12 Jun 2019 09:32:04 +0000 From: "Krzysztof Koch" To: CC: Ard Biesheuvel , Leif Lindholm , Michael D Kinney , , , , Subject: [edk2-platforms PATCH v1 1/1 -resend] Platform/ARM/JunoPkg: Add support for PPTT dynamic generation Date: Wed, 12 Jun 2019 10:31:58 +0100 Message-ID: <20190612093158.36624-1-krzysztof.koch@arm.com> X-Mailer: git-send-email 2.16.2.windows.1 Return-Path: Krzysztof.Koch@arm.com MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:40.67.248.234;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(376002)(346002)(39860400002)(136003)(396003)(2980300002)(199004)(189003)(48376002)(2616005)(4326008)(486006)(54906003)(72206003)(6666004)(356004)(63370400001)(6916009)(53936002)(77096007)(186003)(63350400001)(126002)(2906002)(70586007)(36756003)(70206006)(5660300002)(14444005)(44832011)(1076003)(50466002)(476003)(966005)(26005)(86362001)(8936002)(478600001)(50226002)(68736007)(30864003)(47776003)(305945005)(6306002)(51416003)(53416004)(81156014)(2351001)(7696005)(8676002)(81166006)(316002)(336012)(426003)(16586007);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR08MB3924;H:nebula.arm.com;FPR:;SPF:TempError;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ae046383-813e-4b3b-ec5c-08d6ef18da79 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328);SRVR:AM0PR08MB3924; X-MS-TrafficTypeDiagnostic: AM0PR08MB3924: X-MS-Exchange-PUrlCount: 1 NoDisclaimer: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-Forefront-PRVS: 0066D63CE6 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: 3H7q3hsocstTLwcOHuidEJlaOXUkVSnHvGSGR7CBfd/cUyRHdb1+2vr+MTfOmZOS6s8qB8iaA5X2ZJ9SMLTsvzs/Uv2Py1RqlRmr4SB8MzxbE6JvABbcw2i6zvatMeWcHuGcLz44RkFztiH60M9EoeiqzUMrnY31WBxm5f+VVyV/5ZuAViRoOmO7bTtkj01fNsSpOvZ/pXXTYu+ibR5HjZBcF43OOPdAvmXl7IFzzNQqw7REd2HG7q8IL0GKGkZA0zh39X7mJLHT+wKql9Y44RFlS+CaN0oA61rIytK8QzuPsgXwGTI5cMJLlneYAHnq6XyO7MqpXKuO9hbcjylzH4rSS88YTehoy5bKHbJ+Ov/eP+7R1QJPpHULmLbn8sdSIaXjxY88pK2JndQiQKU/V34dyctk9Yz+MLsIaai33Jw= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2019 09:32:14.1839 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ae046383-813e-4b3b-ec5c-08d6ef18da79 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[40.67.248.234];Helo=[nebula.arm.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3924 Content-Type: text/plain Update the Platform Respository for the Juno platform to include support for generation of the Processor Properties Topology Table (PPTT) using the Dynamic Tables Framework. The Platform Repository now also describes the cache and processor topology in Juno (all revisions). Signed-off-by: Krzysztof Koch --- Changes can be seen at: https://github.com/KrzysztofKoch1/edk2-platforms/tree/392_dynamic_pptt_juno_v1 Notes: v1: - add support for dynamic generation of PPTT [Krzysztof] Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c | 443 +++++++++++++++++++- Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h | 136 +++++- 2 files changed, 575 insertions(+), 4 deletions(-) diff --git a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c index 78b906ddb8bbd35c32b4be98b1ee8bd973b6b818..2ef79ba5df750e869d241fcba98fdd44b1f26002 100644 --- a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c +++ b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c @@ -96,7 +96,13 @@ EDKII_PLATFORM_REPOSITORY_INFO ArmJunoPlatformRepositoryInfo = { CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdSsdt), (EFI_ACPI_DESCRIPTION_HEADER*)ssdtuart_aml_code }, - + // PPTT Table + { + EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_STRUCTURE_SIGNATURE, + EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_REVISION, + CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdPptt), + NULL + }, /* 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 @@ -261,6 +267,301 @@ EDKII_PLATFORM_REPOSITORY_INFO ArmJunoPlatformRepositoryInfo = { 127, // SPI Base used by this frame. 224 + }, + + // Processor Hierarchy Nodes + { + // Package + { + // CM_OBJECT_TOKEN Token + REFERENCE_TOKEN (ProcHierarchyInfo[0]), + // UINT32 Flags + PROC_NODE_FLAGS ( + EFI_ACPI_6_3_PPTT_PACKAGE_PHYSICAL, + EFI_ACPI_6_3_PPTT_PROCESSOR_ID_INVALID, + EFI_ACPI_6_3_PPTT_PROCESSOR_IS_NOT_THREAD, + EFI_ACPI_6_3_PPTT_NODE_IS_NOT_LEAF, + EFI_ACPI_6_3_PPTT_IMPLEMENTATION_NOT_IDENTICAL + ), + // CM_OBJECT_TOKEN ParentToken + CM_NULL_TOKEN, + // CM_OBJECT_TOKEN GicCToken + CM_NULL_TOKEN, + // UINT32 NoOfPrivateResources + 0, + // CM_OBJECT_TOKEN PrivateResourcesArrayToken + CM_NULL_TOKEN + }, + // 'big' cluster + { + // CM_OBJECT_TOKEN Token + REFERENCE_TOKEN (ProcHierarchyInfo[1]), + // UINT32 Flags + PROC_NODE_FLAGS ( + EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL, + EFI_ACPI_6_3_PPTT_PROCESSOR_ID_INVALID, + EFI_ACPI_6_3_PPTT_PROCESSOR_IS_NOT_THREAD, + EFI_ACPI_6_3_PPTT_NODE_IS_NOT_LEAF, + EFI_ACPI_6_3_PPTT_IMPLEMENTATION_IDENTICAL + ), + // CM_OBJECT_TOKEN ParentToken + REFERENCE_TOKEN (ProcHierarchyInfo[0]), // -> Package + // CM_OBJECT_TOKEN GicCToken + CM_NULL_TOKEN, + // UINT32 NoOfPrivateResources + BIG_CLUSTER_RESOURCE_COUNT, + // CM_OBJECT_TOKEN PrivateResourcesArrayToken + REFERENCE_TOKEN (BigClusterResources) + }, + // 'LITTLE' cluster + { + // CM_OBJECT_TOKEN Token + REFERENCE_TOKEN (ProcHierarchyInfo[2]), + // UINT32 Flags + PROC_NODE_FLAGS ( + EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL, + EFI_ACPI_6_3_PPTT_PROCESSOR_ID_INVALID, + EFI_ACPI_6_3_PPTT_PROCESSOR_IS_NOT_THREAD, + EFI_ACPI_6_3_PPTT_NODE_IS_NOT_LEAF, + EFI_ACPI_6_3_PPTT_IMPLEMENTATION_IDENTICAL + ), + // CM_OBJECT_TOKEN ParentToken + REFERENCE_TOKEN (ProcHierarchyInfo[0]), // -> Package + // CM_OBJECT_TOKEN GicCToken + CM_NULL_TOKEN, + // UINT32 NoOfPrivateResources + LITTLE_CLUSTER_RESOURCE_COUNT, + // CM_OBJECT_TOKEN PrivateResourcesArrayToken + REFERENCE_TOKEN (LittleClusterResources) + }, + // Two 'big' cores + { + // CM_OBJECT_TOKEN Token + REFERENCE_TOKEN (ProcHierarchyInfo[3]), + // UINT32 Flags + PROC_NODE_FLAGS ( + EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL, + EFI_ACPI_6_3_PPTT_PROCESSOR_ID_VALID, + EFI_ACPI_6_3_PPTT_PROCESSOR_IS_NOT_THREAD, + EFI_ACPI_6_3_PPTT_NODE_IS_LEAF, + EFI_ACPI_6_3_PPTT_IMPLEMENTATION_NOT_IDENTICAL + ), + // CM_OBJECT_TOKEN ParentToken + REFERENCE_TOKEN (ProcHierarchyInfo[1]), // -> 'big' cluster + // CM_OBJECT_TOKEN GicCToken + REFERENCE_TOKEN (GicCInfo[0]), + // UINT32 NoOfPrivateResources + BIG_CORE_RESOURCE_COUNT, + // CM_OBJECT_TOKEN PrivateResourcesArrayToken + REFERENCE_TOKEN (BigCoreResources) + }, + { + // CM_OBJECT_TOKEN Token + REFERENCE_TOKEN (ProcHierarchyInfo[4]), + // UINT32 Flags + PROC_NODE_FLAGS ( + EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL, + EFI_ACPI_6_3_PPTT_PROCESSOR_ID_VALID, + EFI_ACPI_6_3_PPTT_PROCESSOR_IS_NOT_THREAD, + EFI_ACPI_6_3_PPTT_NODE_IS_LEAF, + EFI_ACPI_6_3_PPTT_IMPLEMENTATION_NOT_IDENTICAL + ), + // CM_OBJECT_TOKEN ParentToken + REFERENCE_TOKEN (ProcHierarchyInfo[1]), // -> 'big' cluster + // CM_OBJECT_TOKEN GicCToken + REFERENCE_TOKEN (GicCInfo[1]), + // UINT32 NoOfPrivateResources + BIG_CORE_RESOURCE_COUNT, + // CM_OBJECT_TOKEN PrivateResourcesArrayToken + REFERENCE_TOKEN (BigCoreResources) + }, + // Four 'LITTLE' cores + { + // CM_OBJECT_TOKEN Token + REFERENCE_TOKEN (ProcHierarchyInfo[5]), + // UINT32 Flags + PROC_NODE_FLAGS ( + EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL, + EFI_ACPI_6_3_PPTT_PROCESSOR_ID_VALID, + EFI_ACPI_6_3_PPTT_PROCESSOR_IS_NOT_THREAD, + EFI_ACPI_6_3_PPTT_NODE_IS_LEAF, + EFI_ACPI_6_3_PPTT_IMPLEMENTATION_NOT_IDENTICAL + ), + // CM_OBJECT_TOKEN ParentToken + REFERENCE_TOKEN (ProcHierarchyInfo[2]), // -> 'LITTLE' cluster + // CM_OBJECT_TOKEN GicCToken + REFERENCE_TOKEN (GicCInfo[2]), + // UINT32 NoOfPrivateResources + LITTLE_CORE_RESOURCE_COUNT, + // CM_OBJECT_TOKEN PrivateResourcesArrayToken + REFERENCE_TOKEN (LittleCoreResources) + }, + { + // CM_OBJECT_TOKEN Token + REFERENCE_TOKEN (ProcHierarchyInfo[6]), + // UINT32 Flags + PROC_NODE_FLAGS ( + EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL, + EFI_ACPI_6_3_PPTT_PROCESSOR_ID_VALID, + EFI_ACPI_6_3_PPTT_PROCESSOR_IS_NOT_THREAD, + EFI_ACPI_6_3_PPTT_NODE_IS_LEAF, + EFI_ACPI_6_3_PPTT_IMPLEMENTATION_NOT_IDENTICAL + ), + // CM_OBJECT_TOKEN ParentToken + REFERENCE_TOKEN (ProcHierarchyInfo[2]), // -> 'LITTLE' cluster + // CM_OBJECT_TOKEN GicCToken + REFERENCE_TOKEN (GicCInfo[3]), + // UINT32 NoOfPrivateResources + LITTLE_CORE_RESOURCE_COUNT, + // CM_OBJECT_TOKEN PrivateResourcesArrayToken + REFERENCE_TOKEN (LittleCoreResources) + }, + { + // CM_OBJECT_TOKEN Token + REFERENCE_TOKEN (ProcHierarchyInfo[7]), + // UINT32 Flags + PROC_NODE_FLAGS ( + EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL, + EFI_ACPI_6_3_PPTT_PROCESSOR_ID_VALID, + EFI_ACPI_6_3_PPTT_PROCESSOR_IS_NOT_THREAD, + EFI_ACPI_6_3_PPTT_NODE_IS_LEAF, + EFI_ACPI_6_3_PPTT_IMPLEMENTATION_NOT_IDENTICAL + ), + // CM_OBJECT_TOKEN ParentToken + REFERENCE_TOKEN (ProcHierarchyInfo[2]), // -> 'LITTLE' cluster + // CM_OBJECT_TOKEN GicCToken + REFERENCE_TOKEN (GicCInfo[4]), + // UINT32 NoOfPrivateResources + LITTLE_CORE_RESOURCE_COUNT, + // CM_OBJECT_TOKEN PrivateResourcesArrayToken + REFERENCE_TOKEN (LittleCoreResources) + }, + { + // CM_OBJECT_TOKEN Token + REFERENCE_TOKEN (ProcHierarchyInfo[8]), + // UINT32 Flags + PROC_NODE_FLAGS ( + EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL, + EFI_ACPI_6_3_PPTT_PROCESSOR_ID_VALID, + EFI_ACPI_6_3_PPTT_PROCESSOR_IS_NOT_THREAD, + EFI_ACPI_6_3_PPTT_NODE_IS_LEAF, + EFI_ACPI_6_3_PPTT_IMPLEMENTATION_NOT_IDENTICAL + ), + // CM_OBJECT_TOKEN ParentToken + REFERENCE_TOKEN (ProcHierarchyInfo[2]), // -> 'LITTLE' cluster + // CM_OBJECT_TOKEN GicCToken + REFERENCE_TOKEN (GicCInfo[5]), + // UINT32 NoOfPrivateResources + LITTLE_CORE_RESOURCE_COUNT, + // CM_OBJECT_TOKEN PrivateResourcesArrayToken + REFERENCE_TOKEN (LittleCoreResources) + } + }, + + // Cache information + { + // 'big' cluster's L2 cache + { + REFERENCE_TOKEN (CacheInfo[0]), // CM_OBJECT_TOKEN Token + CM_NULL_TOKEN, // CM_OBJECT_TOKEN NextLevelOfCacheToken + 0x200000, // UINT32 Size + 2048, // UINT32 NumberOfSets + 16, // UINT32 Associativity + CACHE_ATTRIBUTES ( // UINT8 Attributes + EFI_ACPI_6_3_CACHE_ATTRIBUTES_ALLOCATION_READ_WRITE, + EFI_ACPI_6_3_CACHE_ATTRIBUTES_CACHE_TYPE_UNIFIED, + EFI_ACPI_6_3_CACHE_ATTRIBUTES_WRITE_POLICY_WRITE_BACK + ), + 64 // UINT16 LineSize + }, + // 'big' core's L1 instruction cache + { + REFERENCE_TOKEN (CacheInfo[1]), // CM_OBJECT_TOKEN Token + CM_NULL_TOKEN, // CM_OBJECT_TOKEN NextLevelOfCacheToken + 0xc000, // UINT32 Size + 256, // UINT32 NumberOfSets + 3, // UINT32 Associativity + CACHE_ATTRIBUTES ( // UINT8 Attributes + EFI_ACPI_6_3_CACHE_ATTRIBUTES_ALLOCATION_READ, + EFI_ACPI_6_3_CACHE_ATTRIBUTES_CACHE_TYPE_INSTRUCTION, + EFI_ACPI_6_3_CACHE_ATTRIBUTES_WRITE_POLICY_WRITE_BACK + ), + 64 // UINT16 LineSize + }, + // 'big' core's L1 data cache + { + REFERENCE_TOKEN (CacheInfo[2]), // CM_OBJECT_TOKEN Token + CM_NULL_TOKEN, // CM_OBJECT_TOKEN NextLevelOfCacheToken + 0x8000, // UINT32 Size + 256, // UINT32 NumberOfSets + 2, // UINT32 Associativity + CACHE_ATTRIBUTES ( // UINT8 Attributes + EFI_ACPI_6_3_CACHE_ATTRIBUTES_ALLOCATION_READ_WRITE, + EFI_ACPI_6_3_CACHE_ATTRIBUTES_CACHE_TYPE_DATA, + EFI_ACPI_6_3_CACHE_ATTRIBUTES_WRITE_POLICY_WRITE_BACK + ), + 64 // UINT16 LineSize + }, + // 'LITTLE' cluster's L2 cache + { + REFERENCE_TOKEN (CacheInfo[3]), // CM_OBJECT_TOKEN Token + CM_NULL_TOKEN, // CM_OBJECT_TOKEN NextLevelOfCacheToken + 0x100000, // UINT32 Size + 1024, // UINT32 NumberOfSets + 16, // UINT32 Associativity + CACHE_ATTRIBUTES ( // UINT8 Attributes + EFI_ACPI_6_3_CACHE_ATTRIBUTES_ALLOCATION_READ_WRITE, + EFI_ACPI_6_3_CACHE_ATTRIBUTES_CACHE_TYPE_UNIFIED, + EFI_ACPI_6_3_CACHE_ATTRIBUTES_WRITE_POLICY_WRITE_BACK + ), + 64 // UINT16 LineSize + }, + // 'LITTLE' core's L1 instruction cache + { + REFERENCE_TOKEN (CacheInfo[4]), // CM_OBJECT_TOKEN Token + CM_NULL_TOKEN, // CM_OBJECT_TOKEN NextLevelOfCacheToken + 0x8000, // UINT32 Size + 256, // UINT32 NumberOfSets + 2, // UINT32 Associativity + CACHE_ATTRIBUTES ( // UINT8 Attributes + EFI_ACPI_6_3_CACHE_ATTRIBUTES_ALLOCATION_READ, + EFI_ACPI_6_3_CACHE_ATTRIBUTES_CACHE_TYPE_INSTRUCTION, + EFI_ACPI_6_3_CACHE_ATTRIBUTES_WRITE_POLICY_WRITE_BACK + ), + 64 // UINT16 LineSize + }, + // 'LITTLE' core's L1 data cache + { + REFERENCE_TOKEN (CacheInfo[5]), // CM_OBJECT_TOKEN Token + CM_NULL_TOKEN, // CM_OBJECT_TOKEN NextLevelOfCacheToken + 0x8000, // UINT32 Size + 128, // UINT32 NumberOfSets + 4, // UINT32 Associativity + CACHE_ATTRIBUTES ( // UINT8 Attributes + EFI_ACPI_6_3_CACHE_ATTRIBUTES_ALLOCATION_READ_WRITE, + EFI_ACPI_6_3_CACHE_ATTRIBUTES_CACHE_TYPE_DATA, + EFI_ACPI_6_3_CACHE_ATTRIBUTES_WRITE_POLICY_WRITE_BACK + ), + 64 // UINT16 LineSize + } + }, + // Resources private to the 'big' cluster (shared among cores) + { + { REFERENCE_TOKEN (CacheInfo[0]) } // -> 'big' cluster's L2 cache + }, + // Resources private to each individual 'big' core instance + { + { REFERENCE_TOKEN (CacheInfo[1]) }, // -> 'big' core's L1 I-cache + { REFERENCE_TOKEN (CacheInfo[2]) } // -> 'big' core's L1 D-cache + }, + // Resources private to the 'LITTLE' cluster (shared among cores) + { + { REFERENCE_TOKEN (CacheInfo[3]) } // -> 'LITTLE' cluster's L2 cache + }, + // Resources private to each individual 'LITTLE' core instance + { + { REFERENCE_TOKEN (CacheInfo[4]) }, // -> 'LITTLE' core's L1 I-cache + { REFERENCE_TOKEN (CacheInfo[5]) } // -> 'LITTLE' core's L1 D-cache } }; @@ -329,6 +630,121 @@ GetGTBlockTimerFrameInfo ( return EFI_SUCCESS; } +/** Return GIC CPU Interface 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_GICC_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 +GetGicCInfo ( + 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 = sizeof (PlatformRepo->GicCInfo) / + sizeof (PlatformRepo->GicCInfo[0]); + + for (ObjIndex = 0; ObjIndex < TotalObjCount; ObjIndex++) { + if (SearchToken == (CM_OBJECT_TOKEN)&PlatformRepo->GicCInfo[ObjIndex]) { + CmObject->ObjectId = CmObjectId; + CmObject->Size = sizeof (PlatformRepo->GicCInfo[ObjIndex]); + CmObject->Data = (VOID*)&PlatformRepo->GicCInfo[ObjIndex]; + CmObject->Count = 1; + return EFI_SUCCESS; + } + } + + return EFI_NOT_FOUND; +} + +/** Return a list of Configuration Manager object references pointed to by the + given input token. + + @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_OBJ_REF list. + @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 +GetCmObjRefs ( + 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; + + if ((This == NULL) || (CmObject == NULL)) { + ASSERT (This != NULL); + ASSERT (CmObject != NULL); + return EFI_INVALID_PARAMETER; + } + + PlatformRepo = This->PlatRepoInfo; + + if (SearchToken == (CM_OBJECT_TOKEN)&PlatformRepo->BigClusterResources) { + CmObject->Size = sizeof (PlatformRepo->BigClusterResources); + CmObject->Data = (VOID*)&PlatformRepo->BigClusterResources; + CmObject->Count = sizeof (PlatformRepo->BigClusterResources) / + sizeof (PlatformRepo->BigClusterResources[0]); + return EFI_SUCCESS; + } + if (SearchToken == (CM_OBJECT_TOKEN)&PlatformRepo->BigCoreResources) { + CmObject->Size = sizeof (PlatformRepo->BigCoreResources); + CmObject->Data = (VOID*)&PlatformRepo->BigCoreResources; + CmObject->Count = sizeof (PlatformRepo->BigCoreResources) / + sizeof (PlatformRepo->BigCoreResources[0]); + return EFI_SUCCESS; + } + if (SearchToken == (CM_OBJECT_TOKEN)&PlatformRepo->LittleClusterResources) { + CmObject->Size = sizeof (PlatformRepo->LittleClusterResources); + CmObject->Data = (VOID*)&PlatformRepo->LittleClusterResources; + CmObject->Count = sizeof (PlatformRepo->LittleClusterResources) / + sizeof (PlatformRepo->LittleClusterResources[0]); + return EFI_SUCCESS; + } + if (SearchToken == (CM_OBJECT_TOKEN)&PlatformRepo->LittleCoreResources) { + CmObject->Size = sizeof (PlatformRepo->LittleCoreResources); + CmObject->Data = (VOID*)&PlatformRepo->LittleCoreResources; + CmObject->Count = sizeof (PlatformRepo->LittleCoreResources) / + sizeof (PlatformRepo->LittleCoreResources[0]); + return EFI_SUCCESS; + } + + return EFI_NOT_FOUND; +} + /** Return a standard namespace object. @param [in] This Pointer to the Configuration Manager Protocol. @@ -486,12 +902,14 @@ GetArmNameSpaceObject ( Token, GetGTBlockTimerFrameInfo ); - HANDLE_CM_OBJECT ( + HANDLE_CM_OBJECT_REF_BY_TOKEN ( EArmObjGicCInfo, CmObjectId, PlatformRepo->GicCInfo, (sizeof (PlatformRepo->GicCInfo) / - sizeof (PlatformRepo->GicCInfo[0])) + sizeof (PlatformRepo->GicCInfo[0])), + Token, + GetGicCInfo ); HANDLE_CM_OBJECT ( EArmObjGicDInfo, @@ -518,6 +936,25 @@ GetArmNameSpaceObject ( PlatformRepo->GicMsiFrameInfo, 1 ); + HANDLE_CM_OBJECT ( + EArmObjProcHierarchyInfo, + CmObjectId, + PlatformRepo->ProcHierarchyInfo, + (sizeof (PlatformRepo->ProcHierarchyInfo) / + sizeof (PlatformRepo->ProcHierarchyInfo[0])) + ); + HANDLE_CM_OBJECT ( + EArmObjCacheInfo, + CmObjectId, + PlatformRepo->CacheInfo, + sizeof (PlatformRepo->CacheInfo) / sizeof (PlatformRepo->CacheInfo[0]) + ); + HANDLE_CM_OBJECT_SEARCH_PLAT_REPO ( + EArmObjCmRef, + CmObjectId, + Token, + GetCmObjRefs + ); case EArmObjPciConfigSpaceInfo: if (PlatformRepo->JunoRevision != JUNO_REVISION_R0) { diff --git a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h index 060817430fe75fdf79196f8a9d31561028fb0f50..7fdf663fc6d2ad80da26ff1f1635c858d5be4e93 100644 --- a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h +++ b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h @@ -20,6 +20,12 @@ */ #define CFG_MGR_OEM_ID { 'A', 'R', 'M', 'L', 'T', 'D' } +/** A helper macro for mapping a reference token +*/ +#define REFERENCE_TOKEN(Field) \ + (CM_OBJECT_TOKEN)((UINT8*)&ArmJunoPlatformRepositoryInfo + \ + OFFSET_OF (EDKII_PLATFORM_REPOSITORY_INFO, Field)) + /** A helper macro for populating the GIC CPU information */ #define GICC_ENTRY( \ @@ -46,6 +52,36 @@ EnergyEfficiency /* UINT8 ProcessorPowerEfficiencyClass*/ \ } +/** A helper macro for populating the Processor Hierarchy Node flags +*/ +#define PROC_NODE_FLAGS( \ + PhysicalPackage, \ + AcpiProcessorIdValid, \ + ProcessorIsThread, \ + NodeIsLeaf, \ + IdenticalImplementation \ + ) \ + ( \ + PhysicalPackage | \ + (AcpiProcessorIdValid << 1) | \ + (ProcessorIsThread << 2) | \ + (NodeIsLeaf << 3) | \ + (IdenticalImplementation << 4) \ + ) + +/** A helper macro for populating the Cache Type Structure's attributes +*/ +#define CACHE_ATTRIBUTES( \ + AllocationType, \ + CacheType, \ + WritePolicy \ + ) \ + ( \ + AllocationType | \ + (CacheType << 2) | \ + (WritePolicy << 4) \ + ) + /** A helper macro for returning configuration manager objects */ #define HANDLE_CM_OBJECT(ObjId, CmObjectId, Object, ObjectCount) \ @@ -102,13 +138,46 @@ break; \ } +/** A helper macro for returning configuration manager objects referenced + by token when the entire platform repository is in scope and the + CM_NULL_TOKEN value is not allowed. +*/ +#define HANDLE_CM_OBJECT_SEARCH_PLAT_REPO( \ + ObjId, \ + CmObjectId, \ + Token, \ + HandlerProc \ + ) \ + case ObjId: { \ + CmObject->ObjectId = CmObjectId; \ + if (Token == CM_NULL_TOKEN) { \ + Status = EFI_INVALID_PARAMETER; \ + DEBUG (( \ + DEBUG_ERROR, \ + #ObjId ": CM_NULL_TOKEN value is not allowed when searching" \ + " the entire platform repository.\n" \ + )); \ + } else { \ + Status = HandlerProc (This, CmObjectId, Token, CmObject); \ + DEBUG (( \ + DEBUG_INFO, \ + #ObjId ": Token = 0x%p, Ptr = 0x%p, Size = %d, Count = %d\n", \ + (VOID*)Token, \ + CmObject->Data, \ + CmObject->Size, \ + CmObject->Count \ + )); \ + } \ + break; \ + } + /** The number of CPUs */ #define PLAT_CPU_COUNT 6 /** The number of ACPI tables to install */ -#define PLAT_ACPI_TABLE_COUNT 10 +#define PLAT_ACPI_TABLE_COUNT 11 /** The number of platform generic timer blocks */ @@ -118,6 +187,53 @@ */ #define PLAT_GTFRAME_COUNT 2 +/** For all Juno revisions, the cache and processor topology is identical. + + Terms 'big' and 'LITTLE' are used in favour of A72, A57 or A53 to take into + account that Juno r2 uses Cortex-A72 as 'big' cores, whereas Juno r0 and r1 + have Cortex-A57 as 'big' cores. +*/ + +/** The number of Processor Hierarchy Nodes + - one package node + - two cluster nodes ('big' + 'LITTLE') + - two 'big' cores + - four 'LITTLE' cores +*/ +#define PLAT_PROC_HIERARCHY_NODE_COUNT 9 + +/** The number of unique cache structures: + - 'big' core L1 instruction cache + - 'big' core L1 data cache + - 'big' core L2 cache + - 'LITTLE' core L1 instruction cache + - 'LITTLE' core L1 data cache + - 'LITTLE' core L2 cache +*/ +#define PLAT_CACHE_COUNT 6 + +/** The number of resources private to the entire 'big' cluster + - L2 cache +*/ +#define BIG_CLUSTER_RESOURCE_COUNT 1 + +/** The number of resources private to 'big' core instance + - L1 data cache + - L1 instruction cache +*/ +#define BIG_CORE_RESOURCE_COUNT 2 + +/** The number of resources private to the entire 'LITTLE' cluster + - L2 cache +*/ +#define LITTLE_CLUSTER_RESOURCE_COUNT 1 + +/** The number of resources private to each 'LITTLE' core instance + - L1 data cache + - L1 instruction cache +*/ +#define LITTLE_CORE_RESOURCE_COUNT 2 + /** A structure describing the platform configuration manager repository information */ @@ -166,6 +282,24 @@ typedef struct PlatformRepositoryInfo { /// GIC MSI Frame information CM_ARM_GIC_MSI_FRAME_INFO GicMsiFrameInfo; + // Processor topology information + CM_ARM_PROC_HIERARCHY_INFO ProcHierarchyInfo[PLAT_PROC_HIERARCHY_NODE_COUNT]; + + // Cache information + CM_ARM_CACHE_INFO CacheInfo[PLAT_CACHE_COUNT]; + + // 'big' cluster private resources + CM_ARM_OBJ_REF BigClusterResources[BIG_CLUSTER_RESOURCE_COUNT]; + + // 'big' core private resources + CM_ARM_OBJ_REF BigCoreResources[BIG_CORE_RESOURCE_COUNT]; + + // 'LITTLE' cluster private resources + CM_ARM_OBJ_REF LittleClusterResources[LITTLE_CLUSTER_RESOURCE_COUNT]; + + // 'LITTLE' core private resources + CM_ARM_OBJ_REF LittleCoreResources[LITTLE_CORE_RESOURCE_COUNT]; + /// Juno Board Revision UINT32 JunoRevision; } EDKII_PLATFORM_REPOSITORY_INFO; -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'