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 333B7740035 for ; Mon, 18 Dec 2023 16:12:43 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=H9tqRU+x9GdUzKtZkljo2WnUXA57WWYNH1mIEb7NkRA=; 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=1702915961; v=1; b=HeCSrKRqE2plStFRVitxUN+I+UQraos1mOwZIr/VKtrSNTQ4X+Yldf9Oh/1yzfSbYg3Upy2X G/8jhytVCba0Y/18jdyE/LmRZo05Zpw8u9JjgFAp91ftO16bKAedXmIxlA7druEkbo1oMXDifoh vkyG8XUc9dPV7tdbLHGvEVGk= X-Received: by 127.0.0.2 with SMTP id 58LnYY7687511xJGelxr6PWN; Mon, 18 Dec 2023 08:12:41 -0800 X-Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.40]) by mx.groups.io with SMTP id smtpd.web11.47611.1702915961105466028 for ; Mon, 18 Dec 2023 08:12:41 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TQc4Ln/wzru3j+kiIK0FwVpSppGR0ZOv+HYQtf3rvYv4faGYwzHQD8d5TLccCzPnwEpwBFjrE10fFWucSZTA2OW2aB2OeBKSjJ6Yvu3jwOmaaxk69Lz5B8sYSpm87zBhzW0iEMusCoG9328dcZ5pJHXrgU7dAVmIL6baJr52+INdhWICJlUW6qGpBm5EmmLqBwLcEXJensQHjYBykV5Y85f6RGm5Js9hFDIZcySHEaUQqbTCVlxVP6rIb/hYcD5uSt//kEdyj3Ciqmz5CNYodzTIcN7PbJWlq8Put3rhvPArZ8SmQXHlnMUlFWaa5O1dQOODrNgZM3o+qk8tXO4+eA== 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=l5QXW6tNbTrDvdF/cJ5Mb+D16eGufifC7FEX3u8t9IaJAPYKDuT82AxAJF7C1YGuKRedgSe7mAZnL5ZatNdJoxY+v3pJPLa/Jl7XAhh12VN11dhocd9xdu1hxI3gdwkSOWwjxZigedu7RRmmG23sBdEIdHGS7Dzz3TueWeO5cMEAkpBlL+wGWtzDAdVfufeJJMWW4vSgAy8+wa5RA5TtYPEfuATwKYZShBMMJ+iqqVvtUsO/JeNduQ3N5Ss0/UGT9KSwWzwWb2SlaKftfJunPLUiQBTzUjz5W6e2SbWPMukV4QM+Ejp0tIjwL7r1jeTDB9YycJAgNX8h+5eliMVolA== 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 BYAPR08CA0035.namprd08.prod.outlook.com (2603:10b6:a03:100::48) by CYYPR12MB8938.namprd12.prod.outlook.com (2603:10b6:930:c7::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.38; Mon, 18 Dec 2023 16:12:38 +0000 X-Received: from CO1PEPF000042AB.namprd03.prod.outlook.com (2603:10b6:a03:100:cafe::9f) by BYAPR08CA0035.outlook.office365.com (2603:10b6:a03:100::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.37 via Frontend Transport; Mon, 18 Dec 2023 16:12:38 +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 CO1PEPF000042AB.mail.protection.outlook.com (10.167.243.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7113.14 via Frontend Transport; Mon, 18 Dec 2023 16:12:37 +0000 X-Received: from SATLEXMB04.amd.com (10.181.40.145) 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, 18 Dec 2023 10:12:37 -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; Mon, 18 Dec 2023 10:12:35 -0600 From: "Abdul Lateef Attar via groups.io" To: CC: Abdul Lateef Attar , Pierre Gondois , Sami Mujawar Subject: [edk2-devel] [PATCH v4 1/4] DynamicTablesPkg: AML Code generation for word I/O ranges Date: Mon, 18 Dec 2023 21:42:27 +0530 Message-ID: <9cd0d6e1e596b83b623093160c4bb36ec7e3964f.1702915458.git.AbdulLateef.Attar@amd.com> In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000042AB:EE_|CYYPR12MB8938:EE_ X-MS-Office365-Filtering-Correlation-Id: 13c346a2-4625-47ff-0ba9-08dbffe42751 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: O4i9FFUzpXGI8Kcx4z+Zmwb0StmIgQvvA0UbLTWj7HQV/WNUNTu3TOB/KDhd8G6GAex3vUYFtVHGtRkT9BRxNrHdCuxrmV2iVcmPecNPvofMxXXTVVBMYhLY1qUdlcf9KEUU/NwZEkYZdKFoyoGgjhU9Pt1goEo7eD6bU8c1T6WblXgnSTZzZ/oYMrtua4nEjxShmK8EtPQ0iNKQUkMN6uIRldrVhTnZ3z1s4LFawtWobWqFX1H9u3IhYRO4D6cF2TvmW1tceGMvMnFYmND5ki7RY5SpNZYt+n4wOqwQtHAbN5UFj/Z6yjY7ZI6o0nKtHLgIo+SVI+Aus7gz6PNWHArGf61fbVpP2Q02k0jmInILhzk3DkZxFMd1hhGv1okvESxldXhsFRDpWT9t40iko/gsNxuvOydy2uas0qOjrbUuIvM03OLGsXSKV6rpi2Etf2i1cK98mxtAfRfMlNKdvuRyyvubc8eSxF7lSXSvl0c/Vo86jjVsM8yy6I2sLT4+wSGIKfx+22BjJIRJjHFfuqx324kdfvPlaSgVxqvMRNd4bShOTUYZ5NdEYrG1Vfd30jYvSdnaQYb2VJoGB2krln3hlUDwpzFc2JIKj4F6CkKGKWBlOWiWG8t8T0qCTu+41swWO/I5IYbM5x6Q8RI6GW2KW9m3aItcGh8VVadoyYvWcZ6nsEI8DCA0Wk8B2U3ap4WjxpvBIzEQPvZsAQ1ZoOmP0wqL8pTn4Tv48UKW4yW9Gelb4g/YenBemN3y5B36DO45/l+e8BgpwpLVdunClA== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2023 16:12:37.8118 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 13c346a2-4625-47ff-0ba9-08dbffe42751 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: CO1PEPF000042AB.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR12MB8938 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: c62S6Ce8V8MfnkOsxEsO0gIyx7686176AA= 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=HeCSrKRq; 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: 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 (#112648): https://edk2.groups.io/g/devel/message/112648 Mute This Topic: https://groups.io/mt/103245324/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-