From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id A33837803CE for ; Mon, 2 Oct 2023 21:53:37 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=w4xDb8XlumkqoLd8WkRy4a8wU/yhXlPYgMpPZ9ZqiQc=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1696283616; v=1; b=FlIAIzJRe8MWZPFGkxY8jUWcz+htoY8VeqbbOsXnJP4i4/M+8oaQ6sEfH4rR88qM/GS2ek21 /9vDHajtPKDf7k8BfPXtzog/62mdz6sop9AF1SRactsxo2KFxibnXKTku9UNCu+syjJzfp6p485 04xKhST9NWvvU7979eM2EBwI= X-Received: by 127.0.0.2 with SMTP id X15dYY7687511xrkVR6Vbg7V; Mon, 02 Oct 2023 14:53:36 -0700 X-Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.83]) by mx.groups.io with SMTP id smtpd.web10.95433.1696283615356942908 for ; Mon, 02 Oct 2023 14:53:35 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LE5J94Z3sCrAY+b91FkKxHtGtznbEX3rDNhZfkLIUALH6B7lqgxxIGwTi3M1up7iVMSoHP3NUnFBMKaf3bY0/aylME2odUL9lOBYfiNOFle2VQdAtvZnfOyiN/CdYgepANvxhSzgAZDrYhfjH9JKULMvp93jkCwci2VgOGMVKtGeRjOwshzRWpjN54lsyUUv/MyM6hXWsNM8oftJTc0TU/82ixF8C89X/ABZ/Q1oIzvapxaPGPNIUOrLtUY/wHzL73CfWjP4daBhC/AaKHZt50cHo9S0MzuJoOA3EhpyRIPVKuP9DPYSTK+3C31OeQY+kos42yOzcE1AUuqGKhyeyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lY/j5AMzH2PiTHZJi7R+v3LQ3FrnMskuxgZImSZC6bI=; b=AyCZNhZHgN1yNdB+ZzwYVTiP9Kyq+TMXch6jjpmCP6JhaqC/iOI5Coy7HaxtnzWXltDirqpLbQgZjLvrUWpKjzX43B3LVgMmfSJLM+8dH0iBqyWJthDnsReueljMxLTmeH65apXgY5tvmBu5T2KARuk/4iHnY6QNnC6NF4oTAociuwYJErILhIEX+23c2Ff6FPY3Sit1XffQCHVE4Le5Qf6TvkI1YyyZjBduP65qE35pzGsumCw8+h76Z11hCE260bp1PbBvsNYzReZBm7cgpqVZ1O8eY7dH65ms2l/KtldfK7t69an9aGNgK1/yhoHMcmHZV6rrlof4hbOdpumBSg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none X-Received: from SA0PR11CA0113.namprd11.prod.outlook.com (2603:10b6:806:d1::28) by DM4PR12MB6470.namprd12.prod.outlook.com (2603:10b6:8:b8::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.26; Mon, 2 Oct 2023 21:53:33 +0000 X-Received: from SA2PEPF000015C8.namprd03.prod.outlook.com (2603:10b6:806:d1:cafe::23) by SA0PR11CA0113.outlook.office365.com (2603:10b6:806:d1::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.30 via Frontend Transport; Mon, 2 Oct 2023 21:53:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C X-Received: from mail.nvidia.com (216.228.117.161) by SA2PEPF000015C8.mail.protection.outlook.com (10.167.241.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.14 via Frontend Transport; Mon, 2 Oct 2023 21:53:32 +0000 X-Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 2 Oct 2023 14:53:20 -0700 X-Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 2 Oct 2023 14:53:20 -0700 X-Received: from localhost.localdomain (10.127.8.11) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.986.41 via Frontend Transport; Mon, 2 Oct 2023 14:53:19 -0700 From: "Jeshua Smith via groups.io" To: CC: , , , , Jeshua Smith Subject: [edk2-devel] [PATCH] DynamicTablesPkg/AmlLib: Enumerate memory cacheability and type Date: Mon, 2 Oct 2023 21:52:52 +0000 Message-ID: <4e29533888e7dbc72d0815aa4318230636a43588.1696283429.git.jeshuas@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF000015C8:EE_|DM4PR12MB6470:EE_ X-MS-Office365-Filtering-Correlation-Id: 2162f4a5-a359-4376-21f4-08dbc3920572 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: PoRNoBEEKqZee4jptyBx7xoqDW0Mg2Fdzz/cftM9znAinawOH8dPMHqQaiBtR3iAAZxEV3cvrTV7/8ZCUWQrXGAvjMm/sDs1DfVboi5UnKOqbx3X8TdVWOEBXTwo6DNIeuNljjbuEEtAh0+DzJF3cvpyuzIynxF6udhXFX+LWikYNqycGU3hH09iIEe0ePCSVyTzcomLJpIFcohiYWLK1JOCIJjjbsiPkVRGpdHWizK28qriY5ZBnmM8vTHVCg12K0ul9Nr3+HSaOlxsS+P4CrE2qmmeLfBfhlsR4M39ZNy4cGdOiH6/DhtJfMN3A2Zh2C1tlrUHKBLiSefS0g+5W8oyjXrWvjDMRyb4h+GOdR/h/TLJBCiSaGDj1Y34q9C64hFu8O/EAzK3RbpgEXf8P6Wy6OdI6tWZe78KTECMDTaeoEk+SJ7m15Liswro/qiogQizvvBuho487jHb8CPnGDtNWRH0orMk3RLjxBbL/q7yt5T3ZJRgCGsI1KlLQnISogxP3dlQhWGStR9EWZe7sVuZOsTcJfMj3qtm8yqUTcD54/s/zkdgqmglEkVpfeR9DdQQqgROk+0MjKvKJ4l9/rCbijMDR9ioqJNRqYCG2RhTEIkiA7qIfgGnIgaKvNatsOnkKWa0G67C73VKGBHFqq77sqavckcRpLHgZy2ASSBvZra1c+g4giIm5tr/UMqb4g/hZqkYd8q8+Ou1IND83XnPF3aaOatYYo/tshLSP0Cfh2S6BZmpIEkBHodcaMZo X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2023 21:53:32.5658 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2162f4a5-a359-4376-21f4-08dbc3920572 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF000015C8.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6470 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,jeshuas@nvidia.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 0z1CLBEmcsbNf4zBfVSRJWwRx7686176AA= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=FlIAIzJR; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io AmlCodeGenRdQWordMemory's and AmlCodeGenRdDWordMemory's Cacheable and MemoryRangeType parameters treat specific values as having specific meanings. This change adds enums to map those meanings to their corresponding values. Signed-off-by: Jeshua Smith --- .../Include/Library/AmlLib/AmlLib.h | 33 +++++++++++++++++++ .../AcpiSsdtPcieLibArm/SsdtPcieGenerator.c | 12 +++---- 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h b/DynamicTabl= esPkg/Include/Library/AmlLib/AmlLib.h index 510c79a399..6a273059fb 100644 --- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h +++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h @@ -59,6 +59,39 @@ typedef void *AML_DATA_NODE_HANDLE; =20 #endif // AML_HANDLE =20 +/** Cacheable parameter values + + Possible values are: + 0-The memory is non-cacheable + 1-The memory is cacheable + 2-The memory is cacheable and supports + write combining + 3-The memory is cacheable and prefetchable + +**/ +typedef enum { + AML_MEMORY_NONCACHEABLE =3D 0, + AML_MEMORY_CACHEABLE =3D 1, + AML_MEMORY_CACHEABLE_WC =3D 2, + AML_MEMORY_CACHEABLE_PF =3D 3 +} AML_MEMORY_CACHEABILITY; + +/** MemoryRangeType parameter values + + Possible values are: + 0-AddressRangeMemory + 1-AddressRangeReserved + 2-AddressRangeACPI + 3-AddressRangeNVS + +**/ +typedef enum { + AML_MEMORY_RANGE_TYPE_MEMORY =3D 0, + AML_MEMORY_RANGE_TYPE_RESERVED =3D 1, + AML_MEMORY_RANGE_TYPE_ACPI =3D 2, + AML_MEMORY_RANGE_TYPE_NVS =3D 3 +} AML_MEMORY_RANGE_TYPE; + /** Parse the definition block. =20 The function parses the whole AML blob. It starts with the ACPI DSDT/SSD= T diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieG= enerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieG= enerator.c index 9ddaddc198..7df7117352 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerato= r.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerato= r.c @@ -566,7 +566,7 @@ GeneratePciCrs ( IsPosDecode, TRUE, TRUE, - TRUE, + AML_MEMORY_CACHEABLE, TRUE, 0, AddrMapInfo->PciAddress, @@ -575,7 +575,7 @@ GeneratePciCrs ( AddrMapInfo->AddressSize, 0, NULL, - 0, + AML_MEMORY_RANGE_TYPE_MEMORY, TRUE, CrsNode, NULL @@ -588,7 +588,7 @@ GeneratePciCrs ( IsPosDecode, TRUE, TRUE, - TRUE, + AML_MEMORY_CACHEABLE, TRUE, 0, AddrMapInfo->PciAddress, @@ -597,7 +597,7 @@ GeneratePciCrs ( AddrMapInfo->AddressSize, 0, NULL, - 0, + AML_MEMORY_RANGE_TYPE_MEMORY, TRUE, CrsNode, NULL @@ -718,7 +718,7 @@ ReserveEcamSpace ( TRUE, TRUE, TRUE, - FALSE, // non-cacheable + AML_MEMORY_NONCACHEABLE, TRUE, 0, AddressMinimum, @@ -727,7 +727,7 @@ ReserveEcamSpace ( AddressMaximum - AddressMinimum + 1, 0, NULL, - 0, + AML_MEMORY_RANGE_TYPE_MEMORY, TRUE, CrsNode, NULL --=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 (#109265): https://edk2.groups.io/g/devel/message/109265 Mute This Topic: https://groups.io/mt/101722936/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-