coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
gpio_defs_cnp_h.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef _SOC_CANNONLAKE_GPIO_DEFS_CNP_H_H_
4 #define _SOC_CANNONLAKE_GPIO_DEFS_CNP_H_H_
5 
6 #ifndef __ACPI__
7 #include <stddef.h>
8 #endif
10 
11 #define GPIO_NUM_PAD_CFG_REGS 4 /* DW0, DW1, DW2, DW3 */
12 
13 #define NUM_GPIO_COMx_GPI_REGS(n) \
14  (ALIGN_UP((n), GPIO_MAX_NUM_PER_GROUP) / GPIO_MAX_NUM_PER_GROUP)
15 
16 #define NUM_GPIO_COM0_GPI_REGS NUM_GPIO_COMx_GPI_REGS(NUM_GPIO_COM0_PADS)
17 #define NUM_GPIO_COM1_GPI_REGS NUM_GPIO_COMx_GPI_REGS(NUM_GPIO_COM1_PADS)
18 #define NUM_GPIO_COM2_GPI_REGS NUM_GPIO_COMx_GPI_REGS(NUM_GPIO_COM2_PADS)
19 #define NUM_GPIO_COM3_GPI_REGS NUM_GPIO_COMx_GPI_REGS(NUM_GPIO_COM3_PADS)
20 #define NUM_GPIO_COM4_GPI_REGS NUM_GPIO_COMx_GPI_REGS(NUM_GPIO_COM4_PADS)
21 
22 #define NUM_GPI_STATUS_REGS \
23  ((NUM_GPIO_COM0_GPI_REGS) +\
24  (NUM_GPIO_COM1_GPI_REGS) +\
25  (NUM_GPIO_COM2_GPI_REGS) +\
26  (NUM_GPIO_COM3_GPI_REGS) +\
27  (NUM_GPIO_COM4_GPI_REGS))
28 /*
29  * IOxAPIC IRQs for the GPIOs
30  */
31 
32 /* Group A */
33 #define GPP_A0_IRQ 0x18
34 #define GPP_A1_IRQ 0x19
35 #define GPP_A2_IRQ 0x1a
36 #define GPP_A3_IRQ 0x1b
37 #define GPP_A4_IRQ 0x1c
38 #define GPP_A5_IRQ 0x1d
39 #define GPP_A6_IRQ 0x1e
40 #define GPP_A7_IRQ 0x1f
41 #define GPP_A8_IRQ 0x20
42 #define GPP_A9_IRQ 0x21
43 #define GPP_A10_IRQ 0x22
44 #define GPP_A11_IRQ 0x23
45 #define GPP_A12_IRQ 0x24
46 #define GPP_A13_IRQ 0x25
47 #define GPP_A14_IRQ 0x26
48 #define GPP_A15_IRQ 0x27
49 #define GPP_A16_IRQ 0x28
50 #define GPP_A17_IRQ 0x29
51 #define GPP_A18_IRQ 0x2a
52 #define GPP_A19_IRQ 0x2b
53 #define GPP_A20_IRQ 0x2c
54 #define GPP_A21_IRQ 0x2d
55 #define GPP_A22_IRQ 0x2e
56 #define GPP_A23_IRQ 0x2f
57 /* Group B */
58 #define GPP_B0_IRQ 0x30
59 #define GPP_B1_IRQ 0x31
60 #define GPP_B2_IRQ 0x32
61 #define GPP_B3_IRQ 0x33
62 #define GPP_B4_IRQ 0x34
63 #define GPP_B5_IRQ 0x35
64 #define GPP_B6_IRQ 0x36
65 #define GPP_B7_IRQ 0x37
66 #define GPP_B8_IRQ 0x38
67 #define GPP_B9_IRQ 0x39
68 #define GPP_B10_IRQ 0x3a
69 #define GPP_B11_IRQ 0x3b
70 #define GPP_B12_IRQ 0x3c
71 #define GPP_B13_IRQ 0x3d
72 #define GPP_B14_IRQ 0x3e
73 #define GPP_B15_IRQ 0x3f
74 #define GPP_B16_IRQ 0x40
75 #define GPP_B17_IRQ 0x41
76 #define GPP_B18_IRQ 0x42
77 #define GPP_B19_IRQ 0x43
78 #define GPP_B20_IRQ 0x44
79 #define GPP_B21_IRQ 0x45
80 #define GPP_B22_IRQ 0x46
81 #define GPP_B23_IRQ 0x47
82 /* Group C */
83 #define GPP_C0_IRQ 0x48
84 #define GPP_C1_IRQ 0x49
85 #define GPP_C2_IRQ 0x4a
86 #define GPP_C3_IRQ 0x4b
87 #define GPP_C4_IRQ 0x4c
88 #define GPP_C5_IRQ 0x4d
89 #define GPP_C6_IRQ 0x4e
90 #define GPP_C7_IRQ 0x4f
91 #define GPP_C8_IRQ 0x50
92 #define GPP_C9_IRQ 0x51
93 #define GPP_C10_IRQ 0x52
94 #define GPP_C11_IRQ 0x53
95 #define GPP_C12_IRQ 0x54
96 #define GPP_C13_IRQ 0x55
97 #define GPP_C14_IRQ 0x56
98 #define GPP_C15_IRQ 0x57
99 #define GPP_C16_IRQ 0x58
100 #define GPP_C17_IRQ 0x59
101 #define GPP_C18_IRQ 0x5a
102 #define GPP_C19_IRQ 0x5b
103 #define GPP_C20_IRQ 0x5c
104 #define GPP_C21_IRQ 0x5d
105 #define GPP_C22_IRQ 0x5e
106 #define GPP_C23_IRQ 0x5f
107 /* Group D */
108 #define GPP_D0_IRQ 0x60
109 #define GPP_D1_IRQ 0x61
110 #define GPP_D2_IRQ 0x62
111 #define GPP_D3_IRQ 0x63
112 #define GPP_D4_IRQ 0x64
113 #define GPP_D5_IRQ 0x65
114 #define GPP_D6_IRQ 0x66
115 #define GPP_D7_IRQ 0x67
116 #define GPP_D8_IRQ 0x68
117 #define GPP_D9_IRQ 0x69
118 #define GPP_D10_IRQ 0x6a
119 #define GPP_D11_IRQ 0x6b
120 #define GPP_D12_IRQ 0x6c
121 #define GPP_D13_IRQ 0x6d
122 #define GPP_D14_IRQ 0x6e
123 #define GPP_D15_IRQ 0x6f
124 #define GPP_D16_IRQ 0x70
125 #define GPP_D17_IRQ 0x71
126 #define GPP_D18_IRQ 0x72
127 #define GPP_D19_IRQ 0x73
128 #define GPP_D20_IRQ 0x74
129 #define GPP_D21_IRQ 0x75
130 #define GPP_D22_IRQ 0x76
131 #define GPP_D23_IRQ 0x77
132 /* Group E */
133 #define GPP_E0_IRQ 0x18
134 #define GPP_E1_IRQ 0x19
135 #define GPP_E2_IRQ 0x1a
136 #define GPP_E3_IRQ 0x1b
137 #define GPP_E4_IRQ 0x1c
138 #define GPP_E5_IRQ 0x1d
139 #define GPP_E6_IRQ 0x1e
140 #define GPP_E7_IRQ 0x1f
141 #define GPP_E8_IRQ 0x20
142 #define GPP_E9_IRQ 0x21
143 #define GPP_E10_IRQ 0x22
144 #define GPP_E11_IRQ 0x23
145 #define GPP_E12_IRQ 0x24
146 #define GPP_E13_IRQ 0x25
147 #define GPP_E14_IRQ 0x26
148 #define GPP_E15_IRQ 0x27
149 #define GPP_E16_IRQ 0x28
150 #define GPP_E17_IRQ 0x29
151 #define GPP_E18_IRQ 0x2a
152 #define GPP_E19_IRQ 0x2b
153 #define GPP_E20_IRQ 0x2c
154 #define GPP_E21_IRQ 0x2d
155 #define GPP_E22_IRQ 0x2e
156 #define GPP_E23_IRQ 0x2f
157 /* Group F */
158 #define GPP_F0_IRQ 0x30
159 #define GPP_F1_IRQ 0x31
160 #define GPP_F2_IRQ 0x32
161 #define GPP_F3_IRQ 0x33
162 #define GPP_F4_IRQ 0x34
163 #define GPP_F5_IRQ 0x35
164 #define GPP_F6_IRQ 0x36
165 #define GPP_F7_IRQ 0x37
166 #define GPP_F8_IRQ 0x38
167 #define GPP_F9_IRQ 0x39
168 #define GPP_F10_IRQ 0x3a
169 #define GPP_F11_IRQ 0x3b
170 #define GPP_F12_IRQ 0x3c
171 #define GPP_F13_IRQ 0x3d
172 #define GPP_F14_IRQ 0x3e
173 #define GPP_F15_IRQ 0x3f
174 #define GPP_F16_IRQ 0x40
175 #define GPP_F17_IRQ 0x41
176 #define GPP_F18_IRQ 0x42
177 #define GPP_F19_IRQ 0x43
178 #define GPP_F20_IRQ 0x44
179 #define GPP_F21_IRQ 0x45
180 #define GPP_F22_IRQ 0x46
181 #define GPP_F23_IRQ 0x47
182 /* Group G */
183 #define GPP_G0_IRQ 0x6c
184 #define GPP_G1_IRQ 0x6d
185 #define GPP_G2_IRQ 0x6e
186 #define GPP_G3_IRQ 0x6f
187 #define GPP_G4_IRQ 0x70
188 #define GPP_G5_IRQ 0x71
189 #define GPP_G6_IRQ 0x72
190 #define GPP_G7_IRQ 0x73
191 /* Group GPD */
192 #define GPD0_IRQ 0x60
193 #define GPD1_IRQ 0x61
194 #define GPD2_IRQ 0x62
195 #define GPD3_IRQ 0x63
196 #define GPD4_IRQ 0x64
197 #define GPD5_IRQ 0x65
198 #define GPD6_IRQ 0x66
199 #define GPD7_IRQ 0x67
200 #define GPD8_IRQ 0x68
201 #define GPD9_IRQ 0x69
202 #define GPD10_IRQ 0x6a
203 #define GPD11_IRQ 0x6b
204 /* Group H */
205 #define GPP_H0_IRQ 0x48
206 #define GPP_H1_IRQ 0x49
207 #define GPP_H2_IRQ 0x4a
208 #define GPP_H3_IRQ 0x4b
209 #define GPP_H4_IRQ 0x4c
210 #define GPP_H5_IRQ 0x4d
211 #define GPP_H6_IRQ 0x4e
212 #define GPP_H7_IRQ 0x4f
213 #define GPP_H8_IRQ 0x50
214 #define GPP_H9_IRQ 0x51
215 #define GPP_H10_IRQ 0x52
216 #define GPP_H11_IRQ 0x53
217 #define GPP_H12_IRQ 0x54
218 #define GPP_H13_IRQ 0x55
219 #define GPP_H14_IRQ 0x56
220 #define GPP_H15_IRQ 0x57
221 #define GPP_H16_IRQ 0x58
222 #define GPP_H17_IRQ 0x59
223 #define GPP_H18_IRQ 0x5a
224 #define GPP_H19_IRQ 0x5b
225 #define GPP_H20_IRQ 0x5c
226 #define GPP_H21_IRQ 0x5d
227 #define GPP_H22_IRQ 0x5e
228 #define GPP_H23_IRQ 0x5f
229 /* Group I */
230 #define GPP_I0_IRQ 0x18
231 #define GPP_I1_IRQ 0x19
232 #define GPP_I2_IRQ 0x1a
233 #define GPP_I3_IRQ 0x1b
234 #define GPP_I4_IRQ 0x1c
235 #define GPP_I5_IRQ 0x1d
236 #define GPP_I6_IRQ 0x1e
237 #define GPP_I7_IRQ 0x1f
238 #define GPP_I8_IRQ 0x20
239 #define GPP_I9_IRQ 0x21
240 #define GPP_I10_IRQ 0x22
241 #define GPP_I11_IRQ 0x23
242 #define GPP_I12_IRQ 0x24
243 #define GPP_I13_IRQ 0x25
244 #define GPP_I14_IRQ 0x26
245 #define GPP_I15_IRQ 0x27
246 #define GPP_I16_IRQ 0x28
247 #define GPP_I17_IRQ 0x29
248 #define GPP_I18_IRQ 0x2a
249 #define GPP_I19_IRQ 0x2b
250 #define GPP_I20_IRQ 0x2c
251 #define GPP_I21_IRQ 0x2d
252 #define GPP_I22_IRQ 0x2e
253 #define GPP_I23_IRQ 0x2f
254 /* Group J */
255 #define GPP_J0_IRQ 0x30
256 #define GPP_J1_IRQ 0x31
257 #define GPP_J2_IRQ 0x32
258 #define GPP_J3_IRQ 0x33
259 #define GPP_J4_IRQ 0x34
260 #define GPP_J5_IRQ 0x35
261 #define GPP_J6_IRQ 0x36
262 #define GPP_J7_IRQ 0x37
263 #define GPP_J8_IRQ 0x38
264 #define GPP_J9_IRQ 0x39
265 #define GPP_J10_IRQ 0x3a
266 #define GPP_J11_IRQ 0x3b
267 #define GPP_J12_IRQ 0x3c
268 #define GPP_J13_IRQ 0x3d
269 #define GPP_J14_IRQ 0x3e
270 #define GPP_J15_IRQ 0x3f
271 #define GPP_J16_IRQ 0x40
272 #define GPP_J17_IRQ 0x41
273 #define GPP_J18_IRQ 0x42
274 #define GPP_J19_IRQ 0x43
275 #define GPP_J20_IRQ 0x44
276 #define GPP_J21_IRQ 0x45
277 #define GPP_J22_IRQ 0x46
278 #define GPP_J23_IRQ 0x47
279 /* Group K */
280 #define GPP_K0_IRQ 0x48
281 #define GPP_K1_IRQ 0x49
282 #define GPP_K2_IRQ 0x4a
283 #define GPP_K3_IRQ 0x4b
284 #define GPP_K4_IRQ 0x4c
285 #define GPP_K5_IRQ 0x4d
286 #define GPP_K6_IRQ 0x4e
287 #define GPP_K7_IRQ 0x4f
288 #define GPP_K8_IRQ 0x50
289 #define GPP_K9_IRQ 0x51
290 #define GPP_K10_IRQ 0x52
291 #define GPP_K11_IRQ 0x53
292 #define GPP_K12_IRQ 0x54
293 #define GPP_K13_IRQ 0x55
294 #define GPP_K14_IRQ 0x56
295 #define GPP_K15_IRQ 0x57
296 #define GPP_K16_IRQ 0x58
297 #define GPP_K17_IRQ 0x59
298 #define GPP_K18_IRQ 0x5a
299 #define GPP_K19_IRQ 0x5b
300 #define GPP_K20_IRQ 0x5c
301 #define GPP_K21_IRQ 0x5d
302 #define GPP_K22_IRQ 0x5e
303 #define GPP_K23_IRQ 0x5f
304 /* Register defines. */
305 #define GPIO_MISCCFG 0x10
306 #define GPE_DW_SHIFT 8
307 #define GPE_DW_MASK 0xfff00
308 #define HOSTSW_OWN_REG_0 0xc0
309 #define GPI_INT_STS_0 0x100
310 #define GPI_INT_EN_0 0x120
311 #define GPI_SMI_STS_0 0x180
312 #define GPI_SMI_EN_0 0x1A0
313 #define GPI_NMI_STS_0 0x1c0
314 #define GPI_NMI_EN_0 0x1e0
315 #define PAD_CFG_BASE 0x600
316 
317 #endif