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 5667AD8007D for ; Tue, 19 Dec 2023 03:07:07 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=p1VruESLykSTk24jf6N+bmJQy4iw9/pa/fTQEbAwXJo=; 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=1702955226; v=1; b=gQnFXYbC+YPuTUuDXkA9wTwTr2ZSvG+rubQ7vlevwVrhYaC14O/303/XOY2kC+sNVyesbb/k wCf+C2qWhmfPX3IrwteBU/yNr/na3xjL8Q0Cd5E2xgB4xT5YcH73X2DUSm4yBkxCMPKPOXVSjSx KzLzK83IpKqgD2LD/RsqWdzQ= X-Received: by 127.0.0.2 with SMTP id 0fHGYY7687511xm79P9yR2OF; Mon, 18 Dec 2023 19:07:06 -0800 X-Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.107.237.85]) by mx.groups.io with SMTP id smtpd.web10.4256.1702955225062876169 for ; Mon, 18 Dec 2023 19:07:05 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E3P+9jmxiJmkAB45zEt+JY74urRnK5hrO018gtOJtW9Fgu1JxxVjZTb+MxaxpaJI5oZpIOHVKry9PRd1ERNA0/cLuxW0TdRtsfTufVaPJQ/ZmQ6XyvvycXgh77J++PVXNCq4FJyqFb6GcpPpfJuNE7Fn5tchAEPwYLR1gVdze/915DIMZEFnW4wPHkc9jyk8haGjCnhIZeAYeVvdTZUtawz1ztc1hgl4qeyVLahR/zOUogkT5a0oKqNf9AGpaUfHzcraQwk4pKVDJAxbA1SlXiVTiCjzaMwONCKcpRbfIxF9OBT0vVV7ZqhgYwpEfo1VQC3DNfZcek1mN4DcJl8T0g== 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=U42VgR9KnDE59+eUDKx4L1GDL8NpNzsKo920tDprhHNBpe/RbSTF/GPlOJC7FmaQLZW8zXIDOzc/MlsLy1cs59cGrjdpRuo8bBOkY4ePzo9ABt5770nt9Vqh8WtzvSmBNbDfMbeIz7YxT3AZU65cBnYR3UdTIRzqyPBY9gegq6jVhaGUcDRztttL7Ss3qZBL2kfLM9/G0kPxpAy1Hdr31ekWkRlUhmqyMTatV1gPvAWtT0GqoxMonyc9IwSrbWzFpEH3VUyeTqr0Dsl+sAcjNu7pamKwrAGSmP1JmJ6qqRN/idncVDWoahsc8dPqqM5/zjIR4OHQyP5IdhFEksv/Ag== 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 MW4P220CA0015.NAMP220.PROD.OUTLOOK.COM (2603:10b6:303:115::20) by SA1PR12MB8742.namprd12.prod.outlook.com (2603:10b6:806:373::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.37; Tue, 19 Dec 2023 03:07:02 +0000 X-Received: from MWH0EPF000971E2.namprd02.prod.outlook.com (2603:10b6:303:115:cafe::94) by MW4P220CA0015.outlook.office365.com (2603:10b6:303:115::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.38 via Frontend Transport; Tue, 19 Dec 2023 03:07:01 +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 MWH0EPF000971E2.mail.protection.outlook.com (10.167.243.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7113.14 via Frontend Transport; Tue, 19 Dec 2023 03:07:00 +0000 X-Received: from SATLEXMB06.amd.com (10.181.40.147) 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 21:06:59 -0600 X-Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com (10.181.40.147) 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 21:06:59 -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 21:06:58 -0600 From: "Abdul Lateef Attar via groups.io" To: CC: Abdul Lateef Attar , Pierre Gondois , Sami Mujawar Subject: [edk2-devel] [Resend PATCH v4 1/4] DynamicTablesPkg: AML Code generation for word I/O ranges Date: Tue, 19 Dec 2023 08:36:50 +0530 Message-ID: <9cd0d6e1e596b83b623093160c4bb36ec7e3964f.1702954979.git.AbdulLateef.Attar@amd.com> In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000971E2:EE_|SA1PR12MB8742:EE_ X-MS-Office365-Filtering-Correlation-Id: 357a69db-a37c-445c-6664-08dc003f9244 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: LRnIR5ITwOYOblsTOe44ZhQWnM2eT4uVD6GSZm5acLGQClwQ4hFIvio+BYXtcPyYNPqKO2o8fH7qkGcpE5hBig7fDCelngWelU5kOBHSQAjFzuexyoW86AMGrQ6rWFPgJ0aZbR+5HiDMLet5vuSc7eA8IcqAs4Jhgc9hZiA+e07OgnSoFjcR5b+BsSMHDWPFAApKThyuAX/bwNCic1HQd9t/NV8VhIqrClu0prKK1jJSntzGAawCwmIsxxPugrjaz+d6vY71Na/G754ltKoUCPtezARz3D1oEfBItZp1R9XDxspmp//o1CwfC+0ea4nRvYv7gQNZ4FcULZw8DOBTbvIj8uGHFfJ/z1o/VkQhyxM/HlyExN8DhppTGBuFImqkd1SDYOYfyaUT/8BHh8SjeiW2FKjA8cv5sKXR9UW3txDC7y2ubItk/P2aEnd1KjKjqEtlBWokTlbVRzFeQ/G1huY25Nbsypkqd0M7ta6fMJXl7+YSTx3Ycle0wBMhJlhGjj14SSdgvlICJgxdCpxVposVEkw/R+975ZBudNtknGFHDEaDzd/xiJ3PbRXNkU0dN++Gsyl3qN/F7/sfnuArMMqXhB316Ob5x/Qa9NvqBZmK3FyVTWgnYvV3QwL+nerCZMvBE436emINbxIyAbN0grVobQNrhQxnRIJoBp0rgHSzwuE9GKzl60Lip6gVUjnJ+eN0QJzmqcDsE61aQ+/MqwFBjofKaTTMwkVz9P4bdRirftG8MaHEW2JwnLozlmApk5fXLcBYRBYyjk5RHSEr9Q== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2023 03:07:00.5569 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 357a69db-a37c-445c-6664-08dc003f9244 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: MWH0EPF000971E2.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8742 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: E5RYE8Rz8fJCtJjjSjiiAjTAx7686176AA= 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=gQnFXYbC; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=none; 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 (#112669): https://edk2.groups.io/g/devel/message/112669 Mute This Topic: https://groups.io/mt/103256859/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-