mb/google/brya/var/orisa: Update Type C DisplayPort HPD Configuration
[coreboot2.git] / src / soc / amd / phoenix / acpi / mmio.asl
blobb0253b5ec9588cc5717c1d4010ecd18db2e32ba9
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 /* TODO: Update for Phoenix */
5 #include <soc/amd/common/acpi/aoac.asl>
6 #include <soc/aoac_defs.h>
7 #include <soc/gpio.h>
8 #include <soc/iomap.h>
9 #include <amdblocks/acpimmio_map.h>
11 Device (AAHB)
13         Name (_HID, "AAHB0000")
14         Name (_UID, 0x0)
15         Name (_CRS, ResourceTemplate()
16         {
17                 Memory32Fixed (ReadWrite, ALINK_AHB_ADDRESS, 0x2000)
18         })
19         Method (_STA, 0x0, NotSerialized)
20         {
21                 Return (0x0b)
22         }
25 Device (GPIO)
27         Name (_HID, GPIO_DEVICE_NAME)
28         Name (_CID, GPIO_DEVICE_NAME)
29         Name (_UID, 0)
30         Name (_DDN, GPIO_DEVICE_DESC)
32         Method (_CRS, 0) {
33                 Local0 = ResourceTemplate() {
34                         Interrupt (
35                                 ResourceConsumer,
36                                 Level,
37                                 ActiveLow,
38                                 Shared, , , IRQR)
39                         { 0 }
40                         Memory32Fixed (ReadWrite, ACPIMMIO_GPIO0_BASE, 0x400)
41                 }
42                 CreateDWordField (Local0, IRQR._INT, IRQN)
43                 If (PICM) {
44                         IRQN = IGPI
45                 } Else {
46                         IRQN = PGPI
47                 }
48                 If (IRQN == 0x1f) {
49                         Return (ResourceTemplate() {
50                                 Memory32Fixed (ReadWrite, ACPIMMIO_GPIO0_BASE, 0x400)
51                         })
52                 } Else {
53                         Return (Local0)
54                 }
55         }
57         Method (_STA, 0x0, NotSerialized)
58         {
59                 Return (0x0F)
60         }
63 Device (FUR0)
65         Name (_HID, "AMDI0020")
66         Name (_UID, 0x0)
67         Method (_CRS, 0) {
68                 Local0 = ResourceTemplate() {
69                         Interrupt (
70                                 ResourceConsumer,
71                                 Edge,
72                                 ActiveHigh,
73                                 Exclusive, , , IRQR)
74                         { 0 }
75                         Memory32Fixed (ReadWrite, APU_UART0_BASE, 0x1000)
76                 }
77                 CreateDWordField (Local0, IRQR._INT, IRQN)
78                 If (PICM) {
79                         IRQN = IUA0
80                 } Else {
81                         IRQN = PUA0
82                 }
83                 If (IRQN == 0x1f) {
84                         Return (ResourceTemplate() {
85                                 Memory32Fixed (ReadWrite, APU_UART0_BASE, 0x1000)
86                         })
87                 } Else {
88                         Return (Local0)
89                 }
90         }
92         Name (STAT, 0x0)
93         Method (_STA, 0x0, NotSerialized)
94         {
95                 Return (STAT)
96         }
98         AOAC_DEVICE(FCH_AOAC_DEV_UART0, 0)
101 Device (FUR1) {
102         Name (_HID, "AMDI0020")
103         Name (_UID, 0x1)
104         Method (_CRS, 0) {
105                 Local0 = ResourceTemplate() {
106                         Interrupt (
107                                 ResourceConsumer,
108                                 Edge,
109                                 ActiveHigh,
110                                 Exclusive, , , IRQR)
111                         { 0 }
112                         Memory32Fixed (ReadWrite, APU_UART1_BASE, 0x1000)
113                 }
114                 CreateDWordField (Local0, IRQR._INT, IRQN)
115                 If (PICM) {
116                         IRQN = IUA1
117                 } Else {
118                         IRQN = PUA1
119                 }
120                 If (IRQN == 0x1f) {
121                         Return (ResourceTemplate() {
122                                 Memory32Fixed (ReadWrite, APU_UART1_BASE, 0x1000)
123                         })
124                 } Else {
125                         Return (Local0)
126                 }
127         }
129         Name (STAT, 0x0)
130         Method (_STA, 0x0, NotSerialized)
131         {
132                 Return (STAT)
133         }
135         AOAC_DEVICE(FCH_AOAC_DEV_UART1, 0)
138 Device (FUR2) {
139         Name (_HID, "AMDI0020")
140         Name (_UID, 0x2)
141         Method (_CRS, 0) {
142                 Local0 = ResourceTemplate() {
143                         Interrupt (
144                                 ResourceConsumer,
145                                 Edge,
146                                 ActiveHigh,
147                                 Exclusive, , , IRQR)
148                         { 0 }
149                         Memory32Fixed (ReadWrite, APU_UART2_BASE, 0x1000)
150                 }
151                 CreateDWordField (Local0, IRQR._INT, IRQN)
152                 If (PICM) {
153                         IRQN = IUA2
154                 } Else {
155                         IRQN = PUA2
156                 }
157                 If (IRQN == 0x1f) {
158                         Return (ResourceTemplate() {
159                                 Memory32Fixed (ReadWrite, APU_UART2_BASE, 0x1000)
160                         })
161                 } Else {
162                         Return (Local0)
163                 }
164         }
166         Name (STAT, 0x0)
167         Method (_STA, 0x0, NotSerialized)
168         {
169                 Return (STAT)
170         }
172         AOAC_DEVICE(FCH_AOAC_DEV_UART2, 0)
175 Device (FUR3) {
176         Name (_HID, "AMDI0020")
177         Name (_UID, 0x3)
178         Method (_CRS, 0) {
179                 Local0 = ResourceTemplate() {
180                         Interrupt (
181                                 ResourceConsumer,
182                                 Edge,
183                                 ActiveHigh,
184                                 Exclusive, , , IRQR)
185                         { 0 }
186                         Memory32Fixed (ReadWrite, APU_UART3_BASE, 0x1000)
187                 }
188                 CreateDWordField (Local0, IRQR._INT, IRQN)
189                 If (PICM) {
190                         IRQN = IUA3
191                 } Else {
192                         IRQN = PUA3
193                 }
194                 If (IRQN == 0x1f) {
195                         Return (ResourceTemplate() {
196                                 Memory32Fixed (ReadWrite, APU_UART3_BASE, 0x1000)
197                         })
198                 } Else {
199                         Return (Local0)
200                 }
201         }
203         Name (STAT, 0x0)
204         Method (_STA, 0x0, NotSerialized)
205         {
206                 Return (STAT)
207         }
209         AOAC_DEVICE(FCH_AOAC_DEV_UART3, 0)
212 Device (FUR4) {
213         Name (_HID, "AMDI0020")
214         Name (_UID, 0x4)
215         Method (_CRS, 0) {
216                 Local0 = ResourceTemplate() {
217                         Interrupt (
218                                 ResourceConsumer,
219                                 Edge,
220                                 ActiveHigh,
221                                 Exclusive, , , IRQR)
222                         { 0 }
223                         Memory32Fixed (ReadWrite, APU_UART4_BASE, 0x1000)
224                 }
225                 CreateDWordField (Local0, IRQR._INT, IRQN)
226                 If (PICM) {
227                         IRQN = IUA4
228                 } Else {
229                         IRQN = PUA4
230                 }
231                 If (IRQN == 0x1f) {
232                         Return (ResourceTemplate() {
233                                 Memory32Fixed (ReadWrite, APU_UART4_BASE, 0x1000)
234                         })
235                 } Else {
236                         Return (Local0)
237                 }
238         }
240         Name (STAT, 0x0)
241         Method (_STA, 0x0, NotSerialized)
242         {
243                 Return (STAT)
244         }
246         AOAC_DEVICE(FCH_AOAC_DEV_UART4, 0)
249 Device (I2C0) {
250         Name (_HID, "AMDI0010")
251         Name (_UID, 0x0)
252         Method (_CRS, 0) {
253                 Local0 = ResourceTemplate() {
254                         Interrupt (
255                                 ResourceConsumer,
256                                 Edge,
257                                 ActiveHigh,
258                                 Exclusive, , , IRQR)
259                         { 0 }
260                         Memory32Fixed (ReadWrite, APU_I2C0_BASE, 0x1000)
261                 }
262                 CreateDWordField (Local0, IRQR._INT, IRQN)
263                 If (PICM) {
264                         IRQN = II20
265                 } Else {
266                         IRQN = PI20
267                 }
268                 If (IRQN == 0x1f) {
269                         Return (ResourceTemplate() {
270                                 Memory32Fixed (ReadWrite, APU_I2C0_BASE, 0x1000)
271                         })
272                 } Else {
273                         Return (Local0)
274                 }
275         }
277         Name (STAT, 0x0)
278         Method (_STA, 0x0, NotSerialized)
279         {
280                 Return (STAT)
281         }
283         AOAC_DEVICE(FCH_AOAC_DEV_I2C0, 0)
286 Device (I2C1) {
287         Name (_HID, "AMDI0010")
288         Name (_UID, 0x1)
289         Method (_CRS, 0) {
290                 Local0 = ResourceTemplate() {
291                         Interrupt (
292                                 ResourceConsumer,
293                                 Edge,
294                                 ActiveHigh,
295                                 Exclusive, , , IRQR)
296                         { 0 }
297                         Memory32Fixed (ReadWrite, APU_I2C1_BASE, 0x1000)
298                 }
299                 CreateDWordField (Local0, IRQR._INT, IRQN)
300                 If (PICM) {
301                         IRQN = II21
302                 } Else {
303                         IRQN = PI21
304                 }
305                 If (IRQN == 0x1f) {
306                         Return (ResourceTemplate() {
307                                 Memory32Fixed (ReadWrite, APU_I2C1_BASE, 0x1000)
308                         })
309                 } Else {
310                         Return (Local0)
311                 }
312         }
314         Name (STAT, 0x0)
315         Method (_STA, 0x0, NotSerialized)
316         {
317                 Return (STAT)
318         }
320         AOAC_DEVICE(FCH_AOAC_DEV_I2C1, 0)
323 Device (I2C2) {
324         Name (_HID, "AMDI0010")
325         Name (_UID, 0x2)
326         Method (_CRS, 0) {
327                 Local0 = ResourceTemplate() {
328                         Interrupt (
329                                 ResourceConsumer,
330                                 Edge,
331                                 ActiveHigh,
332                                 Exclusive, , , IRQR)
333                         { 0 }
334                         Memory32Fixed (ReadWrite, APU_I2C2_BASE, 0x1000)
335                 }
336                 CreateDWordField (Local0, IRQR._INT, IRQN)
337                 If (PICM) {
338                         IRQN = II22
339                 } Else {
340                         IRQN = PI22
341                 }
342                 If (IRQN == 0x1f) {
343                         Return (ResourceTemplate() {
344                                 Memory32Fixed (ReadWrite, APU_I2C2_BASE, 0x1000)
345                         })
346                 } Else {
347                         Return (Local0)
348                 }
349         }
351         Name (STAT, 0x0)
352         Method (_STA, 0x0, NotSerialized)
353         {
354                 Return (STAT)
355         }
357         AOAC_DEVICE(FCH_AOAC_DEV_I2C2, 0)
360 Device (I2C3)
362 #if CONFIG(SOC_AMD_COMMON_BLOCK_I2C3_TPM_SHARED_WITH_PSP)
363         Name (_HID, "AMDI0019")
364 #else
365         Name (_HID, "AMDI0010")
366 #endif
367         Name (_UID, 0x3)
368         Method (_CRS, 0) {
369                 Local0 = ResourceTemplate() {
370                         Interrupt (
371                                 ResourceConsumer,
372                                 Edge,
373                                 ActiveHigh,
374                                 Exclusive, , , IRQR)
375                         { 0 }
376                         Memory32Fixed (ReadWrite, APU_I2C3_BASE, 0x1000)
377                 }
378                 CreateDWordField (Local0, IRQR._INT, IRQN)
379                 If (PICM) {
380                         IRQN = II23
381                 } Else {
382                         IRQN = PI23
383                 }
384                 If (IRQN == 0x1f) {
385                         Return (ResourceTemplate() {
386                                 Memory32Fixed (ReadWrite, APU_I2C3_BASE, 0x1000)
387                         })
388                 } Else {
389                         Return (Local0)
390                 }
391         }
393         Name (STAT, 0x0)
394         Method (_STA, 0x0, NotSerialized)
395         {
396                 Return (STAT)
397         }
399 /* If this device is shared with PSP, then PSP takes care of power management */
400 #if !CONFIG(SOC_AMD_COMMON_BLOCK_I2C3_TPM_SHARED_WITH_PSP)
401         AOAC_DEVICE(FCH_AOAC_DEV_I2C3, 0)
402 #endif
405 Device (MISC)
407         Name (_HID, "AMD0040")
408         Name (_UID, 0x3)
409         Name (_CRS, ResourceTemplate() {
410                 Memory32Fixed (ReadWrite, ACPIMMIO_MISC_BASE, 0x100)
411         })
412         Name (_DSD, Package ()
413         {
414                 ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
415                 Package ()
416                 {
417                         Package () { "is-rv", 1 },
418                 },
419         })
420         Method (_STA, 0x0, NotSerialized)
421         {
422                 Return (0x0b)
423         }