From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.8728.1643384459955138588 for ; Fri, 28 Jan 2022 07:41:00 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: pierre.gondois@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 986CC1396; Fri, 28 Jan 2022 07:40:59 -0800 (PST) Received: from e126645.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 752D43F793; Fri, 28 Jan 2022 07:40:58 -0800 (PST) From: "PierreGondois" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Sami Mujawar Subject: [PATCH v3 3/8] DynamicTablesPkg: AcpiSsdtPcieLibArm: Fix _PRT description Date: Fri, 28 Jan 2022 16:40:58 +0100 Message-Id: <20220128154103.20752-4-Pierre.Gondois@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220128154103.20752-1-Pierre.Gondois@arm.com> References: <20220128154103.20752-1-Pierre.Gondois@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Pierre Gondois In ACPI 6.4, s6.2.13, _PRT objects describing PCI legacy interrupts can be defined following 2 models. In the first model, a _SRS object must be described to modify the PCI interrupt. The _CRS and _PRS object allows to describe the PCI interrupt (level/edge triggered, active high/low). In the second model, the PCI interrupt cannot be described with a similar granularity. PCI interrupts are by default level triggered, active low. GicV2 SPI interrupts are level or edge triggered, active high. To correctly describe PCI interrupts, the first model is used, even though Arm Base Boot Requirements v1.0 requires to use the second mode. Signed-off-by: Pierre Gondois --- Notes: v3: - New patch. [Pierre] .../AcpiSsdtPcieLibArm/SsdtPcieGenerator.c | 47 +++++++++++++++++-- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPci= eGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtP= cieGenerator.c index 3e22587d4a25..6823a98795c8 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenera= tor.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenera= tor.c @@ -1,7 +1,7 @@ /** @file SSDT Pcie Table Generator. =20 - Copyright (c) 2021, Arm Limited. All rights reserved.
+ Copyright (c) 2021 - 2022, Arm Limited. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -295,6 +295,10 @@ GeneratePciDeviceInfo ( Method (_CRS, 0) { Return CRS0 }) + Method (_PRS, 0) { + Return CRS0 + }) + Method (_SRS, 1) { } Method (_DIS) { } } =20 @@ -302,9 +306,12 @@ GeneratePciDeviceInfo ( PCI Firmware Specification - Revision 3.3, s3.5. "Device State at Firmware/Operating System Handoff" =20 - The _PRS and _SRS are not supported, cf Arm Base Boot Requirements v1.= 0: + Warning: The Arm Base Boot Requirements v1.0 states the following: "The _PRS (Possible Resource Settings) and _SRS (Set Resource Settings= ) are not supported." + However, the first model to describe PCI legacy interrupts is used (cf= . ACPI + 6.4 s6.2.13) as PCI defaults (Level Triggered, Active Low) are not com= patible + with GICv2 (must be Active High). =20 @param [in] Irq Interrupt controller interrupt. @param [in] IrqFlags Interrupt flags. @@ -416,7 +423,41 @@ GenerateLinkDevice ( return Status; } =20 - // ASL:Method (_DIS, 1) {} + // ASL: + // Method (_PRS, 0) { + // Return (CRS0) + // } + Status =3D AmlCodeGenMethodRetNameString ( + "_PRS", + "CRS0", + 0, + FALSE, + 0, + LinkNode, + NULL + ); + if (EFI_ERROR (Status)) { + ASSERT (0); + return Status; + } + + // ASL:Method (_SRS, 1) {} + // Not possible to disable interrupts. + Status =3D AmlCodeGenMethodRetNameString ( + "_SRS", + NULL, + 1, + FALSE, + 0, + LinkNode, + NULL + ); + if (EFI_ERROR (Status)) { + ASSERT (0); + return Status; + } + + // ASL:Method (_DIS, 0) {} // Not possible to disable interrupts. Status =3D AmlCodeGenMethodRetNameString ( "_DIS", --=20 2.25.1