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=pvu9RhA1; spf=pass (domain: arm.com, ip: 40.107.1.74, mailfrom: krzysztof.koch@arm.com) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (EUR02-HE1-obe.outbound.protection.outlook.com [40.107.1.74]) by groups.io with SMTP; Tue, 18 Jun 2019 02:26:07 -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=jGR22C53aTBgqCpuc2kKx2MpPzNMwYXLhz62VfnFfco=; b=pvu9RhA17cRhddN4SHgHomeiLXsChgpVpnxq8+TwxJ3atr0mq+hnqxYDQJyDGZtFM7/QBS5QXFKVsxnu6A3acaN2gnN+1vq8KV6HkoB0GtGsF1wEi3i2BFpycRVkiNfuoyTvpeeDOqSS1WoGPVhz9C+920xDJvSOBYpGAf5vQJA= Received: from AM6PR08CA0046.eurprd08.prod.outlook.com (2603:10a6:20b:c0::34) by AM4PR08MB2771.eurprd08.prod.outlook.com (2603:10a6:205:7::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1987.13; Tue, 18 Jun 2019 09:26:02 +0000 Received: from AM5EUR03FT050.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::203) by AM6PR08CA0046.outlook.office365.com (2603:10a6:20b:c0::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1987.13 via Frontend Transport; Tue, 18 Jun 2019 09:25:20 +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 AM5EUR03FT050.mail.protection.outlook.com (10.152.17.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.1987.11 via Frontend Transport; Tue, 18 Jun 2019 09:25:18 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1415.2; Tue, 18 Jun 2019 09:25:02 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2; Tue, 18 Jun 2019 09:25:01 +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; Tue, 18 Jun 2019 09:25:00 +0000 From: "Krzysztof Koch" To: CC: Ard Biesheuvel , Leif Lindholm , Michael D Kinney , , , , Subject: [edk2-platforms PATCH v2 1/1] Platform/ARM: Juno: Add support for PPTT dynamic generation Date: Tue, 18 Jun 2019 10:24:53 +0100 Message-ID: <20190618092453.6412-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:IE;EFV:NLI;SFV:NSPM;SFS:(10009020)(39860400002)(376002)(396003)(136003)(346002)(2980300002)(189003)(199004)(48376002)(72206003)(6666004)(356004)(14444005)(7696005)(51416003)(966005)(2906002)(426003)(63350400001)(486006)(44832011)(68736007)(53936002)(2351001)(63370400001)(126002)(53416004)(336012)(2616005)(476003)(86362001)(4326008)(36756003)(70586007)(47776003)(81156014)(50226002)(186003)(81166006)(70206006)(1076003)(6306002)(478600001)(26005)(54906003)(5660300002)(316002)(50466002)(77096007)(30864003)(6916009)(8936002)(16586007)(8676002)(305945005);DIR:OUT;SFP:1101;SCL:1;SRVR:AM4PR08MB2771;H:nebula.arm.com;FPR:;SPF:TempError;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 81a36d4b-ee02-4a07-3e39-08d6f3cee0ec X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328);SRVR:AM4PR08MB2771; X-MS-TrafficTypeDiagnostic: AM4PR08MB2771: X-MS-Exchange-PUrlCount: 1 NoDisclaimer: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-Forefront-PRVS: 007271867D X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: YgXZOMdj+Ox9h8iNZsLfBCA9o7Ui70Rtnhc5DwwCYUPlp5seiT0U+v7Kx4nwZerL1jMQO1+khvYbmwzwvsw1Jd4RPww0e6QbiL/ByrE1KyRNVTMLn4C4VXj5N7mTGK/wjIFfO+AI9pJosFvF5R65rXcJe92Bi2I7sNzn+kUMr4CG/n4FBZEPN/+BZs3j51MBGdPWaU6syiimipYWGCeV4lGvppO1MRJSCl5ufTLqErYNXkUOrLXwenIJSUan84v3kgY9rAbRl2kJqmobIo3Iqpg68/iToeX0AMpvIwwsJbU3Hy5RlMR69nmG0e6ndr2LfzeZzXWuavp3SLebe0vD9GrO6n2A8l4vgCym2MfeCgsy5FKfwM38o9MHMG3jfz+Lj5zrjgMHizJ+a36T1EPpEPLNC2J9fo+wZzVzaWthAyw= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2019 09:25:18.0564 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 81a36d4b-ee02-4a07-3e39-08d6f3cee0ec 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: AM4PR08MB2771 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_v2 Notes: v2: - use ARRAY_SIZE macro from Base.h to compute array size [Leif] v1: - add support for dynamic generation of PPTT [Krzysztof] Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c | 438 +++++++++++++++++++- Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h | 136 +++++- 2 files changed, 569 insertions(+), 5 deletions(-) diff --git a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c index 78b906ddb8bbd35c32b4be98b1ee8bd973b6b818..d52cc2982334ded1c3bf2f5e8f570378d8fb0ae1 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,116 @@ 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 = ARRAY_SIZE (PlatformRepo->GicCInfo); + + 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 = ARRAY_SIZE (PlatformRepo->BigClusterResources); + return EFI_SUCCESS; + } + if (SearchToken == (CM_OBJECT_TOKEN)&PlatformRepo->BigCoreResources) { + CmObject->Size = sizeof (PlatformRepo->BigCoreResources); + CmObject->Data = (VOID*)&PlatformRepo->BigCoreResources; + CmObject->Count = ARRAY_SIZE (PlatformRepo->BigCoreResources); + return EFI_SUCCESS; + } + if (SearchToken == (CM_OBJECT_TOKEN)&PlatformRepo->LittleClusterResources) { + CmObject->Size = sizeof (PlatformRepo->LittleClusterResources); + CmObject->Data = (VOID*)&PlatformRepo->LittleClusterResources; + CmObject->Count = ARRAY_SIZE (PlatformRepo->LittleClusterResources); + return EFI_SUCCESS; + } + if (SearchToken == (CM_OBJECT_TOKEN)&PlatformRepo->LittleCoreResources) { + CmObject->Size = sizeof (PlatformRepo->LittleCoreResources); + CmObject->Data = (VOID*)&PlatformRepo->LittleCoreResources; + CmObject->Count = ARRAY_SIZE (PlatformRepo->LittleCoreResources); + return EFI_SUCCESS; + } + + return EFI_NOT_FOUND; +} + /** Return a standard namespace object. @param [in] This Pointer to the Configuration Manager Protocol. @@ -486,12 +897,13 @@ GetArmNameSpaceObject ( Token, GetGTBlockTimerFrameInfo ); - HANDLE_CM_OBJECT ( + HANDLE_CM_OBJECT_REF_BY_TOKEN ( EArmObjGicCInfo, CmObjectId, PlatformRepo->GicCInfo, - (sizeof (PlatformRepo->GicCInfo) / - sizeof (PlatformRepo->GicCInfo[0])) + ARRAY_SIZE (PlatformRepo->GicCInfo), + Token, + GetGicCInfo ); HANDLE_CM_OBJECT ( EArmObjGicDInfo, @@ -518,6 +930,24 @@ GetArmNameSpaceObject ( PlatformRepo->GicMsiFrameInfo, 1 ); + HANDLE_CM_OBJECT ( + EArmObjProcHierarchyInfo, + CmObjectId, + PlatformRepo->ProcHierarchyInfo, + ARRAY_SIZE (PlatformRepo->ProcHierarchyInfo) + ); + HANDLE_CM_OBJECT ( + EArmObjCacheInfo, + CmObjectId, + PlatformRepo->CacheInfo, + ARRAY_SIZE (PlatformRepo->CacheInfo) + ); + 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)'