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 80231941490 for ; Mon, 11 Dec 2023 10:37:44 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=7N7gS9JmiDoL1jfIUJrXbk8zIrxJ+VE4OPekl5nkGF8=; 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=1702291063; v=1; b=GYUQKHWdf1Ul8tBY1aynWprt3hqWmt/ZlkPTVEQcI0OOLqp73iRZeth0Ee+glUkBH0FjAhED RSPfNGZO9pJ1gYh0NyQj0NilHAdqdoiOswNXYnw1y9tHlTDnyrvYaC3ZpBoP88ZThSv7GHWqAGO 79DO5KH6gRYVX/XVL6mXnYGw= X-Received: by 127.0.0.2 with SMTP id q1BvYY7687511xBHHQvmQ6cg; Mon, 11 Dec 2023 02:37:43 -0800 X-Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.55]) by mx.groups.io with SMTP id smtpd.web10.5611.1702291062361975322 for ; Mon, 11 Dec 2023 02:37:42 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gcW+IDP/Kmm05obx2XKNDNp3sqqhS1VzxL+mBdTOUIpGQSn0ahOIS2h/c70orge5YY7yy4c2JNOkwgMbBtx1Jl8dbvBN9www28eOJC0NsmWMTWAW1V4KKLotXACKOmzWZ1siNeJBkzXzXBI7WTW5qhCA3J7dLauj0AGcMwlWzq+BOeHaSRS35re7v+dFi2DmmmqTPA1a715Jga5ZEYen28XwJ4bLghWZjbLGJzCP8uIDATMwaYNKAwJkqX63OI7fOYre36Mn0ERoKD0umlRFQxv8v+0nFzErIaDeJQ20xFyy2RFM7yMEiNVE5N4TM9cjG6O0cOFqIZPbvTEjIoJ61w== 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=kS9MMwBZ4cFDzPwKn5dgKFC3GuyMq1ZN7j9sRnTgvz8=; b=n5dHHl0yYbcjuz+Jd3+RCz4z+o+VlbiW9MSBaRPmcdSB2gSwFW++yxEHA6IdTCmT0DV3gfmjc94AVIaWlsMgbOGc2TDyZPrmHJGTm1tiNNBZXTTfB2iH6PznWrBlFhqQVr6cJTb4gPWLUiM979Pek3FqF8kqBpC5c8PG/nLhh8FAh2RllIgtVrb0yCTBBmwm8JOthGndUHQrqssM6LbIv/BeX3fUJSgRL2Oi67uhaIaHpIkETBunq8eEkYNV4cXmqPECURWJcjGtRK2cTOqcKq4MFfE2PxTYiSjJ0Yf22zXisNJtnw6dRzVaqiKBMHdXBDvjwEeYq3hlRhlQf4grAA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) X-Received: from MN2PR03CA0020.namprd03.prod.outlook.com (2603:10b6:208:23a::25) by MN0PR12MB5812.namprd12.prod.outlook.com (2603:10b6:208:378::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32; Mon, 11 Dec 2023 10:37:39 +0000 X-Received: from BL6PEPF0001AB52.namprd02.prod.outlook.com (2603:10b6:208:23a:cafe::5) by MN2PR03CA0020.outlook.office365.com (2603:10b6:208:23a::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32 via Frontend Transport; Mon, 11 Dec 2023 10:37:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF0001AB52.mail.protection.outlook.com (10.167.241.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7091.18 via Frontend Transport; Mon, 11 Dec 2023 10:37:39 +0000 X-Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Mon, 11 Dec 2023 04:37:39 -0600 X-Received: from BLR-LAB-SFW01.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.34 via Frontend Transport; Mon, 11 Dec 2023 04:37:37 -0600 From: "Abdul Lateef Attar via groups.io" To: CC: Abdul Lateef Attar , Pierre Gondois , Sami Mujawar Subject: [edk2-devel] [PATCH v3 1/5] DynamicTablesPkg: AML Code generation for word I/O ranges Date: Mon, 11 Dec 2023 16:07:29 +0530 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB52:EE_|MN0PR12MB5812:EE_ X-MS-Office365-Filtering-Correlation-Id: 7af781c8-3770-431e-205b-08dbfa3532de X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: zKR8D5mAqFGN1Sj2wZ93E/2V+L/09oGiWeZWOlFQVITaafGOZK2PoIkFLLrd3gOB32sMKFtdK8PRffUozFDHgiqz1NKtO2QFWqyQbMJn5MGDcSNS6Xo62y6yLeb3M9tqO+/558ci3ZCpJxJTFRklX6btSxEq4rbnOUrKdpRfUPfofTH71+OdIB1J1l1TAfrEEmU9/pjfNK7SJ/xNGU5llb2MvIfl7l2Y9eYybU0QIOsYysg49KQ4U5fxIXWC3ZkA4qC4mQxgyZvIa6e0rLrgKgSirKWf6xW9+Uis0Cwct7KyxbS/PIPJ1S9hfUyS6vr/jQDGAH2LQkv65dQwWbNWxOAZkOzFzsPCWsbwZiUs6D4X0d46rxXcc2Lv+ejeK7576iJiw5IBu2O/JJWtJAxfnuJVIlnefAVUm51YKHhG3Rd8EljoXlZ324VxvyhDPZyYn6ER+IOeXrFfuWy8qoy9OQctlyfKDyT2Mkt4xdsebQ02+B1o8kyyC7nrhZ+1jSHSFLM9V+gMaJruwUh3+WFI2+LHQBQaGHxN3CdGBoHXx1CJHd3Jh3c583F0lymFDN6HUPcboRx/SIgUpUw0850D88TJQt6LIcGS0JvEzXcJpbQgxKmxMviO8dfardzhyR95GqezPPgYrhjqwvtsCUKsfXHtr6NUP+bkhQzycGiZNrhdL2XNiypr1hGKk5e2sNV5Bf7ch9LnLIh8COjka9kwIs7/YeYr+HyD0KofkHAcnaVFLbsygo6cd2UBioo1fXWdvLSRPbckYB0AWHsP31OScg== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2023 10:37:39.6217 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7af781c8-3770-431e-205b-08dbfa3532de X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB52.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5812 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,AbdulLateef.Attar@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 9JNc1t7LFeT2JSSk3zaxsbqJx7686176AA= 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=GYUQKHWd; 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: Abdul Lateef Attar Add helper functions to generate AML resource data for word I/O. Cc: Pierre Gondois Cc: Sami Mujawar Signed-off-by: Abdul Lateef Attar Reviewed-by: Pierre Gondois --- .../Include/Library/AmlLib/AmlLib.h | 65 ++++++++++++++ .../AmlLib/CodeGen/AmlResourceDataCodeGen.c | 88 +++++++++++++++++++ 2 files changed, 153 insertions(+) diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h b/DynamicTabl= esPkg/Include/Library/AmlLib/AmlLib.h index 71e8539b30..5e340b94ce 100644 --- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h +++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h @@ -2,6 +2,7 @@ AML Lib. =20 Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.
+ Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -724,6 +725,70 @@ AmlCodeGenRdWordBusNumber ( OUT AML_DATA_NODE_HANDLE *NewRdNode OPTIONAL ); =20 +/** Code generation for the "WordIO ()" ASL function. + + The Resource Data effectively created is a Word Address Space Resource + Data. Cf ACPI 6.5: + - s6.4.3.5.3 "Word Address Space Descriptor". + + 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. + + @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. + Not supported. Must be 0. + @param [in] ResourceSource Resource Source. + Not supported. 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 +AmlCodeGenRdWordIo ( + IN BOOLEAN IsResourceConsumer, + IN BOOLEAN IsMinFixed, + IN BOOLEAN IsMaxFixed, + IN BOOLEAN IsPosDecode, + IN UINT8 IsaRanges, + IN UINT16 AddressGranularity, + IN UINT16 AddressMinimum, + IN UINT16 AddressMaximum, + IN UINT16 AddressTranslation, + IN UINT16 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 "QWordIO ()" 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 0bc1c1d119..60fe69ba6d 100644 --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen= .c +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen= .c @@ -2,6 +2,7 @@ AML Resource Data Code Generation. =20 Copyright (c) 2020 - 2021, Arm Limited. All rights reserved.
+ Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -878,6 +879,93 @@ AmlCodeGenRdWordBusNumber ( ); } =20 +/** Code generation for the "WordIO ()" ASL function. + + The Resource Data effectively created is a Word Address Space Resource + Data. Cf ACPI 6.5: + - s6.4.3.5.3 "Word Address Space Descriptor". + + 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. + + @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. + Not supported. Must be 0. + @param [in] ResourceSource Resource Source. + Not supported. 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 +AmlCodeGenRdWordIo ( + IN BOOLEAN IsResourceConsumer, + IN BOOLEAN IsMinFixed, + IN BOOLEAN IsMaxFixed, + IN BOOLEAN IsPosDecode, + IN UINT8 IsaRanges, + IN UINT16 AddressGranularity, + IN UINT16 AddressMinimum, + IN UINT16 AddressMaximum, + IN UINT16 AddressTranslation, + IN UINT16 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 AmlCodeGenRdWordSpace ( + 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 "QWordSpace ()" ASL function. =20 The Resource Data effectively created is a QWord Address Space Resource --=20 2.34.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 (#112283): https://edk2.groups.io/g/devel/message/112283 Mute This Topic: https://groups.io/mt/103106347/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-