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 BDB4278003C for ; Wed, 20 Dec 2023 09:39:04 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=7eFjCQqgxBK7n01OTfgWcbNWaI3hit+mETufqpS7T2w=; 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=1703065143; v=1; b=NMaUuYrKykg8GHkT+mCQeW1VjddgPHkJ7xahSv3IWfe+ymghB73ETi67XSwijJyYbuTkuxrQ Phr0CXgSF58AZdZbbTJI+z7/3tJOtoGBJ3d7w7lr7u1NGln33zXjSWC6gGLhNvqgdcBC3K4qHNp GDWZKiTbbhUmoTdZWZFNyg1s= X-Received: by 127.0.0.2 with SMTP id VSRlYY7687511x6wFxpSYbHB; Wed, 20 Dec 2023 01:39:03 -0800 X-Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.82]) by mx.groups.io with SMTP id smtpd.web10.18450.1703065142853712657 for ; Wed, 20 Dec 2023 01:39:03 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lnKyy6S+tfBJfOSVr0R9sUDNftD0LaIjISR8OsSAfUoTzZMDK99Xnv/AOPv8apPZB+uoyK56lx3BQqtFlb/EV9QAWTW1mun9jvBv34EGmlI+UKRJ1c8cX0Zsw69ZWY8gQdN/6fW2oBoW8ucV1617o6FwIg+2iiKe6z88rKu35dRTfEVMsP2OMYg1hx5ju8jNRr2FBOlRvQ0to0/rs/txoTO7nOgWX7kn1Jsgvyg9SmpvRccBRC3GGcb8LGQ6kvVeYxzj17ayIKwa6wBx6Iw3ChPTbPP8qs87JChTRKmjX6sxtC5aNjO4F05wI1hKh/qX3F1hhZzUPo8nwfx7aexyWg== 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=Lp6XyIjbF/g9H7z+JzfE7usrcId5PlS6BO23InPCXeVkJ9+k2vT4Op1Nk1QWGomycFTZnRpt22m0E5R0FzGqluzUh+f1lhvF6U88Z+oBraY488uKqQ0wYWZfn49nr81sqh0XN2cN4wPzX++v87LZLIb6a4Tayi+pSAL8TqP+CqTWoxu3Pz64qh65P1RsoEnHOf1b3d2cwMqBfzV0dNppMaE7qo2VesaYegD+57vN1u/CL7zWSZY+TpCDtcpbR266rQl29MyCHzjBVoJyZnlFkwfoldSO3Pw2UQ/HPZpX3MNAwEkA9ZDx/Y1JNlYKuE570Mx39bylRth53zznHJj8vQ== 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 SA9P223CA0028.NAMP223.PROD.OUTLOOK.COM (2603:10b6:806:26::33) by CH3PR12MB8933.namprd12.prod.outlook.com (2603:10b6:610:17a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.18; Wed, 20 Dec 2023 09:38:59 +0000 X-Received: from SA2PEPF000015CA.namprd03.prod.outlook.com (2603:10b6:806:26:cafe::f2) by SA9P223CA0028.outlook.office365.com (2603:10b6:806:26::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.39 via Frontend Transport; Wed, 20 Dec 2023 09:38:58 +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 SA2PEPF000015CA.mail.protection.outlook.com (10.167.241.200) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7113.14 via Frontend Transport; Wed, 20 Dec 2023 09:38:58 +0000 X-Received: from SATLEXMB05.amd.com (10.181.40.146) 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; Wed, 20 Dec 2023 03:38:58 -0600 X-Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Wed, 20 Dec 2023 03:38:57 -0600 X-Received: from BLR-LAB-SFW01.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.34 via Frontend Transport; Wed, 20 Dec 2023 03:38:56 -0600 From: "Abdul Lateef Attar via groups.io" To: CC: Abdul Lateef Attar , Pierre Gondois , Sami Mujawar Subject: [edk2-devel] [Resend PATCH v5 1/4] DynamicTablesPkg: AML Code generation for word I/O ranges Date: Wed, 20 Dec 2023 15:08:48 +0530 Message-ID: <5b55e437561bb634f848050fb170b804c519c7ec.1703064925.git.AbdulLateef.Attar@amd.com> In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF000015CA:EE_|CH3PR12MB8933:EE_ X-MS-Office365-Filtering-Correlation-Id: 65f492ab-811f-4f44-892e-08dc013f7df7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: AnTNaPAdeLB4EQT8nA18BQqe7n6UYrKq3alvnN0dNxoFMcYYbZHsl1dft5iy1t9CEAdBrYtXhcQFjYWd9KLCou4wdemUNT42HTrrSaaIUz2BNY2R73rXXHrw99o+QgOyGt0tlqY+c95O5JSxEw/00VyQFVonhLv9OtpOwV3CnJwWOb0DGK+x9O8TdirxBD620wAd40dTkkc/dcaSm67FmZlZbEEXo/7CbBcTTiIiVG4F+GzEdRdBi2tD/Clq2nxXWZ38otzLF+gt2p0PVSwGB/SpPoQkkx1ZyRnEhELl+OTX1jiyjMWrhTmvHCLI+n9e+ik+YIutrIvgTaePI2jntgyg34dWW+Izmn+OyyzJnIHwPPKcvu6Xun7qGPZcyRw1ZL0bcKegPQCrj+b3OjJL7Xcr6gMe+R3RmKY24XNg5xgKa38PLHtN7I+z85GOUgVoYFqJK1+VmM0NHedgtrqFR2OgIsSoWB2CyKv4avaGy7n908vFSIy3WUhmnK3ex262upzRWRSqz8mcac5HQPT3B15ZNReZRuDb1KDamV4abBx4QV36d/x6BjoGx3oIHwF99b62gpn1r1Xf/2tRLBmokMhIbrk+9OhjSq6fwp2s//vjU92M3cR1ODiRLzPG2RZvfahOxioUYlHO+iYIEveDeam6nE2WO2WtEO+Q3fDlkI4C3oEqjtCF2nqLps/b27MUOSvBoggn+X7KAZPT8ZFsPXTpQAqbwcys4/E+vQ/Rnbbr+aFfFfMz74DjymAVvOx/Yu8Ip0d802tMApjbUEQOIA== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2023 09:38:58.6928 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 65f492ab-811f-4f44-892e-08dc013f7df7 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: SA2PEPF000015CA.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8933 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: mgnoNL0qihzGwQon2cK94ADGx7686176AA= 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=NMaUuYrK; 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: 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 (#112754): https://edk2.groups.io/g/devel/message/112754 Mute This Topic: https://groups.io/mt/103278518/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-