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 14E7C7803D7 for ; Thu, 21 Sep 2023 20:10:29 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=kMx6oegA4vHYxozXgrFdXx13KDIaXkrXbbGi/KMv4z0=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1695327028; v=1; b=oy1h4rkwCh8u1MJ8C5GHwgqWlFBJiAcvEIuUMTXAMOon1MaLjlgQ6gXlXMLJNvQMWfEvm+NI InAFNNvuzh+UBYF6VGbUM0DpSKFmlHdhZIz9xCtfxGVdET9gA+h8k5bawIR4coA/713A0rQH4Ww sE05CAhA9lnaYQGdLD9Cx7Fs= X-Received: by 127.0.0.2 with SMTP id p4WNYY7687511xbtJ40FRytn; Thu, 21 Sep 2023 13:10:28 -0700 X-Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.107.237.53]) by mx.groups.io with SMTP id smtpd.web11.6002.1695327027864244081 for ; Thu, 21 Sep 2023 13:10:28 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JePHWILdsGB3RLy4n/oEUPeRHn61KfG99UFCvmiuE+hBkRx5omZ8QhxmWqgdNMLKToqyoAhzLSzVbIjuCDQGaT+Ek0gZubNri56vvmsbJpsS39cjOzcPJrWJbqIxXB18jFgK+3ASIFbRcmjuAOVR1+JK4qUHZLWeKrlv4PZ24B/qn/Z0uSqEe6CeaSZ7Vr12gtZGUQBvF5g5PBHtSyaww4E4p/ygb+mTQghZNoTeFLT6f70sFO5T8JaF8SQrDpzkb3e2W4rrth+desyjQqTvS0GRL3jJ/61/KNmBG3kZDwQYhBq5/t5KRhiJjle+ptS1X7zgA7Y8VxlKX5f3Jmtl4g== 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=TjXehPHFt1Ip+6lyhHb5SF5Qww3mKD1YeQO83+1pElQ=; b=dvyVGICbWXdsbl9iln9u3tTo5RWfG/OTwE8FveEbkpBZ5iBst7ABaRbCn1F3EZjLSKtXrEK79xP0qOm0smeFwXYg57KcO6F6lM9Ph97V1fzIrXdr8KS044axGtp7Mg+HWCX4m/5JnbShL5Y3usyiiNNyxyTW+vlKQ4bTHZe+K9Fs8fqZEp4xng3ZHEdHfsYu8JQ9jvyeAsoOejcq4yTLMty4xE88DVWktsHAHgMIPxosCz7YVKPu5UN+wgW8MA9CFycSBBCxtNKOMDU9ZiS9CXukh/VRF2HQ30TMgMFmietBLUY7Lt3mOnxBEmFYA4Z7bAwuP/vz71bb90/aHJf2PQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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 CH2PR08CA0015.namprd08.prod.outlook.com (2603:10b6:610:5a::25) by SN7PR12MB7021.namprd12.prod.outlook.com (2603:10b6:806:262::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.19; Thu, 21 Sep 2023 20:10:24 +0000 X-Received: from DS3PEPF000099D8.namprd04.prod.outlook.com (2603:10b6:610:5a:cafe::f) by CH2PR08CA0015.outlook.office365.com (2603:10b6:610:5a::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.31 via Frontend Transport; Thu, 21 Sep 2023 20:10:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C X-Received: from mail.nvidia.com (216.228.117.160) by DS3PEPF000099D8.mail.protection.outlook.com (10.167.17.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.20 via Frontend Transport; Thu, 21 Sep 2023 20:10:24 +0000 X-Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 21 Sep 2023 13:10:09 -0700 X-Received: from rnnvmail201.nvidia.com (10.129.68.8) 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; Thu, 21 Sep 2023 13:10:09 -0700 X-Received: from a91351b90548.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.41 via Frontend Transport; Thu, 21 Sep 2023 13:10:08 -0700 From: "Jeff Brasen via groups.io" To: CC: , , , , Vidya Sagar , Jeff Brasen Subject: [edk2-devel] [PATCH v2 1/2] DynamicTablesPkg: AML Code generation for I/O ranges Date: Thu, 21 Sep 2023 20:10:04 +0000 Message-ID: <3d2ed45691dc73aff43de1351ebb965694c3c51f.1695326850.git.jbrasen@nvidia.com> In-Reply-To: References: MIME-Version: 1.0 X-NVConfidentiality: public X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099D8:EE_|SN7PR12MB7021:EE_ X-MS-Office365-Filtering-Correlation-Id: 7ffa674d-d27d-47fb-f556-08dbbadeca71 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: yz2grSPI5RKQMFNYTyejXbM16EnEMhHyFE76yw6CbSyWuXM5fTmHnKuSNWn6aG/Q85PotLIIgeljHRmneItdTOAO9EugWCrPbB3+K7v3hWu1hDmvYo3j6+P0tyC465PsTvJj3lTOU1FFOgupbIDs0GcN1AlG3RNfiAe4jRoPydUUutBEWUdwZTBkgPTTTqNSX1RxfdvQ7nIjXBcOvZ3apSslZCHHCChZfnyRyUS/bKENRU3OhqMTZxwK56n1vC1A6JXr34md08xS1bvqE87bMpV/DHaxxhfxr3wlea9+SOkcndT/m5CYKaeULPhmQ5XiyNwna36KIC0NlijgA+//IaMlkFD2l2/MpoXgjprgV3hlWRhnklpWXbuDSz6xo6YHFQqrU93/6AgBsqCqGMMtWc7VSP879WlbvjHYJUyD4QW6yCXmQn4sF/cYWSuCCFL9akRLP8rK6ERRe9KBCueYxKLfRvb9mlbdXpHxkYhMuEmRLxoyg82oNY5seZLYeE2Z9MYDcRWnqltfhevl7S1mHozjuYtzEKDG3UgZhJrCFS3lr5VEmYaAljpv9yfeNbPH3zNFNYJRLqTFynsbCu2XV4kcnXAGXzBZQ1MqLg7D60B7MVspFytUdMpFlLKoUkkr/WbeA85XLlQMSNpETMCc7UUZSy6kh0FKW2qjkZl4d9y7+stXghdxHTrJx3M7AngAISnOrzyzMAsJ0mud9/KDxGT1o52SZHdLxwmJNyPiQlQ/UcB4StkVjwZq1OLx0i9/IA0Sq9AdcaqVewh2AP+Abg== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2023 20:10:24.3466 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7ffa674d-d27d-47fb-f556-08dbbadeca71 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.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF000099D8.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7021 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,jbrasen@nvidia.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: mZs6RvWVLev3hn33yEBgxYGfx7686176AA= 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=oy1h4rkw; 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 From: Vidya Sagar Add helper functions to generate AML Resource Data describing I/O ranges of four words long. API AmlCodeGenRdQWordIo () is exposed. Signed-off-by: Jeff Brasen --- .../Include/Library/AmlLib/AmlLib.h | 67 ++++++++++++++ .../AmlLib/CodeGen/AmlResourceDataCodeGen.c | 90 +++++++++++++++++++ 2 files changed, 157 insertions(+) diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h b/DynamicTabl= esPkg/Include/Library/AmlLib/AmlLib.h index 9210c5091548..8e24cecdd77b 100644 --- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h +++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h @@ -683,6 +683,73 @@ AmlCodeGenRdWordBusNumber ( OUT AML_DATA_NODE_HANDLE *NewRdNode OPTIONAL ); =20 +/** Code generation for the "QWordIO ()" ASL function. + + The Resource Data effectively created is a QWord Address Space Resource + Data. Cf ACPI 6.4: + - s6.4.3.5.1 "QWord Address Space Descriptor". + - s19.6.109 "QWordIO". + + The created resource data node can be: + - appended to the list of resource data elements of the NameOpNode. + In such case NameOpNode must be defined by a the "Name ()" ASL statem= ent + and initially contain a "ResourceTemplate ()". + - returned through the NewRdNode parameter. + + See ACPI 6.4 spec, s19.6.109 for more. + + @param [in] IsResourceConsumer ResourceUsage parameter. + @param [in] IsMinFixed Minimum address is fixed. + @param [in] IsMaxFixed Maximum address is fixed. + @param [in] IsPosDecode Decode parameter + @param [in] IsaRanges Possible values are: + 0-Reserved + 1-NonISAOnly + 2-ISAOnly + 3-EntireRange + @param [in] AddressGranularity Address granularity. + @param [in] AddressMinimum Minimum address. + @param [in] AddressMaximum Maximum address. + @param [in] AddressTranslation Address translation. + @param [in] RangeLength Range length. + @param [in] ResourceSourceIndex Resource Source index. + Unused. Must be 0. + @param [in] ResourceSource Resource Source. + Unused. Must be NULL. + @param [in] IsDenseTranslation TranslationDensity parameter. + @param [in] IsTypeStatic TranslationType parameter. + @param [in] NameOpNode NameOp object node defining a named ob= ject. + If provided, append the new resource d= ata + node to the list of resource data elem= ents + of this node. + @param [out] NewRdNode If provided and success, + contain the created node. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_OUT_OF_RESOURCES Could not allocate memory. +**/ +EFI_STATUS +EFIAPI +AmlCodeGenRdQWordIo ( + IN BOOLEAN IsResourceConsumer, + IN BOOLEAN IsMinFixed, + IN BOOLEAN IsMaxFixed, + IN BOOLEAN IsPosDecode, + IN UINT8 IsaRanges, + IN UINT64 AddressGranularity, + IN UINT64 AddressMinimum, + IN UINT64 AddressMaximum, + IN UINT64 AddressTranslation, + IN UINT64 RangeLength, + IN UINT8 ResourceSourceIndex, + IN CONST CHAR8 *ResourceSource, + IN BOOLEAN IsDenseTranslation, + IN BOOLEAN IsTypeStatic, + IN AML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL + OUT AML_DATA_NODE_HANDLE *NewRdNode OPTIONAL + ); + /** Code generation for the "QWordMemory ()" ASL function. =20 The Resource Data effectively created is a QWord Address Space Resource diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceData= CodeGen.c b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataC= odeGen.c index 4ca63ccd2396..9c6700b9e08c 100644 --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen= .c +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen= .c @@ -1012,6 +1012,96 @@ AmlCodeGenRdQWordSpace ( return LinkRdNode (RdNode, NameOpNode, NewRdNode); } =20 +/** Code generation for the "QWordIO ()" ASL function. + + The Resource Data effectively created is a QWord Address Space Resource + Data. Cf ACPI 6.4: + - s6.4.3.5.1 "QWord Address Space Descriptor". + - s19.6.109 "QWordIO". + + The created resource data node can be: + - appended to the list of resource data elements of the NameOpNode. + In such case NameOpNode must be defined by a the "Name ()" ASL statem= ent + and initially contain a "ResourceTemplate ()". + - returned through the NewRdNode parameter. + + See ACPI 6.4 spec, s19.6.109 for more. + + @param [in] IsResourceConsumer ResourceUsage parameter. + @param [in] IsMinFixed Minimum address is fixed. + @param [in] IsMaxFixed Maximum address is fixed. + @param [in] IsPosDecode Decode parameter + @param [in] IsaRanges Possible values are: + 0-Reserved + 1-NonISAOnly + 2-ISAOnly + 3-EntireRange + @param [in] AddressGranularity Address granularity. + @param [in] AddressMinimum Minimum address. + @param [in] AddressMaximum Maximum address. + @param [in] AddressTranslation Address translation. + @param [in] RangeLength Range length. + @param [in] ResourceSourceIndex Resource Source index. + Unused. Must be 0. + @param [in] ResourceSource Resource Source. + Unused. Must be NULL. + @param [in] IsDenseTranslation TranslationDensity parameter. + @param [in] IsTypeStatic TranslationType parameter. + @param [in] NameOpNode NameOp object node defining a named ob= ject. + If provided, append the new resource d= ata + node to the list of resource data elem= ents + of this node. + @param [out] NewRdNode If provided and success, + contain the created node. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_OUT_OF_RESOURCES Could not allocate memory. +**/ +EFI_STATUS +EFIAPI +AmlCodeGenRdQWordIo ( + IN BOOLEAN IsResourceConsumer, + IN BOOLEAN IsMinFixed, + IN BOOLEAN IsMaxFixed, + IN BOOLEAN IsPosDecode, + IN UINT8 IsaRanges, + IN UINT64 AddressGranularity, + IN UINT64 AddressMinimum, + IN UINT64 AddressMaximum, + IN UINT64 AddressTranslation, + IN UINT64 RangeLength, + IN UINT8 ResourceSourceIndex, + IN CONST CHAR8 *ResourceSource, + IN BOOLEAN IsDenseTranslation, + IN BOOLEAN IsTypeStatic, + IN AML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL + OUT AML_DATA_NODE_HANDLE *NewRdNode OPTIONAL + ) +{ + return AmlCodeGenRdQWordSpace ( + ACPI_ADDRESS_SPACE_TYPE_IO, + IsResourceConsumer, + IsPosDecode, + IsMinFixed, + IsMaxFixed, + RdIoRangeSpecificFlags ( + IsaRanges, + IsDenseTranslation, + IsTypeStatic + ), + AddressGranularity, + AddressMinimum, + AddressMaximum, + AddressTranslation, + RangeLength, + ResourceSourceIndex, + ResourceSource, + NameOpNode, + NewRdNode + ); +} + /** Code generation for the "QWordMemory ()" ASL function. =20 The Resource Data effectively created is a QWord Address Space Resource --=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 (#108970): https://edk2.groups.io/g/devel/message/108970 Mute This Topic: https://groups.io/mt/101508458/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-