]> git.proxmox.com Git - mirror_edk2.git/commitdiff
DynamicTables: Fix DT PCI interrupt flags parsing
authorPierre Gondois <pierre.gondois@arm.com>
Wed, 27 Apr 2022 14:49:31 +0000 (16:49 +0200)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 18 Jul 2022 12:44:09 +0000 (12:44 +0000)
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 = low-to-high edge triggered
  2 = high-to-low edge triggered (invalid for SPIs)
  4 = active high level-sensitive
  8 = active low level-sensitive (invalid for SPIs).

Fix the incorrect code.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtUtility.h

index a34018151f2d41ae808fec5ea9f257904a68d2b5..626e53d70205159ebbf75ea3fe8887a04c2b4b04 100644 (file)
@@ -449,7 +449,7 @@ GeneratePrt (
     if ((Index > 0)   &&\r
         (IrqMapInfo->IntcInterrupt.Interrupt >= 32)   &&\r
         (IrqMapInfo->IntcInterrupt.Interrupt < 1020)  &&\r
-        ((IrqMapInfo->IntcInterrupt.Flags & 0x3) != BIT0))\r
+        ((IrqMapInfo->IntcInterrupt.Flags & 0xB) != 0))\r
     {\r
       Status = EFI_INVALID_PARAMETER;\r
       ASSERT_EFI_ERROR (Status);\r
index f2f425632b1060e8e5a3f0829b8a709a3265d487..3f5d131d9ae560b14ff70469b1f716b9cbd32824 100644 (file)
@@ -60,7 +60,7 @@
 #define SPI_OFFSET  (32U)\r
 #define DT_PPI_IRQ  (1U)\r
 #define DT_SPI_IRQ  (0U)\r
-#define DT_IRQ_IS_EDGE_TRIGGERED(x)  ((((x) & (BIT0 | BIT2)) != 0))\r
+#define DT_IRQ_IS_EDGE_TRIGGERED(x)  ((((x) & (BIT0 | BIT1)) != 0))\r
 #define DT_IRQ_IS_ACTIVE_LOW(x)      ((((x) & (BIT1 | BIT3)) != 0))\r
 #define IRQ_TYPE_OFFSET    (0U)\r
 #define IRQ_NUMBER_OFFSET  (1U)\r