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 C0D0C740032 for ; Mon, 11 Sep 2023 23:49:12 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=F/8RefIjg9XHJwp7ZmkXLwqIzQUwVODTGGtotfWp2Yw=; 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=1694476151; v=1; b=ATx9jYy1acYdAjv27Q4+qU011m6ek76sE3liYrk4Qg4i0BftcT2HQHG9DHE06BIImCyYQIc7 oSny18HP7LG5vccRy0hAhz11Vm2fa6HGa1yfwxYUFkQJhubvt2fB8ijX6DjIYNNkILsuyeAgH86 J7NufUgCqAS3dvTVshHT2eDU= X-Received: by 127.0.0.2 with SMTP id 2G7uYY7687511x0M5IcXTvQQ; Mon, 11 Sep 2023 16:49:11 -0700 X-Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.88]) by mx.groups.io with SMTP id smtpd.web10.13623.1694476150545680081 for ; Mon, 11 Sep 2023 16:49:10 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YEFNMxBgTqJ/ehBRG+5ij8lSrm/TmX7pbPfvg/v46EpbYO1c0Lut3Tlg0wNETmaToEj4bumFXTDLqXtXvqCLMsuZ8eZyvv6AdoMt4TskGFWSCwvTUerSt/rwrsV3XD2Uz7ORHXZF/oUbRHwRQkNOwQyrqJijKRHdJ1aG+Cz+2pkwBQ7Bs5zyJ8PLGyPv+G7o7ApYb0nirvtkOspIapjTPCKDc43fPYb60dkK9UxnhvixTIb0Ud/6zXodRCSe1wZI4x+fnI3HWNsDC9WX6MRvFn81a/ScCSQejRfAc6SseTvJ91TGrav+r+d3t6Uf63qEiJh0yeUBeqs6V6LDybjaIw== 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=YrnuRQg0L+Tu+gUsHiLyzObSyqq2Oe/2XNh6wNSsZb8=; b=XDLYHBAc38+MvDtySV+AE45J0rin2UfXY0tlHfb6jDKz1HnUBijlRXk6DVfzE+G5COm1hCm0TavUdj/KLwklrCTr/E3yxMCjMiJycIFrtnhbItsZF0hdpy3h3tbAQvti6F45ODIT9CtF7WlfrCyK2YDPg84QcKw76QZQxWJui0iRMcf3XrrNIyOh4KWmAFIs/NxZ1+BbR9QZfshrXbIOmKIhb7fwJ6JCzzCw+vo23yxJ0uCTSwhKEkrKndmGl1QMnnGTAroxjufawze7An3VIrFpciNnPqcSE0g/Us1Bboer2Vm292lYx1fIpXI9pDuTTN+5awKh6oixvH1oE2H1aA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) 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 CH0PR04CA0049.namprd04.prod.outlook.com (2603:10b6:610:77::24) by DM4PR12MB6110.namprd12.prod.outlook.com (2603:10b6:8:ad::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6768.30; Mon, 11 Sep 2023 23:49:07 +0000 X-Received: from DS3PEPF000099D9.namprd04.prod.outlook.com (2603:10b6:610:77:cafe::a7) by CH0PR04CA0049.outlook.office365.com (2603:10b6:610:77::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6768.36 via Frontend Transport; Mon, 11 Sep 2023 23:49:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) 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.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C X-Received: from mail.nvidia.com (216.228.118.232) by DS3PEPF000099D9.mail.protection.outlook.com (10.167.17.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.17 via Frontend Transport; Mon, 11 Sep 2023 23:49:06 +0000 X-Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Mon, 11 Sep 2023 16:49:01 -0700 X-Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Mon, 11 Sep 2023 16:49:01 -0700 X-Received: from ea56ec156bde.nvidia.com (10.127.8.9) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Mon, 11 Sep 2023 16:49:01 -0700 From: "Jeff Brasen via groups.io" To: CC: , , , , Vidya Sagar , Shanker Donthineni , Jeff Brasen Subject: [edk2-devel] [PATCH 1/2] DynamicTablesPkg: AML Code generation for I/O ranges Date: Mon, 11 Sep 2023 23:48:57 +0000 Message-ID: <64a84c1fedd66114f46ddd5d47ff922d68169d4c.1694475927.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: DS3PEPF000099D9:EE_|DM4PR12MB6110:EE_ X-MS-Office365-Filtering-Correlation-Id: 786cd060-cfa3-4289-2e36-08dbb321aff5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: zAah/9qTUyloItwjp5HXdj0GNedtnCqWCHSZ32Idh15Y/IV3y9n3lGlO6woD8QPGU6afTraT6GWqs6NrlFDZU8OyQZbDp6JicvDoqYLCdHsS8Nod6RB5Abf5GNRf8SxNYU/lyuzVcFFRugy6Hs3QppSyQKB3Q7CHL8YJ9l6Nr8alLFidknDTkW4bUHxt1dkf6e8JZyjBgePcjxL/xEZ27E2UkR1YRjLw2sJxD+JX6+cFstQxRaDVLSf6JW5wxghrDFZP1BpR/yB/tXp+Y6N5UZO/yn2dOfHUGSX1b7TF0gyKt3R4IQtkIz6LN+ivU0Z8PWxfH/T47QcwpUKoQFTpoh2lI8wd0mxxCOXZJ2BIQ8eKXEurLbOXrO3Y6U7xav+2omgFjNScor/a3SGpz3E4UsUxO4+5l6D5umGdiwsE+l7BvQeJkY0lLWkcMkCGRr6y+B1Hdf0O6uyUy1WVseomguCZZPx3x13C7oI3bCqM3UsXb6Go4EsTrvD3ZHcJDQVLudnPjQKPrQEGJeJKA+PxMMlLbFN4ernAQe2WMMYpixF75A6y076bRQw5XDE22dPEsFNHzhbCy7wj3PJGyZY0wsJ4mtzFU0kOiC42nLnEFpGweq9jl7xQ6fP0jLxq+wklEK3UTprkOkro2tSJfdwcCFqa7VbW6BH8g1fxKCdZSAVaVY1G0WX74V5omYICV/BiaS8xBg8NvwulyEh+gQB7MR3HW8nkf9wjvibJ0Oqn76h7IbhN0AU6wycmCFMlc1if X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2023 23:49:06.9024 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 786cd060-cfa3-4289-2e36-08dbb321aff5 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF000099D9.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6110 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: fEQGsoXyikpKqy2zzNe892qsx7686176AA= 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=ATx9jYy1; 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; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") From: Vidya Sagar Add helper functions to generate AML Resource Data describing I/O ranges of four words long. API AmlCodeGenRdQWordIo () is exposed. Reviewed-by: Shanker Donthineni Signed-off-by: Vidya Sagar 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 (#108506): https://edk2.groups.io/g/devel/message/108506 Mute This Topic: https://groups.io/mt/101305535/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-