TianoCore EDK2 master
Loading...
Searching...
No Matches
ArmFdtInterrupt.c
Go to the documentation of this file.
1
14#include "FdtUtility.h"
15
26UINT32
27EFIAPI
29 UINT32 CONST *Data
30 )
31{
32 UINT32 IrqType;
33 UINT32 IrqId;
34
35 ASSERT (Data != NULL);
36
37 IrqType = fdt32_to_cpu (Data[IRQ_TYPE_OFFSET]);
38 IrqId = fdt32_to_cpu (Data[IRQ_NUMBER_OFFSET]);
39
40 switch (IrqType) {
41 case DT_SPI_IRQ:
42 IrqId += SPI_OFFSET;
43 break;
44
45 case DT_PPI_IRQ:
46 IrqId += PPI_OFFSET;
47 break;
48
49 default:
50 ASSERT (0);
51 IrqId = 0;
52 }
53
54 return IrqId;
55}
56
68UINT32
69EFIAPI
71 UINT32 CONST *Data
72 )
73{
74 UINT32 IrqFlags;
75 UINT32 AcpiIrqFlags;
76
77 ASSERT (Data != NULL);
78
79 IrqFlags = fdt32_to_cpu (Data[IRQ_FLAGS_OFFSET]);
80
81 AcpiIrqFlags = DT_IRQ_IS_EDGE_TRIGGERED (IrqFlags) ? BIT0 : 0;
82 AcpiIrqFlags |= DT_IRQ_IS_ACTIVE_LOW (IrqFlags) ? BIT1 : 0;
83
84 return AcpiIrqFlags;
85}
86
109EFIAPI
111 IN CONST VOID *Fdt,
112 IN INT32 Node,
113 OUT INT32 *AddressCells, OPTIONAL
114 OUT INT32 *SizeCells OPTIONAL
115 )
116{
117 return FdtGetAddressInfo (Fdt, Node, AddressCells, SizeCells);
118}
UINT32 EFIAPI FdtGetInterruptId(UINT32 CONST *Data)
EFI_STATUS EFIAPI FdtGetIntcAddressCells(IN CONST VOID *Fdt, IN INT32 Node, OUT INT32 *AddressCells, OPTIONAL OUT INT32 *SizeCells OPTIONAL)
UINT32 EFIAPI FdtGetInterruptFlags(UINT32 CONST *Data)
EFI_STATUS EFIAPI FdtGetAddressInfo(IN CONST VOID *Fdt, IN INT32 Node, OUT INT32 *AddressCells, OPTIONAL OUT INT32 *SizeCells OPTIONAL)
Definition: FdtUtility.c:778
#define PPI_OFFSET
Interrupt macros.
Definition: FdtUtility.h:59
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29