coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
irq.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef _BAYTRAIL_IRQ_H_
4 #define _BAYTRAIL_IRQ_H_
5 
6 #define PIRQA_APIC_IRQ 16
7 #define PIRQB_APIC_IRQ 17
8 #define PIRQC_APIC_IRQ 18
9 #define PIRQD_APIC_IRQ 19
10 #define PIRQE_APIC_IRQ 20
11 #define PIRQF_APIC_IRQ 21
12 #define PIRQG_APIC_IRQ 22
13 #define PIRQH_APIC_IRQ 23
14 
15 /* The below IRQs are for when devices are in ACPI mode. Active low. */
16 #define LPE_DMA0_IRQ 24
17 #define LPE_DMA1_IRQ 25
18 #define LPE_SSP0_IRQ 26
19 #define LPE_SSP1_IRQ 27
20 #define LPE_SSP2_IRQ 28
21 #define LPE_IPC2HOST_IRQ 29
22 #define LPSS_I2C1_IRQ 32
23 #define LPSS_I2C2_IRQ 33
24 #define LPSS_I2C3_IRQ 34
25 #define LPSS_I2C4_IRQ 35
26 #define LPSS_I2C5_IRQ 36
27 #define LPSS_I2C6_IRQ 37
28 #define LPSS_I2C7_IRQ 38
29 #define LPSS_HSUART1_IRQ 39
30 #define LPSS_HSUART2_IRQ 40
31 #define LPSS_SPI_IRQ 41
32 #define LPSS_DMA1_IRQ 42
33 #define LPSS_DMA2_IRQ 43
34 #define SCC_EMMC_IRQ 44
35 #define SCC_SDIO_IRQ 46
36 #define SCC_SD_IRQ 47
37 #define GPIO_NC_IRQ 48
38 #define GPIO_SC_IRQ 49
39 #define GPIO_SUS_IRQ 50
40 /* GPIO direct / dedicated IRQs. */
41 #define GPIO_S0_DED_IRQ_0 51
42 #define GPIO_S0_DED_IRQ_1 52
43 #define GPIO_S0_DED_IRQ_2 53
44 #define GPIO_S0_DED_IRQ_3 54
45 #define GPIO_S0_DED_IRQ_4 55
46 #define GPIO_S0_DED_IRQ_5 56
47 #define GPIO_S0_DED_IRQ_6 57
48 #define GPIO_S0_DED_IRQ_7 58
49 #define GPIO_S0_DED_IRQ_8 59
50 #define GPIO_S0_DED_IRQ_9 60
51 #define GPIO_S0_DED_IRQ_10 61
52 #define GPIO_S0_DED_IRQ_11 62
53 #define GPIO_S0_DED_IRQ_12 63
54 #define GPIO_S0_DED_IRQ_13 64
55 #define GPIO_S0_DED_IRQ_14 65
56 #define GPIO_S0_DED_IRQ_15 66
57 #define GPIO_S5_DED_IRQ_0 67
58 #define GPIO_S5_DED_IRQ_1 68
59 #define GPIO_S5_DED_IRQ_2 69
60 #define GPIO_S5_DED_IRQ_3 70
61 #define GPIO_S5_DED_IRQ_4 71
62 #define GPIO_S5_DED_IRQ_5 72
63 #define GPIO_S5_DED_IRQ_6 73
64 #define GPIO_S5_DED_IRQ_7 74
65 #define GPIO_S5_DED_IRQ_8 75
66 #define GPIO_S5_DED_IRQ_9 76
67 #define GPIO_S5_DED_IRQ_10 77
68 #define GPIO_S5_DED_IRQ_11 78
69 #define GPIO_S5_DED_IRQ_12 79
70 #define GPIO_S5_DED_IRQ_13 80
71 #define GPIO_S5_DED_IRQ_14 81
72 #define GPIO_S5_DED_IRQ_15 82
73 /* DIRQs - Two levels of expansion to evaluate to numeric constants for ASL. */
74 #define _GPIO_S0_DED_IRQ(slot) GPIO_S0_DED_IRQ_##slot
75 #define _GPIO_S5_DED_IRQ(slot) GPIO_S5_DED_IRQ_##slot
76 #define GPIO_S0_DED_IRQ(slot) _GPIO_S0_DED_IRQ(slot)
77 #define GPIO_S5_DED_IRQ(slot) _GPIO_S5_DED_IRQ(slot)
78 
79 /* PIC IRQ settings. */
80 #define PIRQ_PIC_IRQDISABLE 0x0
81 #define PIRQ_PIC_IRQ3 0x3
82 #define PIRQ_PIC_IRQ4 0x4
83 #define PIRQ_PIC_IRQ5 0x5
84 #define PIRQ_PIC_IRQ6 0x6
85 #define PIRQ_PIC_IRQ7 0x7
86 #define PIRQ_PIC_IRQ9 0x9
87 #define PIRQ_PIC_IRQ10 0xa
88 #define PIRQ_PIC_IRQ11 0xb
89 #define PIRQ_PIC_IRQ12 0xc
90 #define PIRQ_PIC_IRQ14 0xe
91 #define PIRQ_PIC_IRQ15 0xf
92 
93 /* Overloaded term, but these values determine the per device route. */
94 #define PIRQA 0
95 #define PIRQB 1
96 #define PIRQC 2
97 #define PIRQD 3
98 #define PIRQE 4
99 #define PIRQF 5
100 #define PIRQG 6
101 #define PIRQH 7
102 
103 /* These registers live behind the ILB_BASE_ADDRESS */
104 #define ACTL 0x00
105 # define SCIS_MASK 0x07
106 # define SCIS_IRQ9 0x00
107 # define SCIS_IRQ10 0x01
108 # define SCIS_IRQ11 0x02
109 # define SCIS_IRQ20 0x04
110 # define SCIS_IRQ21 0x05
111 # define SCIS_IRQ22 0x06
112 # define SCIS_IRQ23 0x07
113 
114 /*
115  * In each mainboard directory there should exist a header file irqroute.h that
116  * defines the PCI_DEV_PIRQ_ROUTES and PIRQ_PIC_ROUTES macros which
117  * consist of PCI_DEV_PIRQ_ROUTE and PIRQ_PIC entries.
118  */
119 
120 #if !defined(__ASSEMBLER__) && !defined(__ACPI__)
121 #include <stdint.h>
122 
123 #define NUM_IR_DEVS 32
124 #define NUM_PIRQS 8
125 
127  /* Per device configuration. */
129  /* Route path for each internal PIRQx in PIC mode. */
131 };
132 
134 
135 #define DEFINE_IRQ_ROUTES \
136  const struct baytrail_irq_route global_baytrail_irq_route = { \
137  .pcidev = { PCI_DEV_PIRQ_ROUTES, }, \
138  .pic = { PIRQ_PIC_ROUTES, }, \
139  }
140 
141 /* The following macros are used for ACPI by the ASL compiler */
142 #define PCI_DEV_PIRQ_ROUTE(dev_, a_, b_, c_, d_) \
143  [dev_] = (((PIRQ ## d_) << 12) | ((PIRQ ## c_) << 8) | \
144  ((PIRQ ## b_) << 4) | ((PIRQ ## a_) << 0))
145 
146 #define PIRQ_PIC(pirq_, pic_irq_) \
147  [PIRQ ## pirq_] = PIRQ_PIC_IRQ ## pic_irq_
148 
149 #endif /* !defined(__ASSEMBLER__) && !defined(__ACPI__) */
150 
151 #endif /* _BAYTRAIL_IRQ_H_ */
#define NUM_IR_DEVS
Definition: irq.h:123
#define NUM_PIRQS
Definition: irq.h:124
const struct baytrail_irq_route global_baytrail_irq_route
unsigned short uint16_t
Definition: stdint.h:11
unsigned char uint8_t
Definition: stdint.h:8
uint16_t pcidev[NUM_IR_DEVS]
Definition: irq.h:128
uint8_t pic[NUM_PIRQS]
Definition: irq.h:130