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.web12.9286.1651070982510016505 for ; Wed, 27 Apr 2022 07:49:42 -0700 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 92596ED1; Wed, 27 Apr 2022 07:49:41 -0700 (PDT) Received: from pierre123.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D15363F73B; Wed, 27 Apr 2022 07:49:40 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Sami Mujawar Subject: [PATCH v1 1/1] DynamicTables: Fix DT PCI interrupt flags parsing Date: Wed, 27 Apr 2022 16:49:31 +0200 Message-Id: <20220427144931.400413-1-Pierre.Gondois@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Pierre Gondois Device Tree PCI interrupt flags use the convention described at linux/Documentation/devicetree/bindings/interrupt-controller/arm,gic.yaml The 3rd cell is the flags, encoded as follows: bits[3:0] trigger type and level flags. 1 =3D low-to-high edge triggered 2 =3D high-to-low edge triggered (invalid for SPIs) 4 =3D active high level-sensitive 8 =3D active low level-sensitive (invalid for SPIs). Fix the incorrect code. Signed-off-by: Pierre Gondois --- .../Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c | 2 +- DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtUtility.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPci= eGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtP= cieGenerator.c index a34018151f2d..d5b1c153e98f 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenera= tor.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenera= tor.c @@ -449,7 +449,7 @@ GeneratePrt ( if ((Index > 0) && (IrqMapInfo->IntcInterrupt.Interrupt >=3D 32) && (IrqMapInfo->IntcInterrupt.Interrupt < 1020) && - ((IrqMapInfo->IntcInterrupt.Flags & 0x3) !=3D BIT0)) + ((IrqMapInfo->IntcInterrupt.Flags & 0x3) !=3D 0)) { Status =3D EFI_INVALID_PARAMETER; ASSERT_EFI_ERROR (Status); diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtUtility.h b/D= ynamicTablesPkg/Library/FdtHwInfoParserLib/FdtUtility.h index f2f425632b10..3f5d131d9ae5 100644 --- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtUtility.h +++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtUtility.h @@ -60,7 +60,7 @@ #define SPI_OFFSET (32U) #define DT_PPI_IRQ (1U) #define DT_SPI_IRQ (0U) -#define DT_IRQ_IS_EDGE_TRIGGERED(x) ((((x) & (BIT0 | BIT2)) !=3D 0)) +#define DT_IRQ_IS_EDGE_TRIGGERED(x) ((((x) & (BIT0 | BIT1)) !=3D 0)) #define DT_IRQ_IS_ACTIVE_LOW(x) ((((x) & (BIT1 | BIT3)) !=3D 0)) #define IRQ_TYPE_OFFSET (0U) #define IRQ_NUMBER_OFFSET (1U) --=20 2.25.1