x86: acpi: Add I²C timings to Intel Merrifield platform
[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 (SSCN, Package ()
244         {
245             0x02F8, 0x037B, Zero,
246         })
247
248         Name (FMCN, Package ()
249         {
250             0x0087, 0x010A, Zero,
251         })
252
253         Name (HSCN, Package ()
254         {
255             0x0008, 0x0020, Zero,
256         })
257
258         Name (RBUF, ResourceTemplate()
259         {
260             FixedDMA(0x0009, 0x0000, Width32bit, )
261             FixedDMA(0x0008, 0x0001, Width32bit, )
262         })
263
264         Method (_CRS, 0, NotSerialized)
265         {
266             Return (RBUF)
267         }
268     }
269
270     Device (I2C6)
271     {
272         Name (_ADR, 0x00090001)
273
274         Method (_STA, 0, NotSerialized)
275         {
276             Return (STA_VISIBLE)
277         }
278
279         Name (SSCN, Package ()
280         {
281             0x02F8, 0x037B, Zero,
282         })
283
284         Name (FMCN, Package ()
285         {
286             0x0087, 0x010A, Zero,
287         })
288
289         Name (HSCN, Package ()
290         {
291             0x0008, 0x0020, Zero,
292         })
293     }
294
295     Device (GPIO)
296     {
297         Name (_ADR, 0x000c0000)
298
299         Method (_STA)
300         {
301             Return (STA_VISIBLE)
302         }
303
304         Name (AVBL, Zero)
305         Method (_REG, 2, NotSerialized)
306         {
307             If (Arg0 == 0x08)
308             {
309                 AVBL = Arg1
310             }
311         }
312
313         OperationRegion (GPOP, GeneralPurposeIo, 0, 1)
314         Field (GPOP, ByteAcc, NoLock, Preserve)
315         {
316             Connection (
317                 GpioIo(Exclusive, PullDefault, 0, 0, IoRestrictionOutputOnly,
318                     "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 96 }
319             ),
320             WFD3, 1,
321         }
322     }
323
324     Device (PWM0)
325     {
326         Name (_ADR, 0x00170000)
327
328         Method (_STA, 0, NotSerialized)
329         {
330             Return (STA_VISIBLE)
331         }
332     }
333
334     Device (HSU0)
335     {
336         Name (_ADR, 0x00040001)
337
338         Method (_STA, 0, NotSerialized)
339         {
340             Return (STA_VISIBLE)
341         }
342
343         Device (BTH0)
344         {
345             Name (_HID, "BCM2E95")
346             Name (_DEP, Package ()
347             {
348                 GPIO,
349                 HSU0
350             })
351
352             Method (_STA, 0, NotSerialized)
353             {
354                 Return (STA_VISIBLE)
355             }
356
357             Method (_CRS, 0, Serialized)
358             {
359                 Name (RBUF, ResourceTemplate()
360                 {
361                     UartSerialBus(0x0001C200, DataBitsEight, StopBitsOne,
362                         0xFC, LittleEndian, ParityTypeNone, FlowControlHardware,
363                         0x20, 0x20, "\\_SB.PCI0.HSU0", 0, ResourceConsumer, , )
364                     GpioInt(Level, ActiveHigh, Exclusive, PullNone, 0,
365                         "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 185 }
366                     GpioIo(Exclusive, PullDefault, 0, 0, IoRestrictionOutputOnly,
367                         "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 184 }
368                     GpioIo(Exclusive, PullDefault, 0, 0, IoRestrictionOutputOnly,
369                         "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 71 }
370                 })
371                 Return (RBUF)
372             }
373
374             Name (_DSD, Package () {
375                 ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
376                 Package () {
377                     Package () { "host-wakeup-gpios", Package () { ^BTH0, 0, 0, 0 } },
378                     Package () { "device-wakeup-gpios", Package () { ^BTH0, 1, 0, 0 } },
379                     Package () { "shutdown-gpios", Package () { ^BTH0, 2, 0, 0 } },
380                 }
381             })
382         }
383     }
384
385     Device (IPC1)
386     {
387         Name (_ADR, 0x00130000)
388
389         Method (_STA, 0, NotSerialized)
390         {
391             Return (STA_VISIBLE)
392         }
393
394         Device (PMIC)
395         {
396             Name (_ADR, Zero)
397             Name (_HID, "INTC100E")
398             Name (_CID, "INTC100E")
399             Name (_DDN, "Basin Cove PMIC")
400             Name (_DEP, Package ()
401             {
402                 IPC1
403             })
404
405             Method (_STA, 0, NotSerialized)
406             {
407                 Return (STA_VISIBLE)
408             }
409
410             Method (_CRS, 0, Serialized)
411             {
412                 Name (RBUF, ResourceTemplate()
413                 {
414                     /*
415                      * Shadow registers in SRAM for PMIC:
416                      *   SRAM    PMIC register
417                      *   --------------------
418                      *   0x00-    Unknown
419                      *   0x03    THRMIRQ (0x04)
420                      *   0x04    BCUIRQ (0x05)
421                      *   0x05    ADCIRQ (0x06)
422                      *   0x06    CHGRIRQ0 (0x07)
423                      *   0x07    CHGRIRQ1 (0x08)
424                      *   0x08-    Unknown
425                      *   0x0a    PBSTATUS (0x27)
426                      *   0x0b-    Unknown
427                      */
428                     Memory32Fixed(ReadWrite, 0xFFFFF610, 0x00000010)
429                     Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 30 }
430                     Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 23 }
431                     Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 52 }
432                     Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 51 }
433                     Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 50 }
434                     Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 27 }
435                     Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 49 }
436                 })
437                 Return (RBUF)
438             }
439
440             OperationRegion (PMOP, 0x8D, Zero, 0x0100)
441             Field (PMOP, DWordAcc, NoLock, Preserve)
442             {
443                 SEL1,   32,
444                 SEL2,   32,
445                 VCCL,   32,
446                 VNNL,   32,
447                 AONL,   32,
448                 CNTC,   32,
449                 CNTN,   32,
450                 AONN,   32,
451                 CNT1,   32,
452                 CNT2,   32,
453                 CNT3,   32,
454                 FLEX,   32,
455                 PRG1,   32,
456                 PRG2,   32,
457                 PRG3,   32,
458                 VLDO,   32,
459             }
460
461             Name (AVBL, Zero)
462             Method (_REG, 2, NotSerialized)
463             {
464                 If ((Arg0 == 0x8D))
465                 {
466                     AVBL = Arg1
467                 }
468             }
469         }
470     }
471
472     Device (GDMA)
473     {
474         Name (_ADR, 0x00150000)
475         Name (_HID, "808611A2")
476         Name (_UID, Zero)
477
478         Method (_STA, 0, NotSerialized)
479         {
480             Return (STA_VISIBLE)
481         }
482
483         Method (_CRS, 0, Serialized)
484         {
485             Name (RBUF, ResourceTemplate ()
486             {
487                     Memory32Fixed(ReadWrite, 0xFF192000, 0x00001000)
488                     Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 32 }
489             })
490             Return (RBUF)
491         }
492     }
493 }
494
495 Device (FLIS)
496 {
497     Name (_HID, "INTC1002")
498     Name (_DDN, "Intel Merrifield Family-Level Interface Shim")
499     Name (RBUF, ResourceTemplate()
500     {
501         Memory32Fixed(ReadWrite, 0xFF0C0000, 0x00008000)
502         PinGroup("spi5", ResourceProducer, ) { 90, 91, 92, 93, 94, 95, 96 }
503         PinGroup("uart0", ResourceProducer, ) { 115, 116, 117, 118 }
504         PinGroup("uart1", ResourceProducer, ) { 119, 120, 121, 122 }
505         PinGroup("uart2", ResourceProducer, ) { 123, 124, 125, 126 }
506         PinGroup("pwm0", ResourceProducer, ) { 144 }
507         PinGroup("pwm1", ResourceProducer, ) { 145 }
508         PinGroup("pwm2", ResourceProducer, ) { 132 }
509         PinGroup("pwm3", ResourceProducer, ) { 133 }
510     })
511
512     Method (_CRS, 0, NotSerialized)
513     {
514         Return (RBUF)
515     }
516
517     Method (_STA, 0, NotSerialized)
518     {
519         Return (STA_VISIBLE)
520     }
521 }