x86: tangier: Use spaces over TABs in ASL code
[oweals/u-boot.git] / arch / x86 / include / asm / arch-tangier / acpi / southcluster.asl
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (c) 2017 Intel Corporation
4  *
5  * Partially based on southcluster.asl for other x86 platforms
6  */
7
8 Device (PCI0)
9 {
10     Name (_HID, EISAID("PNP0A08"))    /* PCIe */
11     Name (_CID, EISAID("PNP0A03"))    /* PCI */
12
13     Name (_ADR, Zero)
14     Name (_BBN, Zero)
15
16     Name (MCRS, ResourceTemplate()
17     {
18         /* Bus Numbers */
19         WordBusNumber(ResourceProducer, MinFixed, MaxFixed, PosDecode,
20                 0x0000, 0x0000, 0x00ff, 0x0000, 0x0100, , , PB00)
21
22         /* IO Region 0 */
23         WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
24                 0x0000, 0x0000, 0x0cf7, 0x0000, 0x0cf8, , , PI00)
25
26         /* PCI Config Space */
27         IO(Decode16, 0x0cf8, 0x0cf8, 0x0001, 0x0008)
28
29         /* IO Region 1 */
30         WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
31                 0x0000, 0x0d00, 0xffff, 0x0000, 0xf300, , , PI01)
32
33         /* GPIO Low Memory Region */
34         DWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed,
35                 Cacheable, ReadWrite,
36                 0x00000000, 0x000ddcc0, 0x000ddccf, 0x00000000,
37                 0x00000010, , , GP00)
38
39         /* PSH Memory Region 0 */
40         DWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed,
41                 Cacheable, ReadWrite,
42                 0x00000000, 0x04819000, 0x04898fff, 0x00000000,
43                 0x00080000, , , PSH0)
44
45         /* PSH Memory Region 1 */
46         DWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed,
47                 Cacheable, ReadWrite,
48                 0x00000000, 0x04919000, 0x04920fff, 0x00000000,
49                 0x00008000, , , PSH1)
50
51         /* SST Memory Region */
52         DWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed,
53                 Cacheable, ReadWrite,
54                 0x00000000, 0x05e00000, 0x05ffffff, 0x00000000,
55                 0x00200000, , , SST0)
56
57         /* PCI Memory Region */
58         DWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed,
59                 Cacheable, ReadWrite,
60                 0x00000000, 0x80000000, 0xffffffff, 0x00000000,
61                 0x80000000, , , PMEM)
62     })
63
64     Method (_CRS, 0, Serialized)
65     {
66         Return (MCRS)
67     }
68
69     /* Device Resource Consumption */
70     Device (PDRC)
71     {
72         Name (_HID, EISAID("PNP0C02"))
73         Name (_UID, One)
74
75         Name (PDRS, ResourceTemplate()
76         {
77             Memory32Fixed(ReadWrite, MCFG_BASE_ADDRESS, MCFG_BASE_SIZE)
78         })
79
80         Method (_CRS, 0, Serialized)
81         {
82             Return (PDRS)
83         }
84     }
85
86     Method (_OSC, 4)
87     {
88         /* Check for proper GUID */
89         If (LEqual(Arg0, ToUUID("33db4d5b-1ff7-401c-9657-7441c03dd766"))) {
90             /* Let OS control everything */
91             Return (Arg3)
92         } Else {
93             /* Unrecognized UUID */
94             CreateDWordField(Arg3, 0, CDW1)
95             Or(CDW1, 4, CDW1)
96             Return (Arg3)
97         }
98     }
99
100     Device (SDHC)
101     {
102         Name (_ADR, 0x00010003)
103         Name (_DEP, Package (0x01)
104         {
105             GPIO
106         })
107         Name (PSTS, Zero)
108
109         Method (_STA)
110         {
111             Return (STA_VISIBLE)
112         }
113
114         Method (_PS3, 0, NotSerialized)
115         {
116         }
117
118         Method (_PS0, 0, NotSerialized)
119         {
120             If (PSTS == Zero)
121             {
122                 If (^^GPIO.AVBL == One)
123                 {
124                     ^^GPIO.WFD3 = One
125                     PSTS = One
126                 }
127             }
128         }
129
130         /* BCM43340 */
131         Device (BRC1)
132         {
133             Name (_ADR, 0x01)
134             Name (_DEP, Package (0x01)
135             {
136                 GPIO
137             })
138
139             Method (_STA)
140             {
141                 Return (STA_VISIBLE)
142             }
143
144             Method (_RMV, 0, NotSerialized)
145             {
146                 Return (Zero)
147             }
148
149             Method (_PS3, 0, NotSerialized)
150             {
151                 If (^^^GPIO.AVBL == One)
152                 {
153                     ^^^GPIO.WFD3 = Zero
154                     PSTS = Zero
155                 }
156             }
157
158             Method (_PS0, 0, NotSerialized)
159             {
160                 If (PSTS == Zero)
161                 {
162                     If (^^^GPIO.AVBL == One)
163                     {
164                         ^^^GPIO.WFD3 = One
165                         PSTS = One
166                     }
167                 }
168             }
169         }
170
171         Device (BRC2)
172         {
173             Name (_ADR, 0x02)
174             Method (_STA, 0, NotSerialized)
175             {
176                 Return (STA_VISIBLE)
177             }
178
179             Method (_RMV, 0, NotSerialized)
180             {
181                 Return (Zero)
182             }
183         }
184     }
185
186     Device (SPI5)
187     {
188         Name (_ADR, 0x00070001)
189         Name (RBUF, ResourceTemplate()
190         {
191             GpioIo(Exclusive, PullUp, 0, 0, IoRestrictionOutputOnly,
192                 "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 110 }
193             GpioIo(Exclusive, PullUp, 0, 0, IoRestrictionOutputOnly,
194                 "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 111 }
195             GpioIo(Exclusive, PullUp, 0, 0, IoRestrictionOutputOnly,
196                 "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 112 }
197             GpioIo(Exclusive, PullUp, 0, 0, IoRestrictionOutputOnly,
198                 "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 113 }
199
200             FixedDMA(0x000d, 0x0002, Width32bit, )
201             FixedDMA(0x000c, 0x0003, Width32bit, )
202         })
203
204         Method (_CRS, 0, NotSerialized)
205         {
206             Return (RBUF)
207         }
208
209         /*
210          * See
211          * http://www.kernel.org/doc/Documentation/acpi/gpio-properties.txt
212          * for more information about GPIO bindings.
213          */
214         Name (_DSD, Package () {
215             ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
216             Package () {
217                 Package () {
218                     "cs-gpios", Package () {
219                         ^SPI5, 0, 0, 0,
220                         ^SPI5, 1, 0, 0,
221                         ^SPI5, 2, 0, 0,
222                         ^SPI5, 3, 0, 0,
223                     },
224                 },
225             }
226         })
227
228         Method (_STA, 0, NotSerialized)
229         {
230             Return (STA_VISIBLE)
231         }
232     }
233
234     Device (I2C1)
235     {
236         Name (_ADR, 0x00080000)
237
238         Method (_STA, 0, NotSerialized)
239         {
240             Return (STA_VISIBLE)
241         }
242
243         Name (RBUF, ResourceTemplate()
244         {
245             FixedDMA(0x0009, 0x0000, Width32bit, )
246             FixedDMA(0x0008, 0x0001, Width32bit, )
247         })
248
249         Method (_CRS, 0, NotSerialized)
250         {
251             Return (RBUF)
252         }
253     }
254
255     Device (I2C6)
256     {
257         Name (_ADR, 0x00090001)
258
259         Method (_STA, 0, NotSerialized)
260         {
261             Return (STA_VISIBLE)
262         }
263     }
264
265     Device (GPIO)
266     {
267         Name (_ADR, 0x000c0000)
268
269         Method (_STA)
270         {
271             Return (STA_VISIBLE)
272         }
273
274         Name (AVBL, Zero)
275         Method (_REG, 2, NotSerialized)
276         {
277             If (Arg0 == 0x08)
278             {
279                 AVBL = Arg1
280             }
281         }
282
283         OperationRegion (GPOP, GeneralPurposeIo, 0, 1)
284         Field (GPOP, ByteAcc, NoLock, Preserve)
285         {
286             Connection (
287                 GpioIo(Exclusive, PullDefault, 0, 0, IoRestrictionOutputOnly,
288                     "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 96 }
289             ),
290             WFD3, 1,
291         }
292     }
293
294     Device (PWM0)
295     {
296         Name (_ADR, 0x00170000)
297
298         Method (_STA, 0, NotSerialized)
299         {
300             Return (STA_VISIBLE)
301         }
302     }
303
304     Device (HSU0)
305     {
306         Name (_ADR, 0x00040001)
307
308         Method (_STA, 0, NotSerialized)
309         {
310             Return (STA_VISIBLE)
311         }
312
313         Device (BTH0)
314         {
315             Name (_HID, "BCM2E95")
316             Name (_DEP, Package ()
317             {
318                 GPIO,
319                 HSU0
320             })
321
322             Method (_STA, 0, NotSerialized)
323             {
324                 Return (STA_VISIBLE)
325             }
326
327             Method (_CRS, 0, Serialized)
328             {
329                 Name (RBUF, ResourceTemplate()
330                 {
331                     UartSerialBus(0x0001C200, DataBitsEight, StopBitsOne,
332                         0xFC, LittleEndian, ParityTypeNone, FlowControlHardware,
333                         0x20, 0x20, "\\_SB.PCI0.HSU0", 0, ResourceConsumer, , )
334                     GpioInt(Level, ActiveHigh, Exclusive, PullNone, 0,
335                         "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 185 }
336                     GpioIo(Exclusive, PullDefault, 0, 0, IoRestrictionOutputOnly,
337                         "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 184 }
338                     GpioIo(Exclusive, PullDefault, 0, 0, IoRestrictionOutputOnly,
339                         "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 71 }
340                 })
341                 Return (RBUF)
342             }
343
344             Name (_DSD, Package () {
345                 ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
346                 Package () {
347                     Package () { "host-wakeup-gpios", Package () { ^BTH0, 0, 0, 0 } },
348                     Package () { "device-wakeup-gpios", Package () { ^BTH0, 1, 0, 0 } },
349                     Package () { "shutdown-gpios", Package () { ^BTH0, 2, 0, 0 } },
350                 }
351             })
352         }
353     }
354
355     Device (IPC1)
356     {
357         Name (_ADR, 0x00130000)
358
359         Method (_STA, 0, NotSerialized)
360         {
361             Return (STA_VISIBLE)
362         }
363
364         Device (PMIC)
365         {
366             Name (_ADR, Zero)
367             Name (_HID, "INTC100E")
368             Name (_CID, "INTC100E")
369             Name (_DDN, "Basin Cove PMIC")
370             Name (_DEP, Package ()
371             {
372                 IPC1
373             })
374
375             Method (_STA, 0, NotSerialized)
376             {
377                 Return (STA_VISIBLE)
378             }
379
380             Method (_CRS, 0, Serialized)
381             {
382                 Name (RBUF, ResourceTemplate()
383                 {
384                     /*
385                      * Shadow registers in SRAM for PMIC:
386                      *   SRAM    PMIC register
387                      *   --------------------
388                      *   0x00-    Unknown
389                      *   0x03    THRMIRQ (0x04)
390                      *   0x04    BCUIRQ (0x05)
391                      *   0x05    ADCIRQ (0x06)
392                      *   0x06    CHGRIRQ0 (0x07)
393                      *   0x07    CHGRIRQ1 (0x08)
394                      *   0x08-    Unknown
395                      *   0x0a    PBSTATUS (0x27)
396                      *   0x0b-    Unknown
397                      */
398                     Memory32Fixed(ReadWrite, 0xFFFFF610, 0x00000010)
399                     Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 30 }
400                     Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 23 }
401                     Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 52 }
402                     Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 51 }
403                     Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 50 }
404                     Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 27 }
405                     Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 49 }
406                 })
407                 Return (RBUF)
408             }
409
410             OperationRegion (PMOP, 0x8D, Zero, 0x0100)
411             Field (PMOP, DWordAcc, NoLock, Preserve)
412             {
413                 SEL1,   32,
414                 SEL2,   32,
415                 VCCL,   32,
416                 VNNL,   32,
417                 AONL,   32,
418                 CNTC,   32,
419                 CNTN,   32,
420                 AONN,   32,
421                 CNT1,   32,
422                 CNT2,   32,
423                 CNT3,   32,
424                 FLEX,   32,
425                 PRG1,   32,
426                 PRG2,   32,
427                 PRG3,   32,
428                 VLDO,   32,
429             }
430
431             Name (AVBL, Zero)
432             Method (_REG, 2, NotSerialized)
433             {
434                 If ((Arg0 == 0x8D))
435                 {
436                     AVBL = Arg1
437                 }
438             }
439         }
440     }
441
442     Device (GDMA)
443     {
444         Name (_ADR, 0x00150000)
445         Name (_HID, "808611A2")
446         Name (_UID, Zero)
447
448         Method (_STA, 0, NotSerialized)
449         {
450             Return (STA_VISIBLE)
451         }
452
453         Method (_CRS, 0, Serialized)
454         {
455             Name (RBUF, ResourceTemplate ()
456             {
457                     Memory32Fixed(ReadWrite, 0xFF192000, 0x00001000)
458                     Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 32 }
459             })
460             Return (RBUF)
461         }
462     }
463 }
464
465 Device (FLIS)
466 {
467     Name (_HID, "INTC1002")
468     Name (_DDN, "Intel Merrifield Family-Level Interface Shim")
469     Name (RBUF, ResourceTemplate()
470     {
471         Memory32Fixed(ReadWrite, 0xFF0C0000, 0x00008000)
472         PinGroup("spi5", ResourceProducer, ) { 90, 91, 92, 93, 94, 95, 96 }
473         PinGroup("uart0", ResourceProducer, ) { 115, 116, 117, 118 }
474         PinGroup("uart1", ResourceProducer, ) { 119, 120, 121, 122 }
475         PinGroup("uart2", ResourceProducer, ) { 123, 124, 125, 126 }
476         PinGroup("pwm0", ResourceProducer, ) { 144 }
477         PinGroup("pwm1", ResourceProducer, ) { 145 }
478         PinGroup("pwm2", ResourceProducer, ) { 132 }
479         PinGroup("pwm3", ResourceProducer, ) { 133 }
480     })
481
482     Method (_CRS, 0, NotSerialized)
483     {
484         Return (RBUF)
485     }
486
487     Method (_STA, 0, NotSerialized)
488     {
489         Return (STA_VISIBLE)
490     }
491 }