soc/intel/xeon_sp/skx: Use Kconfig symbol
[coreboot2.git] / src / soc / amd / picasso / acpi / mmio.asl
blobd8bbf06aecf0ea59e6e8f35ee9704572d534bf44
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         Method (_STA, 0x0, NotSerialized)
18         {
19                 Return (0x0b)
20         }
23 Device (GPIO)
25         Name (_HID, GPIO_DEVICE_NAME)
26         Name (_CID, GPIO_DEVICE_NAME)
27         Name (_UID, 0)
28         Name (_DDN, GPIO_DEVICE_DESC)
30         Method (_CRS, 0) {
31                 Local0 = ResourceTemplate() {
32                         Interrupt (
33                                 ResourceConsumer,
34                                 Level,
35                                 ActiveLow,
36                                 Shared, , , IRQR)
37                         { 0 }
38                         Memory32Fixed (ReadWrite, ACPIMMIO_GPIO0_BASE, 0x400)
39                 }
40                 CreateDWordField (Local0, IRQR._INT, IRQN)
41                 If (PICM) {
42                         IRQN = IGPI
43                 } Else {
44                         IRQN = PGPI
45                 }
46                 If (IRQN == 0x1f) {
47                         Return (ResourceTemplate() {
48                                 Memory32Fixed (ReadWrite, ACPIMMIO_GPIO0_BASE, 0x400)
49                         })
50                 } Else {
51                         Return (Local0)
52                 }
53         }
55         Method (_STA, 0x0, NotSerialized)
56         {
57                 Return (0x0F)
58         }
61 Device (MMC0)
63         Name (_HID, "AMDI0040")
64         Name (_UID, 0x0)
65         Method (_CRS, 0) {
66                 Local0 = ResourceTemplate() {
67                         Interrupt (
68                                 ResourceConsumer,
69                                 Level,
70                                 ActiveLow,
71                                 Exclusive, , , IRQR)
72                         { 0 }
73                         Memory32Fixed (ReadWrite, APU_EMMC_BASE, 0x1000)
74                 }
75                 CreateDWordField (Local0, IRQR._INT, IRQN)
76                 If (PICM) {
77                         IRQN = IMMC
78                 } Else {
79                         IRQN = PMMC
80                 }
81                 If (IRQN == 0x1f) {
82                         Return (ResourceTemplate(){
83                                 Memory32Fixed (ReadWrite, APU_EMMC_BASE, 0x1000)
84                         })
85                 } Else {
86                         Return (Local0)
87                 }
88         }
90         Name (STAT, 0x0)
91         Method (_STA, 0x0, NotSerialized)
92         {
93                 Return (STAT)
94         }
96         Device (CARD)
97         {
98                 Name (_ADR, 0x00000008)
99                 Method (_RMV, 0, NotSerialized)
100                 {
101                         Return (0)
102                 }
103         }
106 Device (FUR0)
108         Name (_HID, "AMDI0020")
109         Name (_UID, 0x0)
110         Method (_CRS, 0) {
111                 Local0 = ResourceTemplate() {
112                         Interrupt (
113                                 ResourceConsumer,
114                                 Edge,
115                                 ActiveHigh,
116                                 Exclusive, , , IRQR)
117                         { 0 }
118                         Memory32Fixed (ReadWrite, APU_UART0_BASE, 0x1000)
119                         Memory32Fixed (ReadWrite, APU_DMAC0_BASE, 0x1000)
120                 }
121                 CreateDWordField (Local0, IRQR._INT, IRQN)
122                 If (PICM) {
123                         IRQN = IUA0
124                 } Else {
125                         IRQN = PUA0
126                 }
127                 If (IRQN == 0x1f) {
128                         Return (ResourceTemplate() {
129                                 Memory32Fixed (ReadWrite, APU_UART0_BASE, 0x1000)
130                                 Memory32Fixed (ReadWrite, APU_DMAC0_BASE, 0x1000)
131                         })
132                 } Else {
133                         Return (Local0)
134                 }
135         }
137         Name (STAT, 0x0)
138         Method (_STA, 0x0, NotSerialized)
139         {
140                 Return (STAT)
141         }
143         AOAC_DEVICE(FCH_AOAC_DEV_UART0, 0)
146 Device (FUR1) {
147         Name (_HID, "AMDI0020")
148         Name (_UID, 0x1)
149         Method (_CRS, 0) {
150                 Local0 = ResourceTemplate() {
151                         Interrupt (
152                                 ResourceConsumer,
153                                 Edge,
154                                 ActiveHigh,
155                                 Exclusive, , , IRQR)
156                         { 0 }
157                         Memory32Fixed (ReadWrite, APU_UART1_BASE, 0x1000)
158                         Memory32Fixed (ReadWrite, APU_DMAC1_BASE, 0x1000)
159                 }
160                 CreateDWordField (Local0, IRQR._INT, IRQN)
161                 If (PICM) {
162                         IRQN = IUA1
163                 } Else {
164                         IRQN = PUA1
165                 }
166                 If (IRQN == 0x1f) {
167                         Return (ResourceTemplate() {
168                                 Memory32Fixed (ReadWrite, APU_UART1_BASE, 0x1000)
169                                 Memory32Fixed (ReadWrite, APU_DMAC1_BASE, 0x1000)
170                         })
171                 } Else {
172                         Return (Local0)
173                 }
174         }
176         Name (STAT, 0x0)
177         Method (_STA, 0x0, NotSerialized)
178         {
179                 Return (STAT)
180         }
182         AOAC_DEVICE(FCH_AOAC_DEV_UART1, 0)
185 Device (FUR2) {
186         Name (_HID, "AMDI0020")
187         Name (_UID, 0x2)
188         Method (_CRS, 0) {
189                 Local0 = ResourceTemplate() {
190                         Interrupt (
191                                 ResourceConsumer,
192                                 Edge,
193                                 ActiveHigh,
194                                 Exclusive, , , IRQR)
195                         { 0 }
196                         Memory32Fixed (ReadWrite, APU_UART2_BASE, 0x1000)
197                         Memory32Fixed (ReadWrite, APU_DMAC2_BASE, 0x1000)
198                 }
199                 CreateDWordField (Local0, IRQR._INT, IRQN)
200                 If (PICM) {
201                         IRQN = IUA2
202                 } Else {
203                         IRQN = PUA2
204                 }
205                 If (IRQN == 0x1f) {
206                         Return (ResourceTemplate() {
207                                 Memory32Fixed (ReadWrite, APU_UART2_BASE, 0x1000)
208                                 Memory32Fixed (ReadWrite, APU_DMAC2_BASE, 0x1000)
209                         })
210                 } Else {
211                         Return (Local0)
212                 }
213         }
215         Name (STAT, 0x0)
216         Method (_STA, 0x0, NotSerialized)
217         {
218                 Return (STAT)
219         }
221         AOAC_DEVICE(FCH_AOAC_DEV_UART2, 0)
224 Device (FUR3) {
225         Name (_HID, "AMDI0020")
226         Name (_UID, 0x3)
227         Method (_CRS, 0) {
228                 Local0 = ResourceTemplate() {
229                         Interrupt (
230                                 ResourceConsumer,
231                                 Edge,
232                                 ActiveHigh,
233                                 Exclusive, , , IRQR)
234                         { 0 }
235                         Memory32Fixed (ReadWrite, APU_UART3_BASE, 0x1000)
236                         Memory32Fixed (ReadWrite, APU_DMAC3_BASE, 0x1000)
237                 }
238                 CreateDWordField (Local0, IRQR._INT, IRQN)
239                 If (PICM) {
240                         IRQN = IUA3
241                 } Else {
242                         IRQN = PUA3
243                 }
244                 If (IRQN == 0x1f) {
245                         Return (ResourceTemplate() {
246                                 Memory32Fixed (ReadWrite, APU_UART3_BASE, 0x1000)
247                                 Memory32Fixed (ReadWrite, APU_DMAC3_BASE, 0x1000)
248                         })
249                 } Else {
250                         Return (Local0)
251                 }
252         }
254         Name (STAT, 0x0)
255         Method (_STA, 0x0, NotSerialized)
256         {
257                 Return (STAT)
258         }
260         AOAC_DEVICE(FCH_AOAC_DEV_UART3, 0)
263 #if CONFIG(PSP_LOAD_MP2_FW)
264 Device (I2C0) {
265         Name (_HID, "AMDI0011")
266         Name (_UID, 0x0)
267         Method (_CRS, 0) {
268                 Local0 = ResourceTemplate() {
269                         Interrupt (
270                                 ResourceConsumer,
271                                 Edge,
272                                 ActiveHigh,
273                                 Exclusive, , , IRQR)
274                         { 0 }
275                         Memory32Fixed (ReadWrite, APU_I2C0_BASE, 0x1000)
276                 }
277                 CreateDWordField (Local0, IRQR._INT, IRQN)
278                 If (PICM) {
279                         IRQN = II20
280                 } Else {
281                         IRQN = PI20
282                 }
283                 If (IRQN == 0x1f) {
284                         Return (ResourceTemplate() {
285                                 Memory32Fixed (ReadWrite, APU_I2C0_BASE, 0x1000)
286                         })
287                 } Else {
288                         Return (Local0)
289                 }
290         }
292         Name (STAT, 0x0)
293         Method (_STA, 0x0, NotSerialized)
294         {
295                 Return (STAT)
296         }
298         AOAC_DEVICE(5, 0)
301 Device (I2C1) {
302         Name (_HID, "AMDI0011")
303         Name (_UID, 0x1)
304         Method (_CRS, 0) {
305                 Local0 = ResourceTemplate() {
306                         Interrupt (
307                                 ResourceConsumer,
308                                 Edge,
309                                 ActiveHigh,
310                                 Exclusive, , , IRQR)
311                         { 0 }
312                         Memory32Fixed (ReadWrite, APU_I2C1_BASE, 0x1000)
313                 }
314                 CreateDWordField (Local0, IRQR._INT, IRQN)
315                 If (PICM) {
316                         IRQN = II21
317                 } Else {
318                         IRQN = PI21
319                 }
320                 If (IRQN == 0x1f) {
321                         Return (ResourceTemplate() {
322                                 Memory32Fixed (ReadWrite, APU_I2C1_BASE, 0x1000)
323                         })
324                 } Else {
325                         Return (Local0)
326                 }
327         }
329         Name (STAT, 0x0)
330         Method (_STA, 0x0, NotSerialized)
331         {
332                 Return (STAT)
333         }
335         AOAC_DEVICE(6, 0)
337 #endif /* CONFIG(PSP_LOAD_MP2_FW) */
339 Device (I2C2) {
340         Name (_HID, "AMDI0010")
341         Name (_UID, 0x2)
342         Method (_CRS, 0) {
343                 Local0 = ResourceTemplate() {
344                         Interrupt (
345                                 ResourceConsumer,
346                                 Edge,
347                                 ActiveHigh,
348                                 Exclusive, , , IRQR)
349                         { 0 }
350                         Memory32Fixed (ReadWrite, APU_I2C2_BASE, 0x1000)
351                 }
352                 CreateDWordField (Local0, IRQR._INT, IRQN)
353                 If (PICM) {
354                         IRQN = II22
355                 } Else {
356                         IRQN = PI22
357                 }
358                 If (IRQN == 0x1f) {
359                         Return (ResourceTemplate() {
360                                 Memory32Fixed (ReadWrite, APU_I2C2_BASE, 0x1000)
361                         })
362                 } Else {
363                         Return (Local0)
364                 }
365         }
367         Name (STAT, 0x0)
368         Method (_STA, 0x0, NotSerialized)
369         {
370                 Return (STAT)
371         }
373         AOAC_DEVICE(FCH_AOAC_DEV_I2C2, 0)
376 Device (I2C3)
378         Name (_HID, "AMDI0010")
379         Name (_UID, 0x3)
380         Method (_CRS, 0) {
381                 Local0 = ResourceTemplate() {
382                         Interrupt (
383                                 ResourceConsumer,
384                                 Edge,
385                                 ActiveHigh,
386                                 Exclusive, , , IRQR)
387                         { 0 }
388                         Memory32Fixed (ReadWrite, APU_I2C3_BASE, 0x1000)
389                 }
390                 CreateDWordField (Local0, IRQR._INT, IRQN)
391                 If (PICM) {
392                         IRQN = II23
393                 } Else {
394                         IRQN = PI23
395                 }
396                 If (IRQN == 0x1f) {
397                         Return (ResourceTemplate() {
398                                 Memory32Fixed (ReadWrite, APU_I2C3_BASE, 0x1000)
399                         })
400                 } Else {
401                         Return (Local0)
402                 }
403         }
405         Name (STAT, 0x0)
406         Method (_STA, 0x0, NotSerialized)
407         {
408                 Return (STAT)
409         }
411         AOAC_DEVICE(FCH_AOAC_DEV_I2C3, 0)
414 Device (MISC)
416         Name (_HID, "AMD0040")
417         Name (_UID, 0x3)
418         Name (_CRS, ResourceTemplate() {
419                 Memory32Fixed (ReadWrite, ACPIMMIO_MISC_BASE, 0x100)
420         })
421         Name (_DSD, Package ()
422         {
423                 ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
424                 Package ()
425                 {
426                         Package () { "is-rv", 1 },
427                 },
428         })
429         Method (_STA, 0x0, NotSerialized)
430         {
431                 Return (0x0b)
432         }