1/*
2 * Copyright (c) 2017 Intel Corporation
3 *
4 * Partially based on southcluster.asl for other x86 platforms
5 *
6 * SPDX-License-Identifier:	GPL-2.0+
7 */
8
9Device (PCI0)
10{
11    Name (_HID, EISAID("PNP0A08"))    /* PCIe */
12    Name (_CID, EISAID("PNP0A03"))    /* PCI */
13
14    Name (_ADR, 0)
15    Name (_BBN, 0)
16
17    Name (MCRS, ResourceTemplate()
18    {
19        /* Bus Numbers */
20        WordBusNumber(ResourceProducer, MinFixed, MaxFixed, PosDecode,
21                0x0000, 0x0000, 0x00ff, 0x0000, 0x0100, , , PB00)
22
23        /* IO Region 0 */
24        WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
25                0x0000, 0x0000, 0x0cf7, 0x0000, 0x0cf8, , , PI00)
26
27        /* PCI Config Space */
28        IO(Decode16, 0x0cf8, 0x0cf8, 0x0001, 0x0008)
29
30        /* IO Region 1 */
31        WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
32                0x0000, 0x0d00, 0xffff, 0x0000, 0xf300, , , PI01)
33
34        /* GPIO Low Memory Region */
35        DWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed,
36                Cacheable, ReadWrite,
37                0x00000000, 0x000ddcc0, 0x000ddccf, 0x00000000,
38                0x00000010, , , GP00)
39
40        /* PSH Memory Region 0 */
41        DWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed,
42                Cacheable, ReadWrite,
43                0x00000000, 0x04819000, 0x04898fff, 0x00000000,
44                0x00080000, , , PSH0)
45
46        /* PSH Memory Region 1 */
47        DWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed,
48                Cacheable, ReadWrite,
49                0x00000000, 0x04919000, 0x04920fff, 0x00000000,
50                0x00008000, , , PSH1)
51
52        /* SST Memory Region */
53        DWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed,
54                Cacheable, ReadWrite,
55                0x00000000, 0x05e00000, 0x05ffffff, 0x00000000,
56                0x00200000, , , SST0)
57
58        /* PCI Memory Region */
59        DWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed,
60                Cacheable, ReadWrite,
61                0x00000000, 0x80000000, 0xffffffff, 0x00000000,
62                0x80000000, , , PMEM)
63    })
64
65    Method (_CRS, 0, Serialized)
66    {
67        Return (MCRS)
68    }
69
70    Method (_OSC, 4)
71    {
72        /* Check for proper GUID */
73        If (LEqual(Arg0, ToUUID("33db4d5b-1ff7-401c-9657-7441c03dd766"))) {
74            /* Let OS control everything */
75            Return (Arg3)
76        } Else {
77            /* Unrecognized UUID */
78            CreateDWordField(Arg3, 0, CDW1)
79            Or(CDW1, 4, CDW1)
80            Return (Arg3)
81        }
82    }
83
84    Device (SDHC)
85    {
86        Name (_ADR, 0x00010003)
87        Name (_DEP, Package (0x01)
88        {
89            GPIO
90        })
91        Name (PSTS, Zero)
92
93        Method (_STA)
94        {
95            Return (STA_VISIBLE)
96        }
97
98        Method (_PS3, 0, NotSerialized)
99        {
100        }
101
102        Method (_PS0, 0, NotSerialized)
103        {
104            If (PSTS == Zero)
105            {
106                If (^^GPIO.AVBL == One)
107                {
108                    ^^GPIO.WFD3 = One
109                    PSTS = One
110                }
111            }
112        }
113
114        /* BCM43340 */
115        Device (BRC1)
116        {
117            Name (_ADR, 0x01)
118            Name (_DEP, Package (0x01)
119            {
120                GPIO
121            })
122
123            Method (_STA)
124            {
125                Return (STA_VISIBLE)
126            }
127
128            Method (_RMV, 0, NotSerialized)
129            {
130                Return (Zero)
131            }
132
133            Method (_PS3, 0, NotSerialized)
134            {
135                If (^^^GPIO.AVBL == One)
136                {
137                    ^^^GPIO.WFD3 = Zero
138                    PSTS = Zero
139                }
140            }
141
142            Method (_PS0, 0, NotSerialized)
143            {
144                If (PSTS == Zero)
145                {
146                    If (^^^GPIO.AVBL == One)
147                    {
148                        ^^^GPIO.WFD3 = One
149                        PSTS = One
150                    }
151                }
152            }
153        }
154
155        Device (BRC2)
156        {
157            Name (_ADR, 0x02)
158            Method (_STA, 0, NotSerialized)
159            {
160                Return (STA_VISIBLE)
161            }
162
163            Method (_RMV, 0, NotSerialized)
164            {
165                Return (Zero)
166            }
167        }
168    }
169
170    Device (SPI5)
171    {
172        Name (_ADR, 0x00070001)
173        Name (RBUF, ResourceTemplate()
174        {
175            GpioIo(Exclusive, PullUp, 0, 0, IoRestrictionOutputOnly,
176                "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 110 }
177            GpioIo(Exclusive, PullUp, 0, 0, IoRestrictionOutputOnly,
178                "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 111 }
179            GpioIo(Exclusive, PullUp, 0, 0, IoRestrictionOutputOnly,
180                "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 112 }
181            GpioIo(Exclusive, PullUp, 0, 0, IoRestrictionOutputOnly,
182                "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 113 }
183        })
184
185        Method (_CRS, 0, NotSerialized)
186        {
187            Return (RBUF)
188        }
189
190        /*
191         * See
192         * http://www.kernel.org/doc/Documentation/acpi/gpio-properties.txt
193         * for more information about GPIO bindings.
194         */
195        Name (_DSD, Package () {
196            ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
197            Package () {
198                Package () {
199                    "cs-gpios", Package () {
200                        ^SPI5, 0, 0, 0,
201                        ^SPI5, 1, 0, 0,
202                        ^SPI5, 2, 0, 0,
203                        ^SPI5, 3, 0, 0,
204                    },
205                },
206            }
207        })
208
209        Method (_STA, 0, NotSerialized)
210        {
211            Return (STA_VISIBLE)
212        }
213    }
214
215    Device (I2C1)
216    {
217        Name (_ADR, 0x00080000)
218
219        Method (_STA, 0, NotSerialized)
220        {
221            Return (STA_VISIBLE)
222        }
223    }
224
225    Device (GPIO)
226    {
227        Name (_ADR, 0x000c0000)
228
229        Method (_STA)
230        {
231            Return (STA_VISIBLE)
232        }
233
234        Name (AVBL, Zero)
235        Method (_REG, 2, NotSerialized)
236        {
237            If (Arg0 == 0x08)
238            {
239                AVBL = Arg1
240            }
241        }
242
243        OperationRegion (GPOP, GeneralPurposeIo, 0, 1)
244        Field (GPOP, ByteAcc, NoLock, Preserve)
245        {
246            Connection (
247                GpioIo(Exclusive, PullDefault, 0, 0, IoRestrictionOutputOnly,
248                    "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 96 }
249            ),
250            WFD3, 1,
251        }
252    }
253
254    Device (PWM0)
255    {
256        Name (_ADR, 0x00170000)
257
258        Method (_STA, 0, NotSerialized)
259        {
260            Return (STA_VISIBLE)
261        }
262    }
263
264    Device (HSU0)
265    {
266        Name (_ADR, 0x00040001)
267
268        Method (_STA, 0, NotSerialized)
269        {
270            Return (STA_VISIBLE)
271        }
272
273        Device (BTH0)
274        {
275            Name (_HID, "BCM2E95")
276            Name (_DEP, Package ()
277            {
278                GPIO,
279                HSU0
280            })
281
282            Method (_STA, 0, NotSerialized)
283            {
284                Return (STA_VISIBLE)
285            }
286
287            Method (_CRS, 0, NotSerialized)
288            {
289                Name (RBUF, ResourceTemplate ()
290                {
291                    UartSerialBus (0x0001C200, DataBitsEight, StopBitsOne,
292                        0xFC, LittleEndian, ParityTypeNone, FlowControlHardware,
293                        0x20, 0x20, "\\_SB.PCI0.HSU0", 0, ResourceConsumer, , )
294                    GpioInt (Level, ActiveHigh, Exclusive, PullNone, 0,
295                        "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 185 }
296                    GpioIo (Exclusive, PullDefault, 0, 0, IoRestrictionOutputOnly,
297                        "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 184 }
298                    GpioIo (Exclusive, PullDefault, 0, 0, IoRestrictionOutputOnly,
299                        "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 71 }
300                })
301                Return (RBUF)
302            }
303
304            Name (_DSD, Package () {
305                ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
306                Package () {
307                    Package () { "host-wakeup-gpios", Package () { ^BTH0, 0, 0, 0 } },
308                    Package () { "device-wakeup-gpios", Package () { ^BTH0, 1, 0, 0 } },
309                    Package () { "shutdown-gpios", Package () { ^BTH0, 2, 0, 0 } },
310                }
311            })
312        }
313    }
314}
315
316Device (FLIS)
317{
318    Name (_HID, "INTC1002")
319    Name (_DDN, "Intel Merrifield Family-Level Interface Shim")
320    Name (RBUF, ResourceTemplate()
321    {
322        Memory32Fixed(ReadWrite, 0xFF0C0000, 0x00008000, )
323        PinGroup("spi5", ResourceProducer, ) { 90, 91, 92, 93, 94, 95, 96 }
324        PinGroup("uart0", ResourceProducer, ) { 115, 116, 117, 118 }
325        PinGroup("uart1", ResourceProducer, ) { 119, 120, 121, 122 }
326        PinGroup("uart2", ResourceProducer, ) { 123, 124, 125, 126 }
327        PinGroup("pwm0", ResourceProducer, ) { 144 }
328        PinGroup("pwm1", ResourceProducer, ) { 145 }
329        PinGroup("pwm2", ResourceProducer, ) { 132 }
330        PinGroup("pwm3", ResourceProducer, ) { 133 }
331    })
332
333    Method (_CRS, 0, NotSerialized)
334    {
335        Return (RBUF)
336    }
337
338    Method (_STA, 0, NotSerialized)
339    {
340        Return (STA_VISIBLE)
341    }
342}
343