drivers/usb/acpi: Don't add GPIOs to _CRS for Intel Bluetooth
[coreboot2.git] / src / soc / amd / genoa_poc / acpi / mmio.asl
blob9b5e1d2d2b42355495a5c2f2b421f1cdae3769d2
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <soc/amd/common/acpi/aoac.asl>
4 #include <soc/aoac_defs.h>
5 #include <soc/gpio.h>
6 #include <soc/iomap.h>
7 #include <amdblocks/acpimmio_map.h>
9 Device (AAHB)
11         Name (_HID, "AAHB0000")
12         Name (_UID, 0x0)
13         Name (_CRS, ResourceTemplate()
14         {
15                 Memory32Fixed (ReadWrite, ALINK_AHB_ADDRESS, 0x2000)
16         })
17         Name (_STA, 0xb)
20 Device (GPIO)
22         Name (_HID, GPIO_DEVICE_NAME)
23         Name (_CID, GPIO_DEVICE_NAME)
24         Name (_UID, 0)
25         Name (_DDN, GPIO_DEVICE_DESC)
27         Method (_CRS, 0) {
28                 Local0 = ResourceTemplate() {
29                         Interrupt (
30                                 ResourceConsumer,
31                                 Level,
32                                 ActiveLow,
33                                 Shared, , , IRQR)
34                         { 0 }
35                         Memory32Fixed (ReadWrite, ACPIMMIO_GPIO0_BASE, 0x400)
36                 }
37                 CreateDWordField (Local0, IRQR._INT, IRQN)
38                 If (PICM) {
39                         IRQN = IGPI
40                 } Else {
41                         IRQN = PGPI
42                 }
43                 If (IRQN == 0x1f || IRQN == 0) {
44                         Return (ResourceTemplate() {
45                                 Memory32Fixed (ReadWrite, ACPIMMIO_GPIO0_BASE, 0x400)
46                         })
47                 } Else {
48                         Return (Local0)
49                 }
50         }
52         Method (_STA, 0x0, NotSerialized)
53         {
54                 Return (0x0F)
55         }
58 Device (FUR0)
60         Name (_HID, "AMDI0020")
61         Name (_UID, 0x0)
62         Method (_CRS, 0) {
63                 Local0 = ResourceTemplate() {
64                         Interrupt (
65                                 ResourceConsumer,
66                                 Edge,
67                                 ActiveHigh,
68                                 Exclusive, , , IRQR)
69                         { 0 }
70                         Memory32Fixed (ReadWrite, APU_UART0_BASE, 0x1000)
71                 }
72                 CreateDWordField (Local0, IRQR._INT, IRQN)
73                 If (PICM) {
74                         IRQN = IUA0
75                 } Else {
76                         IRQN = PUA0
77                 }
78                 If (IRQN == 0x1f) {
79                         Return (ResourceTemplate() {
80                                 Memory32Fixed (ReadWrite, APU_UART0_BASE, 0x1000)
81                         })
82                 } Else {
83                         Return (Local0)
84                 }
85         }
87         Name (STAT, 0x0)
88         Method (_STA, 0x0, NotSerialized)
89         {
90                 Return (STAT)
91         }
93         AOAC_DEVICE(FCH_AOAC_DEV_UART0, 0)
96 Device (FUR1) {
97         Name (_HID, "AMDI0020")
98         Name (_UID, 0x1)
99         Method (_CRS, 0) {
100                 Local0 = ResourceTemplate() {
101                         Interrupt (
102                                 ResourceConsumer,
103                                 Edge,
104                                 ActiveHigh,
105                                 Exclusive, , , IRQR)
106                         { 0 }
107                         Memory32Fixed (ReadWrite, APU_UART1_BASE, 0x1000)
108                 }
109                 CreateDWordField (Local0, IRQR._INT, IRQN)
110                 If (PICM) {
111                         IRQN = IUA1
112                 } Else {
113                         IRQN = PUA1
114                 }
115                 If (IRQN == 0x1f) {
116                         Return (ResourceTemplate() {
117                                 Memory32Fixed (ReadWrite, APU_UART1_BASE, 0x1000)
118                         })
119                 } Else {
120                         Return (Local0)
121                 }
122         }
124         Name (STAT, 0x0)
125         Method (_STA, 0x0, NotSerialized)
126         {
127                 Return (STAT)
128         }
130         AOAC_DEVICE(FCH_AOAC_DEV_UART1, 0)
133 Device (FUR2) {
134         Name (_HID, "AMDI0020")
135         Name (_UID, 0x2)
136         Method (_CRS, 0) {
137                 Local0 = ResourceTemplate() {
138                         Interrupt (
139                                 ResourceConsumer,
140                                 Edge,
141                                 ActiveHigh,
142                                 Exclusive, , , IRQR)
143                         { 0 }
144                         Memory32Fixed (ReadWrite, APU_UART2_BASE, 0x1000)
145                 }
146                 CreateDWordField (Local0, IRQR._INT, IRQN)
147                 If (PICM) {
148                         IRQN = IUA2
149                 } Else {
150                         IRQN = PUA2
151                 }
152                 If (IRQN == 0x1f) {
153                         Return (ResourceTemplate() {
154                                 Memory32Fixed (ReadWrite, APU_UART2_BASE, 0x1000)
155                         })
156                 } Else {
157                         Return (Local0)
158                 }
159         }
161         Name (STAT, 0x0)
162         Method (_STA, 0x0, NotSerialized)
163         {
164                 Return (STAT)
165         }
167         AOAC_DEVICE(FCH_AOAC_DEV_UART2, 0)
170 Device (I2C0) {
171         Name (_HID, "AMDI0010")
172         Name (_UID, 0x0)
173         Method (_CRS, 0) {
174                 Local0 = ResourceTemplate() {
175                         Interrupt (
176                                 ResourceConsumer,
177                                 Edge,
178                                 ActiveHigh,
179                                 Exclusive, , , IRQR)
180                         { 0 }
181                         Memory32Fixed (ReadWrite, APU_I2C0_BASE, 0x1000)
182                 }
183                 CreateDWordField (Local0, IRQR._INT, IRQN)
184                 If (PICM) {
185                         IRQN = II20
186                 } Else {
187                         IRQN = PI20
188                 }
189                 If (IRQN == 0x1f) {
190                         Return (ResourceTemplate() {
191                                 Memory32Fixed (ReadWrite, APU_I2C0_BASE, 0x1000)
192                         })
193                 } Else {
194                         Return (Local0)
195                 }
196         }
198         Name (STAT, 0x0)
199         Method (_STA, 0x0, NotSerialized)
200         {
201                 Return (STAT)
202         }
204         AOAC_DEVICE(FCH_AOAC_DEV_I2C0, 0)
207 Device (I2C1) {
208         Name (_HID, "AMDI0010")
209         Name (_UID, 0x1)
210         Method (_CRS, 0) {
211                 Local0 = ResourceTemplate() {
212                         Interrupt (
213                                 ResourceConsumer,
214                                 Edge,
215                                 ActiveHigh,
216                                 Exclusive, , , IRQR)
217                         { 0 }
218                         Memory32Fixed (ReadWrite, APU_I2C1_BASE, 0x1000)
219                 }
220                 CreateDWordField (Local0, IRQR._INT, IRQN)
221                 If (PICM) {
222                         IRQN = II21
223                 } Else {
224                         IRQN = PI21
225                 }
226                 If (IRQN == 0x1f) {
227                         Return (ResourceTemplate() {
228                                 Memory32Fixed (ReadWrite, APU_I2C1_BASE, 0x1000)
229                         })
230                 } Else {
231                         Return (Local0)
232                 }
233         }
235         Name (STAT, 0x0)
236         Method (_STA, 0x0, NotSerialized)
237         {
238                 Return (STAT)
239         }
241         AOAC_DEVICE(FCH_AOAC_DEV_I2C1, 0)
244 Device (I2C2) {
245         Name (_HID, "AMDI0010")
246         Name (_UID, 0x2)
247         Method (_CRS, 0) {
248                 Local0 = ResourceTemplate() {
249                         Interrupt (
250                                 ResourceConsumer,
251                                 Edge,
252                                 ActiveHigh,
253                                 Exclusive, , , IRQR)
254                         { 0 }
255                         Memory32Fixed (ReadWrite, APU_I2C2_BASE, 0x1000)
256                 }
257                 CreateDWordField (Local0, IRQR._INT, IRQN)
258                 If (PICM) {
259                         IRQN = II22
260                 } Else {
261                         IRQN = PI22
262                 }
263                 If (IRQN == 0x1f) {
264                         Return (ResourceTemplate() {
265                                 Memory32Fixed (ReadWrite, APU_I2C2_BASE, 0x1000)
266                         })
267                 } Else {
268                         Return (Local0)
269                 }
270         }
272         Name (STAT, 0x0)
273         Method (_STA, 0x0, NotSerialized)
274         {
275                 Return (STAT)
276         }
278         AOAC_DEVICE(FCH_AOAC_DEV_I2C2, 0)
281 Device (I2C3)
283         Name (_HID, "AMDI0010")
284         Name (_UID, 0x3)
285         Method (_CRS, 0) {
286                 Local0 = ResourceTemplate() {
287                         Interrupt (
288                                 ResourceConsumer,
289                                 Edge,
290                                 ActiveHigh,
291                                 Exclusive, , , IRQR)
292                         { 0 }
293                         Memory32Fixed (ReadWrite, APU_I2C3_BASE, 0x1000)
294                 }
295                 CreateDWordField (Local0, IRQR._INT, IRQN)
296                 If (PICM) {
297                         IRQN = II23
298                 } Else {
299                         IRQN = PI23
300                 }
301                 If (IRQN == 0x1f) {
302                         Return (ResourceTemplate() {
303                                 Memory32Fixed (ReadWrite, APU_I2C3_BASE, 0x1000)
304                         })
305                 } Else {
306                         Return (Local0)
307                 }
308         }
310         Name (STAT, 0x0)
311         Method (_STA, 0x0, NotSerialized)
312         {
313                 Return (STAT)
314         }
316         AOAC_DEVICE(FCH_AOAC_DEV_I2C3, 0)
319 Device (I2C4)
321         Name (_HID, "AMDI0010")
322         Name (_UID, 0x4)
323         Method (_CRS, 0) {
324                 Local0 = ResourceTemplate() {
325                         Interrupt (
326                                 ResourceConsumer,
327                                 Edge,
328                                 ActiveHigh,
329                                 Exclusive, , , IRQR)
330                         { 0 }
331                         Memory32Fixed (ReadWrite, APU_I2C4_BASE, 0x1000)
332                 }
333                 CreateDWordField (Local0, IRQR._INT, IRQN)
334                 If (PICM) {
335                         IRQN = II24
336                 } Else {
337                         IRQN = PI24
338                 }
339                 If (IRQN == 0x1f) {
340                         Return (ResourceTemplate() {
341                                 Memory32Fixed (ReadWrite, APU_I2C4_BASE, 0x1000)
342                         })
343                 } Else {
344                         Return (Local0)
345                 }
346         }
348         Name (STAT, 0x0)
349         Method (_STA, 0x0, NotSerialized)
350         {
351                 Return (STAT)
352         }
354         AOAC_DEVICE(FCH_AOAC_DEV_I2C4, 0)
357 Device (I2C5)
359         Name (_HID, "AMDI0010")
360         Name (_UID, 0x5)
361         Method (_CRS, 0) {
362                 Local0 = ResourceTemplate() {
363                         Interrupt (
364                                 ResourceConsumer,
365                                 Edge,
366                                 ActiveHigh,
367                                 Exclusive, , , IRQR)
368                         { 0 }
369                         Memory32Fixed (ReadWrite, APU_I2C5_BASE, 0x1000)
370                 }
371                 CreateDWordField (Local0, IRQR._INT, IRQN)
372                 If (PICM) {
373                         IRQN = II25
374                 } Else {
375                         IRQN = PI25
376                 }
377                 If (IRQN == 0x1f) {
378                         Return (ResourceTemplate() {
379                                 Memory32Fixed (ReadWrite, APU_I2C5_BASE, 0x1000)
380                         })
381                 } Else {
382                         Return (Local0)
383                 }
384         }
386         Name (STAT, 0x0)
387         Method (_STA, 0x0, NotSerialized)
388         {
389                 Return (STAT)
390         }
392         AOAC_DEVICE(FCH_AOAC_DEV_I2C5, 0)
395 Device (MISC)
397         Name (_HID, "AMD0040")
398         Name (_UID, 0x3)
399         Name (_CRS, ResourceTemplate() {
400                 Memory32Fixed (ReadWrite, ACPIMMIO_MISC_BASE, 0x100)
401         })
402         Name (_DSD, Package ()
403         {
404                 ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
405                 Package ()
406                 {
407                         Package () { "is-rv", 1 },
408                 },
409         })
410         Method (_STA, 0x0, NotSerialized)
411         {
412                 Return (0x0B)
413         }