From nobody Sun Apr 28 21:55:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+65444+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1600783705968537.5308160012262; Tue, 22 Sep 2020 07:08:25 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id I5CvYY1788612xpfHKiY4HKS; Tue, 22 Sep 2020 07:08:25 -0700 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.42]) by mx.groups.io with SMTP id smtpd.web11.9222.1600783703175237733 for ; Tue, 22 Sep 2020 07:08:24 -0700 X-Received: from DB6PR0301CA0086.eurprd03.prod.outlook.com (2603:10a6:6:30::33) by AM5PR0801MB2099.eurprd08.prod.outlook.com (2603:10a6:203:4d::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.24; Tue, 22 Sep 2020 14:08:20 +0000 X-Received: from DB5EUR03FT061.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:30:cafe::87) by DB6PR0301CA0086.outlook.office365.com (2603:10a6:6:30::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.14 via Frontend Transport; Tue, 22 Sep 2020 14:08:20 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+65444+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT061.mail.protection.outlook.com (10.152.21.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.15 via Frontend Transport; Tue, 22 Sep 2020 14:08:20 +0000 X-Received: ("Tessian outbound e8cdb8c6f386:v64"); Tue, 22 Sep 2020 14:08:19 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: cb1f4f345bceeb68 X-CR-MTA-TID: 64aa7808 X-Received: from ba0b4dfe6509.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id A90A69FF-5CDA-492C-8360-C4DCF32A6FD6.1; Tue, 22 Sep 2020 14:08:13 +0000 X-Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ba0b4dfe6509.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 22 Sep 2020 14:08:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RbbzQJM2QkWStp40BdtwRpNZeJ4ajlpa1/4ZQeynNc/DSDLXdcP2OJy1g4D+IJ6DSlsVa7IykztRTFQYdKxBvHc/NSCe9mhTdYLzjS/Jsflq4uDCAR4++jBz3Wmx4DklT6GJixiqOg6X/mNh2pL2FiIo2ClDPvn0HfDgu2Mox1KWfy8u3iQM5ih4PM4D7hCkJ0yRTPJRkz18UHwu/r/hoPDm9TVFCVwnLa59kRuIuAMiWrccDrGNie9trOTRGEq15dSv52+1/PEuQvRdX4dzbViAFw4r2Il1lr2OS+9eot/RL+ZG2Q2WOnvftMCwwnUYg2EGm3wznfnudyY197kRpw== 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-SenderADCheck; bh=9TEXYQ/gXa8wVhruTgpWTo2w0Up2IRgGXaFW4lOiHI4=; b=CBI1HeobkcrCza9jSBaRJCjHk5A8TLU6mg5N+4WT2Q+V+f+eBDejpyUzwSOeLopUkF2Rw9kia4ziLQ8GqzcskpkHf/OCfOlKMMUHSCOOK+nABK3qrsbM/HJ+h8KNA4AR73UbQkWsEGr97Mo/zNkzUw53YJx5Y58LJOtcWZAMHgOY/Tx+k2iK01tbzH/WySBi1iAHxqIJnoFfYXaig1ghzBsf3RAB5Ec1m9HVN8PkovjzxG2muOPWZ0fVT2pLFa0MLIYfM7mMctj+XiU0vFY1r6h4R3j78MiQ6uLEgT10d1JPDnaIaLvyWQdDOfVKYNmkRUTlFDCK2zpMjz5qJaPC5w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=bestguesspass action=none header.from=arm.com; dkim=none (message not signed); arc=none X-Received: from AM6PR10CA0039.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:80::16) by AM0PR08MB4532.eurprd08.prod.outlook.com (2603:10a6:208:145::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.19; Tue, 22 Sep 2020 14:08:11 +0000 X-Received: from AM5EUR03FT054.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:80:cafe::fa) by AM6PR10CA0039.outlook.office365.com (2603:10a6:209:80::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.19 via Frontend Transport; Tue, 22 Sep 2020 14:08:11 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; X-Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT054.mail.protection.outlook.com (10.152.16.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3391.15 via Frontend Transport; Tue, 22 Sep 2020 14:08:11 +0000 X-Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2044.4; Tue, 22 Sep 2020 14:08:10 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1779.2; Tue, 22 Sep 2020 14:08:10 +0000 X-Received: from E107187.Arm.com (10.57.47.90) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2044.4 via Frontend Transport; Tue, 22 Sep 2020 14:08:09 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , Subject: [edk2-devel] [PATCH v1 1/2] MdePkg: Definitions for Extended Interrupt Flags Date: Tue, 22 Sep 2020 15:08:07 +0100 Message-ID: <20200922140808.77392-2-sami.mujawar@arm.com> In-Reply-To: <20200922140808.77392-1-sami.mujawar@arm.com> References: <20200922140808.77392-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1e2884fc-9b9e-4fbb-6fef-08d85f00f5bb X-MS-TrafficTypeDiagnostic: AM0PR08MB4532:|AM5PR0801MB2099: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:4941;OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: zTeDRuovqWJdU+BYp/7x1zoQ8bCCYM4w7YpzKVn1F3l/lJxK3SMuQ6K51zs8lx+0p5QGDjTCNEtu1BE0wOriRZUuG5Ienmb3Yqd3ZRXJReHBXJc5ZmF/iS+yyq6MKF5zs8xMcLUhulzjv9ueKel3NSTk+TFJj/G9BIvBjMAJedZLd0UipB8JG1WSbfawLyeIQW1wCI5vINaEsLnlDy9SKOMS973tICjTKXhQwEFMgiG385awwRukkk2tzaQYfEG+B293c3A5JZ3yzW/iouapapj89wI7Zy+9jr3Yd8LLQstv3T9Yag6nz3Pxvw/mZpY9x0qZpyvF4ZvUydh4XUvbSrMd1kP/1G+Qm62gjFIgCf387T4p/IFVa1Cj41QrPPTYQrOuycwexeuei9O1nP9vUghCQDv1gR8Yllm0C/nG/ZCcD5CrQKUVlm9aetly4Kul X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(39860400002)(376002)(136003)(396003)(346002)(46966005)(8936002)(19627235002)(2616005)(336012)(26005)(81166007)(478600001)(316002)(44832011)(82740400003)(1076003)(426003)(8676002)(356005)(83380400001)(186003)(47076004)(6916009)(86362001)(70206006)(7696005)(2906002)(54906003)(5660300002)(36756003)(70586007)(82310400003)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB4532 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: a70d1119-f371-4d05-43b8-08d85f00f080 X-Microsoft-Antispam-Message-Info: FFoDJMd+i3bVMyZh/2TS1doFGn3s86MKe2P1wHAuApv5oHab4erVSksn0T+aE7LBtaiN6CD4kR4jeYVS5BeKAZN46nwcUMs/r905W4Xvl79jtt3t6muWi3apT80U9cRlJjUwfsjFinQwDFFgqVtFNhGCdrs3kccHbkEQ6CaXtdJCSUSbmKEFLFpSBqpfYeWgBnQTH1sdgt8gMMEz60Qutf4jmNxnkp2f6iV0KV8b7vqMz5+b9g5Nl8pkkorM+mS68AqXhDhiC0rhSLgfdEoiQoBSvdToBMJDHjLIvl5KEUj4cCWd5ErVPNojN7T1ZV6b2XqhsXYm4PLXFtLcY04gTgNUGvM7TF3BH9saPJ+D4CpDx5vyt6pJLDIgIhP/PJvfdA6qLsL4g/GfclfoR+GlyA== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2020 14:08:20.0195 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1e2884fc-9b9e-4fbb-6fef-08d85f00f5bb X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB2099 Precedence: Bulk List-Unsubscribe: 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,sami.mujawar@arm.com X-Gm-Message-State: iytH4STezdU6zAxrgOm3qoCrx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1600783705; bh=Zpqmm6zzcSgcPqVVgcPtRVEfv4fJRkXfIRGC86OtQMg=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=Rdnk8widfB6QmLZ4nFnjqZiizagDD/ibYCzm76fTU3SzizOh8tLYVFNFFkr8FJYIgEs dAKwXt3PsaDSnovWgA3m9ztzpq6yoLzmXIGTtvClWVPOMeK8OpKpGBC9z6UprN+LsmrXG 7Oiv+UcjqFIJ9s0Hjil0G48vbQr/+3FniXM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add Interrupt Vector Flag definitions for Extended Interrupt Descriptor, and macros to test the flags. Ref: ACPI specification 6.4.3.6 Signed-off-by: Sami Mujawar Reviewed-by: Alexei Fedorov --- MdePkg/Include/IndustryStandard/Acpi10.h | 85 ++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/MdePkg/Include/IndustryStandard/Acpi10.h b/MdePkg/Include/Indu= stryStandard/Acpi10.h index adeb5ae8c219f31d2403fc7aa217bfb4e1e44694..fa3f0694b9cf80bf9c1a325099a= 970b9cf8c1426 100644 --- a/MdePkg/Include/IndustryStandard/Acpi10.h +++ b/MdePkg/Include/IndustryStandard/Acpi10.h @@ -2,6 +2,7 @@ ACPI 1.0b definitions from the ACPI Specification, revision 1.0b =20 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2020, Arm Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 @@ -377,6 +378,90 @@ typedef struct { #define EFI_ACPI_MEMORY_NON_WRITABLE 0x00 =20 // +// Interrupt Vector Flags definitions for Extended Interrupt Descriptor +// Ref ACPI specification 6.4.3.6 +// +#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_PRODUCER_CONSUMER_MASK BIT0 +#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_PRODUCER 0 +#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_CONSUMER BIT0 + +#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_MODE_MASK BIT1 +#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_LEVEL_TRIGGERED 0 +#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_EDGE_TRIGGERED BIT1 + +#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_POLARITY_MASK BIT2 +#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_ACTIVE_HIGH 0 +#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_ACTIVE_LOW BIT2 + +#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_SHARABLE_MASK BIT3 +#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_EXCLUSIVE 0 +#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_SHARED BIT3 + +#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_WAKE_CAPABLITY_MASK BIT4 +#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_NOT_WAKE_CAPABLE 0 +#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_WAKE_CAPABLE BIT4 + +/* Helper macros to test Extended Interrupt Resource descriptor flags. +*/ + +/** Test the Extended Interrupt flags to determine if the Device + is an Interrupt Consumer or Producer. + + @param [in] Flag Extended Interrupt Resource descriptor flag. + + @retval TRUE Device is Interrupt Consumer. + @retval FALSE Device is Interrupt Producer. +*/ +#define IS_EXTENDED_INTERRUPT_CONSUMER(Flag) \ + (((Flag) & EFI_ACPI_EXTENDED_INTERRUPT_FLAG_CONSUMER) =3D=3D \ + EFI_ACPI_EXTENDED_INTERRUPT_FLAG_CONSUMER) + +/** Test if the Extended Interrupt is Edge or Level triggered. + + @param [in] Flag Extended Interrupt Resource descriptor flag. + + @retval TRUE Interrupt is Edge triggered. + @retval FALSE Interrupt is Level triggered. +*/ +#define IS_EXTENDED_INTERRUPT_EDGE_TRIGGERED(Flag) \ + (((Flag) & EFI_ACPI_EXTENDED_INTERRUPT_FLAG_EDGE_TRIGGERED) =3D=3D \ + EFI_ACPI_EXTENDED_INTERRUPT_FLAG_EDGE_TRIGGERED) + +/** Test if the Extended Interrupt is Active Low or Active High. + + @param [in] Flag Extended Interrupt Resource descriptor flag. + + @retval TRUE Interrupt is Active Low. + @retval FALSE Interrupt is Active High. +*/ +#define IS_EXTENDED_INTERRUPT_ACTIVE_LOW(Flag) \ + (((Flag) & EFI_ACPI_EXTENDED_INTERRUPT_FLAG_ACTIVE_LOW) =3D=3D \ + EFI_ACPI_EXTENDED_INTERRUPT_FLAG_ACTIVE_LOW) + +/** Test if the Extended Interrupt is Shared or Exclusive. + + @param [in] Flag Extended Interrupt Resource descriptor flag. + + @retval TRUE Interrupt is Shared. + @retval FALSE Interrupt is Exclusive. +*/ +#define IS_EXTENDED_INTERRUPT_SHARED(Flag) \ + (((Flag) & EFI_ACPI_EXTENDED_INTERRUPT_FLAG_SHARED) =3D=3D \ + EFI_ACPI_EXTENDED_INTERRUPT_FLAG_SHARED) + +/** Test the Extended Interrupt flags to determine if the Device + is Wake capable or not. + + @param [in] Flag Extended Interrupt Resource descriptor flag. + + @retval TRUE Interrupt is Wake Capable. + @retval FALSE Interrupt is not Wake Capable. +*/ +#define IS_EXTENDED_INTERRUPT_WAKE_CAPABLE(Flag) \ + (((Flag) & EFI_ACPI_EXTENDED_INTERRUPT_FLAG_WAKE_CAPABLE) =3D=3D \ + EFI_ACPI_EXTENDED_INTERRUPT_FLAG_WAKE_CAPABLE) + +// // Ensure proper structure formats // #pragma pack(1) --=20 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=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 (#65444): https://edk2.groups.io/g/devel/message/65444 Mute This Topic: https://groups.io/mt/77013535/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun Apr 28 21:55:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+65446+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1600783711478335.40689753543234; Tue, 22 Sep 2020 07:08:31 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id iXcFYY1788612xixoO1Ooj7b; Tue, 22 Sep 2020 07:08:31 -0700 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.45]) by mx.groups.io with SMTP id smtpd.web10.9504.1600783709435879380 for ; Tue, 22 Sep 2020 07:08:30 -0700 X-Received: from DB7PR05CA0003.eurprd05.prod.outlook.com (2603:10a6:10:36::16) by VE1PR08MB5118.eurprd08.prod.outlook.com (2603:10a6:803:107::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.19; Tue, 22 Sep 2020 14:08:25 +0000 X-Received: from DB5EUR03FT035.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:36:cafe::7e) by DB7PR05CA0003.outlook.office365.com (2603:10a6:10:36::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.20 via Frontend Transport; Tue, 22 Sep 2020 14:08:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+65446+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT035.mail.protection.outlook.com (10.152.20.65) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.15 via Frontend Transport; Tue, 22 Sep 2020 14:08:25 +0000 X-Received: ("Tessian outbound 7161e0c2a082:v64"); Tue, 22 Sep 2020 14:08:25 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: effb1bd84576a0c8 X-CR-MTA-TID: 64aa7808 X-Received: from b410f773b195.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 03E7CACD-50B9-4EA6-8D16-6590DBA18C1D.1; Tue, 22 Sep 2020 14:08:19 +0000 X-Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b410f773b195.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 22 Sep 2020 14:08:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b0jFLKyoK5alt3mJP6O8XPXvZvKAZbE3+xB2s2EmPhoEQJL6lEf2aMvsdxCMU2pphzGdcRu4CQnrrFUnCfOpbieEGv6nix40b68iLCvAsLeAedEw9lGOQitmtUpv1YlwK0e5M1bieSMgVv5HmYMThn+j+kceV3Qg4faSD4+KYJlSi/b17WEWbtKTI4BSGavKbFm/2whr8L/HW5m+bBKbppRs9ZfmgTu9z/zImf8cK+d/2n8bTDDq/9/ahjdYugrjFie6gVT3q8KiwXHw/4gycX7k4Ekjwet+EjN31pqfzgQdW/8k4W/vaK6rp0EJWiNyISf5nPtY8JoWZqxte5xZIg== 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-SenderADCheck; bh=ZtdVTKOyzE0V9RhvpANM4YNkUNczOkAlJVRzJUrcgFU=; b=KxQA9PIrTMKsLqjrxs8689ly6Fi/WnZxeSVTc7bS+S6bzFK7WcOZ2j4gpfKzMxW7hGyh3lY30lm0J/KXrjY9l/KFJjkDMrJl58rV8B6nuu/XbLv57/ayY3yXQZ5V/Uw7J9P7iU1jO764z1h9OO2Bbr0B/ooChzuGZPzPgAfYwdR4k77MXjpw23T+oeMcU0TQmcnwTeFhH1US/Q/Ue+AcNE+3ZsW6HRAcBHixKyz0P4HtHDMxXDA6WNDJ9rbwRir7gm8D4VamLLFJnsc/SZDSXfBeXZO42F2CowM/WuwLcaKXpIn78ZiF/gdPKhNFtuyXBXX2pBjgtwRixlo9P4OMzw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=bestguesspass action=none header.from=arm.com; dkim=none (message not signed); arc=none X-Received: from AM6P194CA0094.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:8f::35) by VE1PR08MB5198.eurprd08.prod.outlook.com (2603:10a6:803:10d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.19; Tue, 22 Sep 2020 14:08:16 +0000 X-Received: from AM5EUR03FT063.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8f:cafe::90) by AM6P194CA0094.outlook.office365.com (2603:10a6:209:8f::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.14 via Frontend Transport; Tue, 22 Sep 2020 14:08:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; X-Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT063.mail.protection.outlook.com (10.152.16.226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3391.15 via Frontend Transport; Tue, 22 Sep 2020 14:08:16 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2044.4; Tue, 22 Sep 2020 14:08:10 +0000 X-Received: from E107187.Arm.com (10.57.47.90) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2044.4 via Frontend Transport; Tue, 22 Sep 2020 14:08:10 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , Subject: [edk2-devel] [PATCH v1 2/2] DynamicTablesPkg: Add SSDT CMN-600 Table generator Date: Tue, 22 Sep 2020 15:08:08 +0100 Message-ID: <20200922140808.77392-3-sami.mujawar@arm.com> In-Reply-To: <20200922140808.77392-1-sami.mujawar@arm.com> References: <20200922140808.77392-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 262269ef-62d8-4bf4-5637-08d85f00f8bc X-MS-TrafficTypeDiagnostic: VE1PR08MB5198:|VE1PR08MB5118: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:3826;OLM:3826; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: YTVYIwszyjn1V2KR1hp2dP2krGCxJR0acEaot4aGsIavYRGRn2sdWDMSP83C7D7s6P939qs/7QgsSoy0gJFwPxrmhVPbhlK6khnYx6AI24MQKOm+NUWmSZNeHGqrwO7vrg/YIJe9gw6CBCQaoho4bqWlfpTi/e2i80zKtDeCNfV3KFuVNcQrvqeUxVG4T+km9QaJG8C9G6YQD6WPjqnm31v2roXGXqcBgUYT/DFhHNZAMzbz9eRynwJv0Yr9qrhRzOzQoqaJZrFO7hjXB2KRhaeUXlMKb0gHKbDL+RiPCtOXdPhhgMcNJH+FZQN8ajydICeVlmFD1XY2JR6J6ZZ82L2x73I47uQhOZ1r8s4Jpl4bXAbmzjiNNKn3davVmcqjCKIjGGeQ6BTLhqqbTw6nAIhtcmtUJb+tZ6kyUpYoJXs= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(346002)(396003)(376002)(136003)(39860400002)(46966005)(54906003)(81166007)(8936002)(4326008)(47076004)(26005)(478600001)(7696005)(186003)(356005)(2906002)(82740400003)(8676002)(30864003)(83380400001)(2616005)(426003)(44832011)(70206006)(19627235002)(70586007)(36756003)(336012)(6916009)(82310400003)(86362001)(5660300002)(1076003)(316002)(21314003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5198 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT035.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: b1a4e39a-fe8e-40eb-2c13-08d85f00f37b X-Microsoft-Antispam-Message-Info: bwgsi2vzWH0hS3ZvqvNtjFWRVyeG7UP1gb/Mp++nHsCPZ2aTki2+k4tnjDMNipoFigyIMxdAzjtWL2IcLx6A4WkhvSMlDykEgu21yJuLpvw9MVQSJ2S041OQg1XV+3EooFB5qGdOuRop3Xbo0KXGstu1uo1zYsBYmzp/ijxs9dPta9uJ4s6DMDtFj4hKTMaBCKV+eSqYhKZnXGeBkAnBu4ND1fRJD1+YhVkpJ2dI1ze8HUkiEQnpvbLsDqCpqKQ86Q1xg80dTxswCwnjJKmNjpVo6/nFOPrCiwu2nbRHe4GKcOhZfmTrvy17Jaa6jRd+G9Esd08n8oBUx88SNwRnWoKxso2gdozoHhhZA+gadt+I3si9fr6bK6E/wzQm2B4jbmZbOja8Y7wuVYaeDJYPxVTFoHaknko4nvFTglxto8zb80KarnnvdDj+EIQb7ZtWgJNzax/SIa4Yxzi5FkdN3Q== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2020 14:08:25.0556 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 262269ef-62d8-4bf4-5637-08d85f00f8bc X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT035.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5118 Precedence: Bulk List-Unsubscribe: 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,sami.mujawar@arm.com X-Gm-Message-State: qLSkvvJjix9c19ccHvwcr0tVx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1600783711; bh=us+R1nQNCZrTv8lVnC4YbZ3TDbnNIIeTGjrTW0CLCI0=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=CIx26shMvlyMdgOD0mYuQFopaxI0IzA/iItPGi2h8eJpufL51+74X7wEtL31S8bpSZ7 u8VVid1dYHQgd0GPohe21720h11kCap2j4sM9hRRhLb8pIQqYDtea01lGrQlrEZpSe9/X qCfm3baGKjBv2n2j6SNpKtg53onZKlGyjwc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Pierre Gondois The Generic ACPI for Arm Components 1.0 Platform Design Document, s2.6.4 "ASL code examples" provides information to describe an Arm CoreLink CMN-600 Coherent Mesh Network using an ASL definition block table. The SSDT CMN-600 Table Generator uses the Configuration Manager protocol to obtain the following information about the CMN-600 device on the platform: - the PERIPHBASE address location and address range; - the ROOTNODEBASE address location; - the number of Debug and Trace Controller (DTC) and their respective interrupt number; The CMN-600 mesh is described using the CM_ARM_CMN_600_INFO and CM_ARM_EXTENDED_INTERRUPT structures in the Configuration Manager. The SSDT CMN-600 Table generator: - gets the CMN-600 hardware information from the configuration manager. - uses the AmlLib interfaces to parse the AML template BLOB and construct an AML tree. - uses the AmlLib to update: - the "_UID" value; - the address location and range of the PERIPHBASE; - the address location of the ROOTNODEBASE; - the number of Debug and Trace Controller (DTC) and their respective interrupt number; - serializes the AML tree to an output buffer. This output buffer contains the fixed-up AML code, which is then installed as an ACPI SSDT table. Signed-off-by: Pierre Gondois Co-authored-by: Sami Mujawar Reviewed-by: Alexei Fedorov --- DynamicTablesPkg/DynamicTables.dsc.inc = | 2 + DynamicTablesPkg/DynamicTablesPkg.ci.yaml = | 4 + DynamicTablesPkg/Include/AcpiTableGenerator.h = | 5 + DynamicTablesPkg/Include/ArmNameSpaceObjects.h = | 64 +- DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600Generator= .c | 701 ++++++++++++++++++++ DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600Generator= .h | 51 ++ DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600LibArm.in= f | 34 + DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600Template.= asl | 81 +++ 8 files changed, 936 insertions(+), 6 deletions(-) diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc b/DynamicTablesPkg/Dyna= micTables.dsc.inc index 7fb14d8d1463f7d4502fd3a7708bc94bc336357d..fa33b7ee67e615e236cb13224c8= 59594566df19f 100644 --- a/DynamicTablesPkg/DynamicTables.dsc.inc +++ b/DynamicTablesPkg/DynamicTables.dsc.inc @@ -34,6 +34,7 @@ [Components.common] =20 # AML Fixup DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPor= tLibArm.inf + DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600LibArm.= inf =20 # # Dynamic Table Factory Dxe @@ -53,6 +54,7 @@ [Components.common] =20 # AML Fixup NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/Ssdt= SerialPortLibArm.inf + NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn6= 00LibArm.inf } =20 # diff --git a/DynamicTablesPkg/DynamicTablesPkg.ci.yaml b/DynamicTablesPkg/D= ynamicTablesPkg.ci.yaml index c0d09e79fdf7f6003b5bbda45abc82a0caf4e53f..52c8c2ab4aefb21bea0289a4fd0= 2209ae937a221 100644 --- a/DynamicTablesPkg/DynamicTablesPkg.ci.yaml +++ b/DynamicTablesPkg/DynamicTablesPkg.ci.yaml @@ -70,6 +70,7 @@ # in matching files "ExtendWords": [ "ARMHB", # ARMHB000 + "ARMHC", # ARMHC600 "ARMLTD", "EISAID", "CCIDX", @@ -81,8 +82,11 @@ "lgreater", "lless", "MPIDR", + "PERIPHBASE", "pytool", "Roadmap", + "ROOTNODEBASE", + "ssdtcmn", "ssdtserialporttemplate", "SMMUV", "standardised", diff --git a/DynamicTablesPkg/Include/AcpiTableGenerator.h b/DynamicTablesP= kg/Include/AcpiTableGenerator.h index ef5018c312c1abbc205a06b037ffd6063cf02f0a..352331d6dc957b664d31d55b50e= fcce5b90d8ada 100644 --- a/DynamicTablesPkg/Include/AcpiTableGenerator.h +++ b/DynamicTablesPkg/Include/AcpiTableGenerator.h @@ -59,6 +59,10 @@ The Dynamic Tables Framework implements the following AC= PI table generators: The SSDT Serial generator collates the Serial port information from the Configuration Manager and patches the SSDT Serial Port template to build the SSDT Serial port table. + - SSDT CMN-600: + The SSDT CMN-600 generator collates the CMN-600 information + from the Configuration Manager and patches the SSDT CMN-600 + template to build the SSDT CMN-600 table. */ =20 /** The ACPI_TABLE_GENERATOR_ID type describes ACPI table generator ID. @@ -83,6 +87,7 @@ typedef enum StdAcpiTableId { EStdAcpiTableIdPptt, ///< PPTT Generator EStdAcpiTableIdSrat, ///< SRAT Generator EStdAcpiTableIdSsdtSerialPort, ///< SSDT Serial-Port Gene= rator + EStdAcpiTableIdSsdtCmn600, ///< SSDT Cmn-600 Generator EStdAcpiTableIdMax } ESTD_ACPI_TABLE_ID; =20 diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTables= Pkg/Include/ArmNameSpaceObjects.h index b2534a6505d6fb695f0751bbb09d365bd93d092e..f0654866444e5497a010f7e7177= 199604f5d32b6 100644 --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h @@ -57,6 +57,7 @@ typedef enum ArmObjectID { EArmObjDeviceHandlePci, ///< 33 - Device Handle Pci EArmObjGenericInitiatorAffinityInfo, ///< 34 - Generic Initiator Affinity EArmObjSerialPortInfo, ///< 35 - Generic Serial Port Info + EArmObjCmn600Info, ///< 36 - CMN-600 Info EArmObjMax } EARM_OBJECT_ID; =20 @@ -653,18 +654,37 @@ typedef struct CmArmIdMapping { UINT32 Flags; } CM_ARM_ID_MAPPING; =20 -/** A structure that describes the - SMMU interrupts for the Platform. - - ID: EArmObjSmmuInterruptArray +/** A structure that describes the Arm + Generic Interrupts. */ -typedef struct CmArmSmmuInterrupt { +typedef struct CmArmGenericInterrupt { /// Interrupt number UINT32 Interrupt; =20 /// Flags UINT32 Flags; -} CM_ARM_SMMU_INTERRUPT; +} CM_ARM_GENERIC_INTERRUPT; + +/** A structure that describes the SMMU interrupts for the Platform. + + Interrupt Interrupt number. + Flags Interrupt flags as defined for SMMU node. + + ID: EArmObjSmmuInterruptArray +*/ +typedef CM_ARM_GENERIC_INTERRUPT CM_ARM_SMMU_INTERRUPT; + +/** A structure that describes the AML Extended Interrupts. + + Interrupt Interrupt number. + Flags Interrupt flags as defined by the Interrupt + Vector Flags (Byte 3) of the Extended Interrupt + resource descriptor. + See EFI_ACPI_EXTENDED_INTERRUPT_FLAG_xxx in Acpi10.h + + ID: EArmObjExtendedInterruptInfo +*/ +typedef CM_ARM_GENERIC_INTERRUPT CM_ARM_EXTENDED_INTERRUPT; =20 /** A structure that describes the Processor Hierarchy Node (Type 0) in PP= TT =20 @@ -825,6 +845,38 @@ typedef struct CmArmGenericInitiatorAffinityInfo { CM_OBJECT_TOKEN DeviceHandleToken; } CM_ARM_GENERIC_INITIATOR_AFFINITY_INFO; =20 +/** A structure that describes the CMN-600 hardware. + + ID: EArmObjCmn600Info +*/ +typedef struct CmArmCmn600Info { + /// The PERIPHBASE address. + /// Corresponds to the Configuration Node Region (CFGR) base address. + UINT64 PeriphBaseAddress; + + /// The PERIPHBASE address length. + /// Corresponds to the CFGR base address length. + UINT64 PeriphBaseAddressLength; + + /// The ROOTNODEBASE address. + /// Corresponds to the Root node (ROOT) base address. + UINT64 RootNodeBaseAddress; + + /// The Debug and Trace Logic Controller (DTC) count. + /// CMN-600 can have maximum 4 DTCs. + UINT8 DtcCount; + + /// DTC Interrupt list. + /// The first interrupt resource descriptor pertains to + /// DTC[0], the second to DTC[1] and so on. + /// DtcCount determines the number of DTC Interrupts that + /// are populated. If DTC count is 2 then DtcInterrupt[2] + /// and DtcInterrupt[3] are ignored. + /// Note: The size of CM_ARM_CMN_600_INFO structure remains + /// constant and does not vary with the DTC count. + CM_ARM_EXTENDED_INTERRUPT DtcInterrupt[4]; +} CM_ARM_CMN_600_INFO; + #pragma pack() =20 #endif // ARM_NAMESPACE_OBJECTS_H_ diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn= 600Generator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/Ssd= tCmn600Generator.c new file mode 100644 index 0000000000000000000000000000000000000000..a2ff3387a807bad81c4c62b843d= 797020b677548 --- /dev/null +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600Gene= rator.c @@ -0,0 +1,701 @@ +/** @file + SSDT CMN-600 AML Table Generator. + + Copyright (c) 2020, Arm Limited. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Reference(s): + - Arm CoreLink CMN-600 Coherent Mesh Network Technical Reference Manual = r3p0 + - Generic ACPI for Arm Components 1.0 Platform Design Document +**/ + +#include +#include +#include +#include +#include +#include +#include +#include + +// Module specific include files. +#include +#include +#include +#include +#include +#include +#include "SsdtCmn600Generator.h" + +/** C array containing the compiled AML template. + This symbol is defined in the auto generated C file + containing the AML bytecode array. +*/ +extern CHAR8 ssdtcmn600template_aml_code[]; + +/** SSDT CMN-600 Table Generator. + + Requirements: + The following Configuration Manager Object(s) are required by + this Generator: + - EArmObjCmn600Info +*/ + +/** This macro expands to a function that retrieves the CMN-600 + Information from the Configuration Manager. +*/ +GET_OBJECT_LIST ( + EObjNameSpaceArm, + EArmObjCmn600Info, + CM_ARM_CMN_600_INFO + ); + +/** Check the CMN-600 Information. + + @param [in] Cmn600InfoList Array of CMN-600 information struc= ture. + @param [in] Cmn600Count Count of CMN-600 information struc= ture. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_INVALID_PARAMETER Invalid parameter. +**/ +STATIC +EFI_STATUS +EFIAPI +ValidateCmn600Info ( + IN CONST CM_ARM_CMN_600_INFO * Cmn600InfoList, + IN CONST UINT32 Cmn600Count + ) +{ + UINT32 Index; + UINT32 DtcIndex; + CONST CM_ARM_CMN_600_INFO * Cmn600Info; + CONST CM_ARM_GENERIC_INTERRUPT * DtcInterrupt; + + if ((Cmn600InfoList =3D=3D NULL) || + (Cmn600Count =3D=3D 0)) { + return EFI_INVALID_PARAMETER; + } + + // Validate each Cmn600Info structure. + for (Index =3D 0; Index < Cmn600Count; Index++) { + Cmn600Info =3D &Cmn600InfoList[Index]; + + // At least one DTC is required. + if ((Cmn600Info->DtcCount =3D=3D 0) || + (Cmn600Info->DtcCount > MAX_DTC_COUNT)) { + DEBUG (( + DEBUG_ERROR, + "ERROR: SSDT-CMN-600: Invalid DTC configuration:\n" + )); + goto error_handler; + } + + // Check PERIPHBASE and ROOTNODEBASE address spaces are initialized. + if ((Cmn600Info->PeriphBaseAddress =3D=3D 0) || + (Cmn600Info->RootNodeBaseAddress =3D=3D 0)) { + DEBUG (( + DEBUG_ERROR, + "ERROR: SSDT-CMN-600: Invalid PERIPHBASE or ROOTNODEBASE.\n" + )); + goto error_handler; + } + + // The PERIPHBASE address must be 64MB aligned for a (X < 4) && (Y < 4) + // dimension mesh, and 256MB aligned otherwise. + // Check it is a least 64MB aligned. + if ((Cmn600Info->PeriphBaseAddress & + (PERIPHBASE_MIN_ADDRESS_LENGTH - 1)) !=3D 0) { + DEBUG (( + DEBUG_ERROR, + "ERROR: SSDT-CMN-600: PERIPHBASE address must be 64MB aligned.\n" + )); + goto error_handler; + } + + // The PERIPHBASE address is at most 64MB for a (X < 4) && (Y < 4) + // dimension mesh, and 256MB otherwise. Check it is not more than 256M= B. + if (Cmn600Info->PeriphBaseAddressLength > PERIPHBASE_MAX_ADDRESS_LENGT= H) { + DEBUG (( + DEBUG_ERROR, + "ERROR: SSDT-CMN-600: PERIPHBASE address range must be < 256MB.\n" + )); + goto error_handler; + } + + // Check the 16 KB alignment of the ROOTNODEBASE address. + if ((Cmn600Info->PeriphBaseAddress & + (ROOTNODEBASE_ADDRESS_LENGTH - 1)) !=3D 0) { + DEBUG (( + DEBUG_ERROR, + "ERROR: SSDT-CMN-600: Root base address must be 16KB aligned.\n" + )); + goto error_handler; + } + + // The ROOTNODEBASE address space should be included in the PERIPHBASE + // address space. + if ((Cmn600Info->PeriphBaseAddress > Cmn600Info->RootNodeBaseAddress) = || + ((Cmn600Info->PeriphBaseAddress + Cmn600Info->PeriphBaseAddressLen= gth) < + (Cmn600Info->RootNodeBaseAddress + ROOTNODEBASE_ADDRESS_LENGTH)))= { + DEBUG (( + DEBUG_ERROR, + "ERROR: SSDT-CMN-600:" + " ROOTNODEBASE address space not in PERIPHBASE address space.\n" + )); + goto error_handler; + } + + for (DtcIndex =3D 0; DtcIndex < Cmn600Info->DtcCount; DtcIndex++) { + DtcInterrupt =3D &Cmn600Info->DtcInterrupt[DtcIndex]; + if (!IS_EXTENDED_INTERRUPT_CONSUMER (DtcInterrupt->Flags)) { + DEBUG (( + DEBUG_ERROR, + "ERROR: SSDT-CMN-600: DTC Interrupt must be consumer.\n" + )); + goto error_handler; + } + } // for DTC Interrupt + + } //for Cmn600InfoList + + return EFI_SUCCESS; + +error_handler: + + DEBUG (( + DEBUG_ERROR, + "PeriphBaseAddress =3D 0x%llx\n" + "PeriphBaseAddressLength =3D 0x%llx\n" + "RootNodeBaseAddress =3D 0x%llx\n" + "DtcCount =3D %u\n", + Cmn600Info->PeriphBaseAddress, + Cmn600Info->PeriphBaseAddressLength, + Cmn600Info->RootNodeBaseAddress, + Cmn600Info->DtcCount + )); + + for (DtcIndex =3D 0; DtcIndex < Cmn600Info->DtcCount; DtcIndex++) { + DtcInterrupt =3D &Cmn600Info->DtcInterrupt[DtcIndex]; + DEBUG (( + DEBUG_ERROR, + " DTC[%d]:\n", + DtcIndex + )); + DEBUG (( + DEBUG_ERROR, + " Interrupt =3D 0x%lx\n", + DtcInterrupt->Interrupt + )); + DEBUG (( + DEBUG_ERROR, + " Flags =3D 0x%lx\n", + DtcInterrupt->Flags + )); + } // for + + return EFI_INVALID_PARAMETER; +} + +/** Build a SSDT table describing the CMN-600 device. + + The table created by this function must be freed by FreeSsdtCmn600Table. + + @param [in] Cmn600Info Pointer to a Cmn600 structure. + @param [in] Name The Name to give to the Device. + Must be a NULL-terminated ASL NameString + e.g.: "DEV0", "DV15.DEV0", etc. + @param [in] Uid UID for the CMN600 device. + @param [out] Table If success, pointer to the created SSDT ta= ble. + + @retval EFI_SUCCESS Table generated successfully. + @retval EFI_INVALID_PARAMETER A parameter is invalid. + @retval EFI_NOT_FOUND Could not find information. + @retval EFI_OUT_OF_RESOURCES Could not allocate memory. +**/ +STATIC +EFI_STATUS +EFIAPI +FixupCmn600Info ( + IN CONST CM_ARM_CMN_600_INFO * Cmn600Info, + IN CONST CHAR8 * Name, + IN CONST UINT64 Uid, + OUT EFI_ACPI_DESCRIPTION_HEADER ** Table + ) +{ + EFI_STATUS Status; + EFI_STATUS Status1; + UINT8 Index; + CONST CM_ARM_GENERIC_INTERRUPT * DtcInt; + + EFI_ACPI_DESCRIPTION_HEADER * SsdtCmn600Template; + AML_ROOT_NODE_HANDLE RootNodeHandle; + AML_OBJECT_NODE_HANDLE NameOpIdNode; + AML_OBJECT_NODE_HANDLE NameOpCrsNode; + AML_DATA_NODE_HANDLE CmnPeriphBaseRdNode; + AML_DATA_NODE_HANDLE CmnRootNodeBaseRdNode; + AML_OBJECT_NODE_HANDLE DeviceNode; + + // Parse the Ssdt CMN-600 Template. + SsdtCmn600Template =3D (EFI_ACPI_DESCRIPTION_HEADER*) + ssdtcmn600template_aml_code; + + RootNodeHandle =3D NULL; + Status =3D AmlParseDefinitionBlock ( + SsdtCmn600Template, + &RootNodeHandle + ); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "ERROR: SSDT-CMN-600: Failed to parse SSDT CMN-600 Template." + " Status =3D %r\n", + Status + )); + return Status; + } + + // Get the _UID NameOp object defined by the "Name ()" statement, + // and update its value. + Status =3D AmlFindNode ( + RootNodeHandle, + "\\_SB_.CMN0._UID", + &NameOpIdNode + ); + if (EFI_ERROR (Status)) { + goto error_handler; + } + + Status =3D AmlNameOpUpdateInteger (NameOpIdNode, (UINT64)Uid); + if (EFI_ERROR (Status)) { + goto error_handler; + } + + // Get the _CRS object defined by the "Name ()" statement. + Status =3D AmlFindNode ( + RootNodeHandle, + "\\_SB.CMN0._CRS", + &NameOpCrsNode + ); + if (EFI_ERROR (Status)) { + goto error_handler; + } + + // Get the first Rd node in the "_CRS" object. + // This is the PERIPHBASE node. + Status =3D AmlNameOpCrsGetFirstRdNode (NameOpCrsNode, &CmnPeriphBaseRdNo= de); + if (EFI_ERROR (Status)) { + goto error_handler; + } + + if (CmnPeriphBaseRdNode =3D=3D NULL) { + Status =3D EFI_INVALID_PARAMETER; + goto error_handler; + } + + // Update the PERIPHBASE base address and length. + Status =3D AmlUpdateRdQWord ( + CmnPeriphBaseRdNode, + Cmn600Info->PeriphBaseAddress, + Cmn600Info->PeriphBaseAddressLength + ); + if (EFI_ERROR (Status)) { + goto error_handler; + } + + // Get the QWord node corresponding to the ROOTNODEBASE. + // It is the second Resource Data element in the BufferNode's + // variable list of arguments. + Status =3D AmlNameOpCrsGetNextRdNode ( + CmnPeriphBaseRdNode, + &CmnRootNodeBaseRdNode + ); + if (EFI_ERROR (Status)) { + goto error_handler; + } + + if (CmnRootNodeBaseRdNode =3D=3D NULL) { + Status =3D EFI_INVALID_PARAMETER; + goto error_handler; + } + + // Update the ROOTNODEBASE base address and length. + Status =3D AmlUpdateRdQWord ( + CmnRootNodeBaseRdNode, + Cmn600Info->RootNodeBaseAddress, + ROOTNODEBASE_ADDRESS_LENGTH + ); + if (EFI_ERROR (Status)) { + goto error_handler; + } + + // Add the Interrupt node(s). + // Generate Resource Data node(s) corresponding to the "Interrupt ()" + // ASL function and add it at the last position in the list of + // Resource Data nodes. + for (Index =3D 0; Index < Cmn600Info->DtcCount; Index++) { + DtcInt =3D &Cmn600Info->DtcInterrupt[Index]; + Status =3D AmlCodeGenCrsAddRdInterrupt ( + NameOpCrsNode, + IS_EXTENDED_INTERRUPT_CONSUMER (DtcInt->Flags), + IS_EXTENDED_INTERRUPT_EDGE_TRIGGERED (DtcInt->Flags), + IS_EXTENDED_INTERRUPT_ACTIVE_LOW (DtcInt->Flags), + IS_EXTENDED_INTERRUPT_SHARED (DtcInt->Flags), + (UINT32*)&DtcInt->Interrupt, + 1 + ); + if (EFI_ERROR (Status)) { + goto error_handler; + } + } // for + + // Fixup the CMN600 device name. + // This MUST be done at the end, otherwise AML paths won't be valid anym= ore. + // Get the CMN0 variable defined by the "Device ()" statement. + Status =3D AmlFindNode (RootNodeHandle, "\\_SB_.CMN0", &DeviceNode); + if (EFI_ERROR (Status)) { + goto error_handler; + } + + // Update the CMN600 Device's name. + Status =3D AmlDeviceOpUpdateName (DeviceNode, (CHAR8*)Name); + if (EFI_ERROR (Status)) { + goto error_handler; + } + + // Serialise the definition block + Status =3D AmlSerializeDefinitionBlock ( + RootNodeHandle, + Table + ); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "ERROR: SSDT-CMN-600: Failed to Serialize SSDT Table Data." + " Status =3D %r\n", + Status + )); + } + +error_handler: + // Cleanup + if (RootNodeHandle !=3D NULL) { + Status1 =3D AmlDeleteTree (RootNodeHandle); + if (EFI_ERROR (Status1)) { + DEBUG (( + DEBUG_ERROR, + "ERROR: SSDT-CMN-600: Failed to cleanup AML tree." + " Status =3D %r\n", + Status1 + )); + // If Status was success but we failed to delete the AML Tree + // return Status1 else return the original error code, i.e. Status. + if (!EFI_ERROR (Status)) { + return Status1; + } + } + } + + return Status; +} + +/** Free any resources allocated for constructing the SSDT tables for CMN-= 600. + + @param [in] This Pointer to the ACPI table generator. + @param [in] AcpiTableInfo Pointer to the ACPI Table Info. + @param [in] CfgMgrProtocol Pointer to the Configuration Manager + Protocol Interface. + @param [in, out] Table Pointer to an array of pointers + to ACPI Table(s). + @param [in] TableCount Number of ACPI table(s). + + @retval EFI_SUCCESS The resources were freed successfully. + @retval EFI_INVALID_PARAMETER The table pointer is NULL or invalid. +**/ +STATIC +EFI_STATUS +EFIAPI +FreeSsdtCmn600TableResourcesEx ( + IN CONST ACPI_TABLE_GENERATOR * CONST This, + IN CONST CM_STD_OBJ_ACPI_TABLE_INFO * CONST AcpiTableIn= fo, + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProto= col, + IN OUT EFI_ACPI_DESCRIPTION_HEADER *** CONST Table, + IN CONST UINTN TableCount + ) +{ + EFI_ACPI_DESCRIPTION_HEADER ** TableList; + UINTN Index; + + ASSERT (This !=3D NULL); + ASSERT (AcpiTableInfo !=3D NULL); + ASSERT (CfgMgrProtocol !=3D NULL); + ASSERT (AcpiTableInfo->TableGeneratorId =3D=3D This->GeneratorID); + ASSERT (AcpiTableInfo->AcpiTableSignature =3D=3D This->AcpiTableSignatur= e); + + if ((Table =3D=3D NULL) || + (*Table =3D=3D NULL) || + (TableCount =3D=3D 0)) { + DEBUG ((DEBUG_ERROR, "ERROR: SSDT-CMN-600: Invalid Table Pointer\n")); + return EFI_INVALID_PARAMETER; + } + + TableList =3D *Table; + + for (Index =3D 0; Index < TableCount; Index++) { + if ((TableList[Index] !=3D NULL) && + (TableList[Index]->Signature =3D=3D + EFI_ACPI_6_3_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE)) { + FreePool (TableList[Index]); + } else { + DEBUG (( + DEBUG_ERROR, + "ERROR: SSDT-CMN-600: Could not free SSDT table at index %d." + " Status =3D %r\n", + Index, + EFI_INVALID_PARAMETER + )); + return EFI_INVALID_PARAMETER; + } + } //for + + // Free the table list. + FreePool (*Table); + *Table =3D NULL; + return EFI_SUCCESS; +} + +/** Construct SSDT tables for describing CMN-600 meshes. + + This function invokes the Configuration Manager protocol interface + to get the required hardware information for generating the ACPI + table. + + If this function allocates any resources then they must be freed + in the FreeXXXXTableResourcesEx function. + + @param [in] This Pointer to the ACPI table generator. + @param [in] AcpiTableInfo Pointer to the ACPI table information. + @param [in] CfgMgrProtocol Pointer to the Configuration Manager + Protocol interface. + @param [out] Table Pointer to a list of generated ACPI table(s= ). + @param [out] TableCount Number of generated ACPI table(s). + + @retval EFI_SUCCESS Table generated successfully. + @retval EFI_BAD_BUFFER_SIZE The size returned by the Configuration + Manager is less than the Object size for + the requested object. + @retval EFI_INVALID_PARAMETER A parameter is invalid. + @retval EFI_NOT_FOUND Could not find information. + @retval EFI_OUT_OF_RESOURCES Could not allocate memory. + @retval EFI_UNSUPPORTED Unsupported configuration. +**/ +STATIC +EFI_STATUS +EFIAPI +BuildSsdtCmn600TableEx ( + IN CONST ACPI_TABLE_GENERATOR * This, + IN CONST CM_STD_OBJ_ACPI_TABLE_INFO * CONST AcpiTableInfo, + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol, + OUT EFI_ACPI_DESCRIPTION_HEADER *** Table, + OUT UINTN * CONST TableCount + ) +{ + EFI_STATUS Status; + UINT64 Index; + CM_ARM_CMN_600_INFO * Cmn600Info; + UINT32 Cmn600Count; + CHAR8 NewName[5]; + EFI_ACPI_DESCRIPTION_HEADER ** TableList; + + ASSERT (This !=3D NULL); + ASSERT (AcpiTableInfo !=3D NULL); + ASSERT (CfgMgrProtocol !=3D NULL); + ASSERT (Table !=3D NULL); + ASSERT (TableCount !=3D NULL); + ASSERT (AcpiTableInfo->TableGeneratorId =3D=3D This->GeneratorID); + ASSERT (AcpiTableInfo->AcpiTableSignature =3D=3D This->AcpiTableSignatur= e); + + *Table =3D NULL; + + // Get CMN-600 information. + Status =3D GetEArmObjCmn600Info ( + CfgMgrProtocol, + CM_NULL_TOKEN, + &Cmn600Info, + &Cmn600Count + ); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "ERROR: SSDT-CMN-600: Failed to get the CMN-600 information." + " Status =3D %r\n", + Status + )); + return Status; + } + + if ((Cmn600Count =3D=3D 0) || (Cmn600Count > MAX_CMN600_DEVICES_SUPPORTE= D)) { + DEBUG (( + DEBUG_ERROR, + "ERROR: SSDT-CMN-600: CMN600 peripheral count =3D %d." + " This must be between 1 to 16.\n", + Cmn600Count + )); + return EFI_INVALID_PARAMETER; + } + + // Validate the CMN-600 Info. + Status =3D ValidateCmn600Info (Cmn600Info, Cmn600Count); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "ERROR: SSDT-CMN-600: Invalid CMN600 information. Status =3D %r\n", + Status + )); + return Status; + } + + // Allocate a table to store pointers to the SSDT tables. + TableList =3D (EFI_ACPI_DESCRIPTION_HEADER**) + AllocateZeroPool ( + (sizeof (EFI_ACPI_DESCRIPTION_HEADER*) * Cmn600Count) + ); + if (TableList =3D=3D NULL) { + Status =3D EFI_OUT_OF_RESOURCES; + DEBUG (( + DEBUG_ERROR, + "ERROR: SSDT-CMN-600: Failed to allocate memory for Table List." + " Status =3D %r\n", + Status + )); + return Status; + } + + // Setup the table list early so that that appropriate cleanup + // can be done in case of failure. + *Table =3D TableList; + + NewName[0] =3D 'C'; + NewName[1] =3D 'M'; + NewName[2] =3D 'N'; + NewName[4] =3D '\0'; + for (Index =3D 0; Index < Cmn600Count; Index++) { + NewName[3] =3D AsciiFromHex ((UINT8)(Index)); + + // Build a SSDT table describing the CMN600 device. + Status =3D FixupCmn600Info ( + &Cmn600Info[Index], + NewName, + Index, + &TableList[Index] + ); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "ERROR: SSDT-CMN-600: Failed to build associated SSDT table." + " Status =3D %r\n", + Status + )); + break; + } + + // Increment the table count here so that appropriate clean-up + // can be done in case of failure. + *TableCount +=3D 1; + } // for + + // Note: Table list and CMN600 device count has been setup. The + // framework will invoke FreeSsdtCmn600TableResourcesEx() even + // on failure, so appropriate clean-up will be done. + return Status; +} + +/** This macro defines the Raw Generator revision. +*/ +#define SSDT_CMN_600_GENERATOR_REVISION CREATE_REVISION (1, 0) + +/** The interface for the Raw Table Generator. +*/ +STATIC +CONST +ACPI_TABLE_GENERATOR SsdtCmn600Generator =3D { + // Generator ID + CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdSsdtCmn600), + // Generator Description + L"ACPI.STD.SSDT.CMN600.GENERATOR", + // ACPI Table Signature + EFI_ACPI_6_3_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, + // ACPI Table Revision - Unused + 0, + // Minimum ACPI Table Revision - Unused + 0, + // Creator ID + TABLE_GENERATOR_CREATOR_ID_ARM, + // Creator Revision + SSDT_CMN_600_GENERATOR_REVISION, + // Build table function. Use the extended version instead. + NULL, + // Free table function. Use the extended version instead. + NULL, + // Build Table function + BuildSsdtCmn600TableEx, + // Free Resource function + FreeSsdtCmn600TableResourcesEx +}; + +/** Register the Generator with the ACPI Table Factory. + + @param [in] ImageHandle The handle to the image. + @param [in] SystemTable Pointer to the System Table. + + @retval EFI_SUCCESS The Generator is registered. + @retval EFI_INVALID_PARAMETER A parameter is invalid. + @retval EFI_ALREADY_STARTED The Generator for the Table ID + is already registered. +**/ +EFI_STATUS +EFIAPI +AcpiSsdtCmn600LibConstructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE * SystemTable + ) +{ + EFI_STATUS Status; + + Status =3D RegisterAcpiTableGenerator (&SsdtCmn600Generator); + DEBUG (( + DEBUG_INFO, + "SSDT-CMN-600: Register Generator. Status =3D %r\n", + Status + )); + ASSERT_EFI_ERROR (Status); + return Status; +} + +/** Deregister the Generator from the ACPI Table Factory. + + @param [in] ImageHandle The handle to the image. + @param [in] SystemTable Pointer to the System Table. + + @retval EFI_SUCCESS The Generator is deregistered. + @retval EFI_INVALID_PARAMETER A parameter is invalid. + @retval EFI_NOT_FOUND The Generator is not registered. +**/ +EFI_STATUS +EFIAPI +AcpiSsdtCmn600LibDestructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE * SystemTable + ) +{ + EFI_STATUS Status; + + Status =3D DeregisterAcpiTableGenerator (&SsdtCmn600Generator); + DEBUG (( + DEBUG_INFO, + "SSDT-CMN-600: Deregister Generator. Status =3D %r\n", + Status + )); + ASSERT_EFI_ERROR (Status); + return Status; +} diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn= 600Generator.h b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/Ssd= tCmn600Generator.h new file mode 100644 index 0000000000000000000000000000000000000000..ab03b72236e78c28a5e36452bb5= d7e93e957332d --- /dev/null +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600Gene= rator.h @@ -0,0 +1,51 @@ +/** @file + + Copyright (c) 2020, Arm Limited. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Glossary: + - Cm or CM - Configuration Manager + - Obj or OBJ - Object + - Std or STD - Standard + + @par Reference(s): + - Arm CoreLink CMN-600 Coherent Mesh Network Technical Reference Manual = r3p0 + - Generic ACPI for Arm Components 1.0 Platform Design Document +**/ + +#ifndef SSDT_CMN600_GENERATOR_H_ +#define SSDT_CMN600_GENERATOR_H_ + +/** PeriphBase maximum address length is 256MB (0x10000000) + for a (X >=3D 4) || (Y >=3D 4) dimensions mesh. +*/ +#define PERIPHBASE_MAX_ADDRESS_LENGTH SIZE_256MB + +/** PeriphBase minimum address length is 64MB (0x04000000) + for a (X < 4) && (Y < 4) dimensions mesh. +*/ +#define PERIPHBASE_MIN_ADDRESS_LENGTH SIZE_64MB + +/** RootNodeBase address length is 16KB (0x00004000). +*/ +#define ROOTNODEBASE_ADDRESS_LENGTH SIZE_16KB + +/** Maximum number of CMN-600 Debug and Trace Logic Controllers (DTC). +*/ +#define MAX_DTC_COUNT 4 + +/** Starting value for the UID to represent the CMN600 devices. +*/ +#define CMN600_DEVICE_START_UID 0 + +/** Maximum CMN-600 devices supported by this generator. + This generator supports a maximum of 16 CMN-600 devices. + Note: This is not a hard limitation and can be extended if needed. + Corresponding changes would be needed to support the Name and + UID fields describing the serial port. + +*/ +#define MAX_CMN600_DEVICES_SUPPORTED 16 + +#endif // SSDT_CMN600_GENERATOR_H_ diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn= 600LibArm.inf b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/Ssdt= Cmn600LibArm.inf new file mode 100644 index 0000000000000000000000000000000000000000..821c0d531b983e19278062a1131= 7bba83fdc141a --- /dev/null +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600LibA= rm.inf @@ -0,0 +1,34 @@ +## @file +# Ssdt CMN-600 Table Generator +# +# Copyright (c) 2020, Arm Limited. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +[Defines] + INF_VERSION =3D 0x0001001B + BASE_NAME =3D SsdtCmn600LibArm + FILE_GUID =3D CEDB450D-8F0E-4ACC-8FB7-F72EC7D216A4 + VERSION_STRING =3D 1.0 + MODULE_TYPE =3D DXE_DRIVER + LIBRARY_CLASS =3D NULL|DXE_DRIVER + CONSTRUCTOR =3D AcpiSsdtCmn600LibConstructor + DESTRUCTOR =3D AcpiSsdtCmn600LibDestructor + +[Sources] + SsdtCmn600Generator.c + SsdtCmn600Generator.h + SsdtCmn600Template.asl + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + EmbeddedPkg/EmbeddedPkg.dec + ArmPlatformPkg/ArmPlatformPkg.dec + DynamicTablesPkg/DynamicTablesPkg.dec + +[LibraryClasses] + AmlLib + BaseLib + diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn= 600Template.asl b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/Ss= dtCmn600Template.asl new file mode 100644 index 0000000000000000000000000000000000000000..023a89e2ab3d753cb1cdb8c4237= 66294b0ea3fab --- /dev/null +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600Temp= late.asl @@ -0,0 +1,81 @@ +/** @file + SSDT CMN-600 Template + + Copyright (c) 2020, Arm Limited. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Reference(s): + - Arm CoreLink CMN-600 Coherent Mesh Network Technical Reference Manual = r3p0 + - Generic ACPI for Arm Components 1.0 Platform Design Document + + @par Glossary: + - {template} - Data fixed up using AML Fixup APIs. + - {codegen} - Data generated using AML Codegen APIs. +**/ + +DefinitionBlock ("SsdtCmn600.aml", "SSDT", 2, "ARMLTD", "CMN-600", 1) { + Scope (_SB) { + // CMN-600 device object for a X * Y mesh, where (X >=3D 4) || (Y >=3D= 4). + Device (CMN0) { // {template} + Name (_HID, "ARMHC600") + Name (_UID, 0x0) // {template} + + Name (_CRS, ResourceTemplate () { + // Descriptor for 256 MB of the CFG region at offset PERIPHBASE. + QWordMemory ( + ResourceConsumer, // bit 0 of general flags is 0. + PosDecode, + MinFixed, // Range is fixed. + MaxFixed, // Range is Fixed. + NonCacheable, + ReadWrite, + 0x00000000, // Granularity + 0xA0000000, // MinAddress // {templ= ate} + 0xAFFFFFFF, // MaxAddress // {templ= ate} + 0x00000000, // Translation + 0x10000000, // RangeLength // {templ= ate} + , // ResourceSourceIndex + , // ResourceSource + CFGR // DescriptorName + ) // QWordMemory + + // Descriptor for the root node. This is a 16 KB region at offset + // ROOTNODEBASE. In this example, ROOTNODEBASE starts at the 16 KB + // aligned offset of PERIPHBASE. + QWordMemory ( + ResourceConsumer, // bit 0 of general flags is 0. + PosDecode, + MinFixed, // Range is fixed. + MaxFixed, // Range is Fixed. + NonCacheable, + ReadWrite, + 0x00000000, // Granularity + 0xA0000000, // MinAddress // {templ= ate} + 0xAFFFFFFF, // MaxAddress // {templ= ate} + 0x00000000, // Translation + 0x10000000, // RangeLength // {templ= ate} + , // ResourceSourceIndex + , // ResourceSource + ROOT // DescriptorName + ) // QWordMemory + + // The Interrupt information is generated using AmlCodegen. + // Interrupt on PMU0 overflow, attached to DTC [0], with GSIV =3D = . + // + // Interrupt ( // {code= gen} + // ResourceConsumer, // ResourceUsage + // Level, // EdgeLevel + // ActiveHigh, // ActiveLevel + // Exclusive, // Shared + // , // ResourceSourceIndex + // , // ResourceSource + // // DescriptorName + // ) { + // 0xA5 // + // } // Interrupt + + }) // Name + } // Device + } // _SB +} // DefinitionBlock --=20 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=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 (#65446): https://edk2.groups.io/g/devel/message/65446 Mute This Topic: https://groups.io/mt/77013539/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-