blob: 8fa95ef337dec14000a1c12c2f963d6670aa59c6 [file] [log] [blame]
Angel Ponsba38f372020-04-05 15:46:45 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Lee Leahy77ff0b12015-05-05 15:07:29 -07002
3#include <soc/iomap.h>
4#include <soc/irq.h>
5
6Scope(\)
7{
Lee Leahy32471722015-04-20 15:20:28 -07008 /* IO-Trap at 0x800. This is the ACPI->SMI communication interface. */
Lee Leahy77ff0b12015-05-05 15:07:29 -07009
10 OperationRegion(IO_T, SystemIO, 0x800, 0x10)
11 Field(IO_T, ByteAcc, NoLock, Preserve)
12 {
13 Offset(0x8),
Lee Leahy32471722015-04-20 15:20:28 -070014 TRP0, 8 /* IO-Trap at 0x808 */
Lee Leahy77ff0b12015-05-05 15:07:29 -070015 }
16
Lee Leahy32471722015-04-20 15:20:28 -070017 /* Intel Legacy Block */
Lee Leahy77ff0b12015-05-05 15:07:29 -070018 OperationRegion(ILBS, SystemMemory, ILB_BASE_ADDRESS, ILB_BASE_SIZE)
19 Field (ILBS, AnyAcc, NoLock, Preserve)
20 {
21 Offset (0x8),
22 PRTA, 8,
23 PRTB, 8,
24 PRTC, 8,
25 PRTD, 8,
26 PRTE, 8,
27 PRTF, 8,
28 PRTG, 8,
29 PRTH, 8,
30 }
31}
32
Lee Leahy32471722015-04-20 15:20:28 -070033Name(_HID,EISAID("PNP0A08")) /* PCIe */
34Name(_CID,EISAID("PNP0A03")) /* PCI */
Lee Leahy77ff0b12015-05-05 15:07:29 -070035
Lee Leahy77ff0b12015-05-05 15:07:29 -070036Name(_BBN, 0)
37
38Method (_CRS, 0, Serialized)
39{
40 Name (MCRS, ResourceTemplate()
41 {
Lee Leahy32471722015-04-20 15:20:28 -070042 /* Bus Numbers */
Lee Leahy77ff0b12015-05-05 15:07:29 -070043 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
44 0x0000, 0x0000, 0x00ff, 0x0000, 0x0100,,, PB00)
45
Lee Leahy32471722015-04-20 15:20:28 -070046 /* IO Region 0 */
Lee Leahy77ff0b12015-05-05 15:07:29 -070047 DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
48 0x0000, 0x0000, 0x0cf7, 0x0000, 0x0cf8,,, PI00)
49
Lee Leahy32471722015-04-20 15:20:28 -070050 /* PCI Config Space */
Lee Leahy77ff0b12015-05-05 15:07:29 -070051 Io (Decode16, 0x0cf8, 0x0cf8, 0x0001, 0x0008)
52
Lee Leahy32471722015-04-20 15:20:28 -070053 /* IO Region 1 */
Lee Leahy77ff0b12015-05-05 15:07:29 -070054 DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
55 0x0000, 0x0d00, 0xffff, 0x0000, 0xf300,,, PI01)
56
Lee Leahy32471722015-04-20 15:20:28 -070057 /* VGA memory (0xa0000-0xbffff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070058 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
59 Cacheable, ReadWrite,
60 0x00000000, 0x000a0000, 0x000bffff, 0x00000000,
61 0x00020000,,, ASEG)
62
Lee Leahy32471722015-04-20 15:20:28 -070063 /* OPROM reserved (0xc0000-0xc3fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070064 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
65 Cacheable, ReadWrite,
66 0x00000000, 0x000c0000, 0x000c3fff, 0x00000000,
67 0x00004000,,, OPR0)
68
Lee Leahy32471722015-04-20 15:20:28 -070069 /* OPROM reserved (0xc4000-0xc7fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070070 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
71 Cacheable, ReadWrite,
72 0x00000000, 0x000c4000, 0x000c7fff, 0x00000000,
73 0x00004000,,, OPR1)
74
Lee Leahy32471722015-04-20 15:20:28 -070075 /* OPROM reserved (0xc8000-0xcbfff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070076 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
77 Cacheable, ReadWrite,
78 0x00000000, 0x000c8000, 0x000cbfff, 0x00000000,
79 0x00004000,,, OPR2)
80
Lee Leahy32471722015-04-20 15:20:28 -070081 /* OPROM reserved (0xcc000-0xcffff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070082 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
83 Cacheable, ReadWrite,
84 0x00000000, 0x000cc000, 0x000cffff, 0x00000000,
85 0x00004000,,, OPR3)
86
Lee Leahy32471722015-04-20 15:20:28 -070087 /* OPROM reserved (0xd0000-0xd3fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070088 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
89 Cacheable, ReadWrite,
90 0x00000000, 0x000d0000, 0x000d3fff, 0x00000000,
91 0x00004000,,, OPR4)
92
Lee Leahy32471722015-04-20 15:20:28 -070093 /* OPROM reserved (0xd4000-0xd7fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070094 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
95 Cacheable, ReadWrite,
96 0x00000000, 0x000d4000, 0x000d7fff, 0x00000000,
97 0x00004000,,, OPR5)
98
Lee Leahy32471722015-04-20 15:20:28 -070099 /* OPROM reserved (0xd8000-0xdbfff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700100 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
101 Cacheable, ReadWrite,
102 0x00000000, 0x000d8000, 0x000dbfff, 0x00000000,
103 0x00004000,,, OPR6)
104
Lee Leahy32471722015-04-20 15:20:28 -0700105 /* OPROM reserved (0xdc000-0xdffff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700106 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
107 Cacheable, ReadWrite,
108 0x00000000, 0x000dc000, 0x000dffff, 0x00000000,
109 0x00004000,,, OPR7)
110
Lee Leahy32471722015-04-20 15:20:28 -0700111 /* BIOS Extension (0xe0000-0xe3fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700112 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
113 Cacheable, ReadWrite,
114 0x00000000, 0x000e0000, 0x000e3fff, 0x00000000,
115 0x00004000,,, ESG0)
116
Lee Leahy32471722015-04-20 15:20:28 -0700117 /* BIOS Extension (0xe4000-0xe7fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700118 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
119 Cacheable, ReadWrite,
120 0x00000000, 0x000e4000, 0x000e7fff, 0x00000000,
121 0x00004000,,, ESG1)
122
Lee Leahy32471722015-04-20 15:20:28 -0700123 /* BIOS Extension (0xe8000-0xebfff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700124 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
125 Cacheable, ReadWrite,
126 0x00000000, 0x000e8000, 0x000ebfff, 0x00000000,
127 0x00004000,,, ESG2)
128
Lee Leahy32471722015-04-20 15:20:28 -0700129 /* BIOS Extension (0xec000-0xeffff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700130 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
131 Cacheable, ReadWrite,
132 0x00000000, 0x000ec000, 0x000effff, 0x00000000,
133 0x00004000,,, ESG3)
134
Lee Leahy32471722015-04-20 15:20:28 -0700135 /* System BIOS (0xf0000-0xfffff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700136 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
137 Cacheable, ReadWrite,
138 0x00000000, 0x000f0000, 0x000fffff, 0x00000000,
139 0x00010000,,, FSEG)
140
Matt DeVillier687eb302017-06-04 14:39:18 -0500141 /* LPEA Memory Region (0x20000000-0x201FFFFF) */
142 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
143 Cacheable, ReadWrite,
144 0x00000000, 0x20000000, 0x201FFFFF, 0x00000000,
145 0x00200000,,, LMEM)
146
Kyösti Mälkki639cc9c2021-02-01 13:57:45 +0200147 /* PCI Memory Region (Top of memory-CONFIG_MMCONF_BASE_ADDRESS) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700148 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
149 Cacheable, ReadWrite,
Kyösti Mälkki639cc9c2021-02-01 13:57:45 +0200150 0x00000000, 0x00000000, 0x00000000, 0x00000000,
151 0x00000000,,, PMEM)
Lee Leahy77ff0b12015-05-05 15:07:29 -0700152
Lee Leahy32471722015-04-20 15:20:28 -0700153 /* TPM Area (0xfed40000-0xfed44fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700154 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
155 Cacheable, ReadWrite,
156 0x00000000, 0xfed40000, 0xfed44fff, 0x00000000,
157 0x00005000,,, TPMR)
158 })
159
Matt DeVillier687eb302017-06-04 14:39:18 -0500160 /* Update LPEA resource area */
161 CreateDWordField (MCRS, LMEM._MIN, LMIN)
162 CreateDWordField (MCRS, LMEM._MAX, LMAX)
163 CreateDWordField (MCRS, LMEM._LEN, LLEN)
164 If (LAnd (LNotEqual (LPFW, Zero), LEqual (LPEN, One)))
165 {
166 Store (LPFW, LMIN)
167 Store (Add (LMIN, 0x001FFFFF), LMAX)
168 Store (0x00200000, LLEN)
169 }
170 Else
171 {
172 Store (Zero, LMIN)
173 Store (Zero, LMAX)
174 Store (Zero, LLEN)
175 }
176
Lee Leahy32471722015-04-20 15:20:28 -0700177 /* Update PCI resource area */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700178 CreateDwordField(MCRS, PMEM._MIN, PMIN)
179 CreateDwordField(MCRS, PMEM._MAX, PMAX)
180 CreateDwordField(MCRS, PMEM._LEN, PLEN)
181
Lee Leahy32471722015-04-20 15:20:28 -0700182 /* TOLM is BMBOUND accessible from IOSF so is saved in NVS */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700183 Store (\TOLM, PMIN)
Matt DeVillier7440cc82017-06-04 14:37:09 -0500184 Store (Subtract(CONFIG_MMCONF_BASE_ADDRESS, 1), PMAX)
Lee Leahy77ff0b12015-05-05 15:07:29 -0700185 Add (Subtract (PMAX, PMIN), 1, PLEN)
186
187 Return (MCRS)
188}
189
190/* Device Resource Consumption */
191Device (PDRC)
192{
193 Name (_HID, EISAID("PNP0C02"))
194 Name (_UID, 1)
195
196 Name (PDRS, ResourceTemplate() {
197 Memory32Fixed(ReadWrite, ABORT_BASE_ADDRESS, ABORT_BASE_SIZE)
198 Memory32Fixed(ReadWrite, MCFG_BASE_ADDRESS, MCFG_BASE_SIZE)
199 Memory32Fixed(ReadWrite, PMC_BASE_ADDRESS, PMC_BASE_SIZE)
200 Memory32Fixed(ReadWrite, ILB_BASE_ADDRESS, ILB_BASE_SIZE)
201 Memory32Fixed(ReadWrite, SPI_BASE_ADDRESS, SPI_BASE_SIZE)
202 Memory32Fixed(ReadWrite, MPHY_BASE_ADDRESS, MPHY_BASE_SIZE)
203 Memory32Fixed(ReadWrite, PUNIT_BASE_ADDRESS, PUNIT_BASE_SIZE)
204 Memory32Fixed(ReadWrite, RCBA_BASE_ADDRESS, RCBA_BASE_SIZE)
205 })
206
Lee Leahy32471722015-04-20 15:20:28 -0700207 /* Current Resource Settings */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700208 Method (_CRS, 0, Serialized)
209 {
210 Return(PDRS)
211 }
212}
213
214Method (_OSC, 4)
215{
216 /* Check for proper GUID */
217 If (LEqual (Arg0, ToUUID("33DB4D5B-1FF7-401C-9657-7441C03DD766")))
218 {
219 /* Let OS control everything */
220 Return (Arg3)
221 }
222 Else
223 {
224 /* Unrecognized UUID */
225 CreateDWordField (Arg3, 0, CDW1)
226 Or (CDW1, 4, CDW1)
227 Return (Arg3)
228 }
229}
230
231/* IOSF MBI Interface for kernel access */
232Device (IOSF)
233{
234 Name (_HID, "INT33BD")
235 Name (_CID, "INT33BD")
236 Name (_UID, 1)
237
238 Name (RBUF, ResourceTemplate ()
239 {
240 /* MCR / MDR / MCRX */
241 Memory32Fixed (ReadWrite, 0, 12, RBAR)
242 })
243
244 Method (_CRS)
245 {
246 CreateDwordField (^RBUF, ^RBAR._BAS, RBAS)
247 Store (Add (MCFG_BASE_ADDRESS, 0xD0), RBAS)
248 Return (^RBUF)
249 }
250}
251
Lee Leahy32471722015-04-20 15:20:28 -0700252/* LPC Bridge 0:1f.0 */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700253#include "lpc.asl"
254
Lee Leahy32471722015-04-20 15:20:28 -0700255/* USB XHCI 0:14.0 */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700256#include "xhci.asl"
257
Lee Leahy32471722015-04-20 15:20:28 -0700258/* IRQ routing for each PCI device */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700259#include "irqroute.asl"
260
Lee Leahy77ff0b12015-05-05 15:07:29 -0700261Scope (\_SB)
262{
Lee Leahy32471722015-04-20 15:20:28 -0700263 /* GPIO Devices */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700264 #include "gpio.asl"
Matt DeVillier6a67ffb2017-06-02 12:30:07 -0500265}
Lee Leahy77ff0b12015-05-05 15:07:29 -0700266
Matt DeVillier6a67ffb2017-06-02 12:30:07 -0500267Scope (\_SB.PCI0)
268{
Lee Leahy32471722015-04-20 15:20:28 -0700269 /* LPSS Devices */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700270 #include "lpss.asl"
271
Lee Leahy32471722015-04-20 15:20:28 -0700272 /* SCC Devices */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700273 #include "scc.asl"
Lee Leahy77ff0b12015-05-05 15:07:29 -0700274}
Matt DeVillierc6589ae2020-11-28 13:17:54 -0600275
276/* Integrated graphics 0:2.0 */
277#include <drivers/intel/gma/acpi/gfx.asl>