blob: c994fdabbeb512b202ae7c744d84295eada50171 [file] [log] [blame]
Angel Ponsc3f58f62020-04-05 15:46:41 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Aaron Durbin9a7d7bc2013-09-07 00:41:48 -05002
Julius Werner18ea2d32014-10-07 16:42:17 -07003#include <soc/iomap.h>
4#include <soc/irq.h>
Aaron Durbin3bde3d72013-11-04 21:45:52 -06005
Aaron Durbin9a7d7bc2013-09-07 00:41:48 -05006Scope(\)
7{
Angel Pons26b49cc2020-07-07 17:17:51 +02008 /* IO-Trap at 0x800. This is the ACPI->SMI communication interface. */
Aaron Durbin9a7d7bc2013-09-07 00:41:48 -05009
10 OperationRegion(IO_T, SystemIO, 0x800, 0x10)
11 Field(IO_T, ByteAcc, NoLock, Preserve)
12 {
13 Offset(0x8),
Angel Pons26b49cc2020-07-07 17:17:51 +020014 TRP0, 8 /* IO-Trap at 0x808 */
Aaron Durbin9a7d7bc2013-09-07 00:41:48 -050015 }
Aaron Durbin3bde3d72013-11-04 21:45:52 -060016
Angel Pons26b49cc2020-07-07 17:17:51 +020017 /* Intel Legacy Block */
Aaron Durbin3bde3d72013-11-04 21:45:52 -060018 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 }
Aaron Durbin9a7d7bc2013-09-07 00:41:48 -050031}
Duncan Laurie7fbe20b2013-11-04 17:00:22 -080032
Kyösti Mälkkid06f8002021-01-27 20:25:51 +020033External (\TOLM, IntObj)
34
Angel Pons26b49cc2020-07-07 17:17:51 +020035Name(_HID,EISAID("PNP0A08")) /* PCIe */
36Name(_CID,EISAID("PNP0A03")) /* PCI */
Duncan Laurie053bd072013-11-04 17:19:16 -080037
Duncan Laurie053bd072013-11-04 17:19:16 -080038Name(_BBN, 0)
39
Martin Roth61492332015-11-23 10:38:10 -070040Name (MCRS, ResourceTemplate()
41{
Matt DeVillier21a9bf82020-12-18 19:33:46 -060042 /* Bus Numbers */
Martin Roth61492332015-11-23 10:38:10 -070043 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
44 0x0000, 0x0000, 0x00ff, 0x0000, 0x0100,,, PB00)
45
Matt DeVillier21a9bf82020-12-18 19:33:46 -060046 /* IO Region 0 */
Martin Roth61492332015-11-23 10:38:10 -070047 DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
48 0x0000, 0x0000, 0x0cf7, 0x0000, 0x0cf8,,, PI00)
49
Matt DeVillier21a9bf82020-12-18 19:33:46 -060050 /* PCI Config Space */
Martin Roth61492332015-11-23 10:38:10 -070051 Io (Decode16, 0x0cf8, 0x0cf8, 0x0001, 0x0008)
52
Matt DeVillier21a9bf82020-12-18 19:33:46 -060053 /* IO Region 1 */
Martin Roth61492332015-11-23 10:38:10 -070054 DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
55 0x0000, 0x0d00, 0xffff, 0x0000, 0xf300,,, PI01)
56
Matt DeVillier21a9bf82020-12-18 19:33:46 -060057 /* VGA memory (0xa0000-0xbffff) */
Martin Roth61492332015-11-23 10:38:10 -070058 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
59 Cacheable, ReadWrite,
60 0x00000000, 0x000a0000, 0x000bffff, 0x00000000,
61 0x00020000,,, ASEG)
62
Matt DeVillier21a9bf82020-12-18 19:33:46 -060063 /* OPROM reserved (0xc0000-0xc3fff) */
Martin Roth61492332015-11-23 10:38:10 -070064 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
65 Cacheable, ReadWrite,
66 0x00000000, 0x000c0000, 0x000c3fff, 0x00000000,
67 0x00004000,,, OPR0)
68
Matt DeVillier21a9bf82020-12-18 19:33:46 -060069 /* OPROM reserved (0xc4000-0xc7fff) */
Martin Roth61492332015-11-23 10:38:10 -070070 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
71 Cacheable, ReadWrite,
72 0x00000000, 0x000c4000, 0x000c7fff, 0x00000000,
73 0x00004000,,, OPR1)
74
Matt DeVillier21a9bf82020-12-18 19:33:46 -060075 /* OPROM reserved (0xc8000-0xcbfff) */
Martin Roth61492332015-11-23 10:38:10 -070076 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
77 Cacheable, ReadWrite,
78 0x00000000, 0x000c8000, 0x000cbfff, 0x00000000,
79 0x00004000,,, OPR2)
80
Matt DeVillier21a9bf82020-12-18 19:33:46 -060081 /* OPROM reserved (0xcc000-0xcffff) */
Martin Roth61492332015-11-23 10:38:10 -070082 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
83 Cacheable, ReadWrite,
84 0x00000000, 0x000cc000, 0x000cffff, 0x00000000,
85 0x00004000,,, OPR3)
86
Matt DeVillier21a9bf82020-12-18 19:33:46 -060087 /* OPROM reserved (0xd0000-0xd3fff) */
Martin Roth61492332015-11-23 10:38:10 -070088 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
89 Cacheable, ReadWrite,
90 0x00000000, 0x000d0000, 0x000d3fff, 0x00000000,
91 0x00004000,,, OPR4)
92
Matt DeVillier21a9bf82020-12-18 19:33:46 -060093 /* OPROM reserved (0xd4000-0xd7fff) */
Martin Roth61492332015-11-23 10:38:10 -070094 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
95 Cacheable, ReadWrite,
96 0x00000000, 0x000d4000, 0x000d7fff, 0x00000000,
97 0x00004000,,, OPR5)
98
Matt DeVillier21a9bf82020-12-18 19:33:46 -060099 /* OPROM reserved (0xd8000-0xdbfff) */
Martin Roth61492332015-11-23 10:38:10 -0700100 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
101 Cacheable, ReadWrite,
102 0x00000000, 0x000d8000, 0x000dbfff, 0x00000000,
103 0x00004000,,, OPR6)
104
Matt DeVillier21a9bf82020-12-18 19:33:46 -0600105 /* OPROM reserved (0xdc000-0xdffff) */
Martin Roth61492332015-11-23 10:38:10 -0700106 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
107 Cacheable, ReadWrite,
108 0x00000000, 0x000dc000, 0x000dffff, 0x00000000,
109 0x00004000,,, OPR7)
110
Matt DeVillier21a9bf82020-12-18 19:33:46 -0600111 /* BIOS Extension (0xe0000-0xe3fff) */
Martin Roth61492332015-11-23 10:38:10 -0700112 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
113 Cacheable, ReadWrite,
114 0x00000000, 0x000e0000, 0x000e3fff, 0x00000000,
115 0x00004000,,, ESG0)
116
Matt DeVillier21a9bf82020-12-18 19:33:46 -0600117 /* BIOS Extension (0xe4000-0xe7fff) */
Martin Roth61492332015-11-23 10:38:10 -0700118 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
119 Cacheable, ReadWrite,
120 0x00000000, 0x000e4000, 0x000e7fff, 0x00000000,
121 0x00004000,,, ESG1)
122
Matt DeVillier21a9bf82020-12-18 19:33:46 -0600123 /* BIOS Extension (0xe8000-0xebfff) */
Martin Roth61492332015-11-23 10:38:10 -0700124 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
125 Cacheable, ReadWrite,
126 0x00000000, 0x000e8000, 0x000ebfff, 0x00000000,
127 0x00004000,,, ESG2)
128
Matt DeVillier21a9bf82020-12-18 19:33:46 -0600129 /* BIOS Extension (0xec000-0xeffff) */
Martin Roth61492332015-11-23 10:38:10 -0700130 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
131 Cacheable, ReadWrite,
132 0x00000000, 0x000ec000, 0x000effff, 0x00000000,
133 0x00004000,,, ESG3)
134
Matt DeVillier21a9bf82020-12-18 19:33:46 -0600135 /* System BIOS (0xf0000-0xfffff) */
Martin Roth61492332015-11-23 10:38:10 -0700136 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
137 Cacheable, ReadWrite,
138 0x00000000, 0x000f0000, 0x000fffff, 0x00000000,
139 0x00010000,,, FSEG)
140
Matt DeVillier21a9bf82020-12-18 19:33:46 -0600141 /* LPEA Memory Region (0x20000000-0x201FFFFF) */
Martin Roth61492332015-11-23 10:38:10 -0700142 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
143 Cacheable, ReadWrite,
144 0x00000000, 0x00000000, 0x00000000, 0x00000000,
Matt DeVillier6a7b7072020-12-18 19:05:09 -0600145 0x00000000,,, LMEM)
146
Shelley Chen4e9bb332021-10-20 15:43:45 -0700147 /* PCI Memory Region (Top of memory-CONFIG_ECAM_MMCONF_BASE_ADDRESS) */
Kyösti Mälkki639cc9c2021-02-01 13:57:45 +0200148 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
Matt DeVillier6a7b7072020-12-18 19:05:09 -0600149 Cacheable, ReadWrite,
150 0x00000000, 0x00000000, 0x00000000, 0x00000000,
151 0x00000000,,, PMEM)
Martin Roth61492332015-11-23 10:38:10 -0700152
Matt DeVillier21a9bf82020-12-18 19:33:46 -0600153 /* TPM Area (0xfed40000-0xfed44fff) */
Martin Roth61492332015-11-23 10:38:10 -0700154 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
155 Cacheable, ReadWrite,
156 0x00000000, 0xfed40000, 0xfed44fff, 0x00000000,
157 0x00005000,,, TPMR)
158})
159
Duncan Laurie053bd072013-11-04 17:19:16 -0800160Method (_CRS, 0, Serialized)
161{
Duncan Laurie053bd072013-11-04 17:19:16 -0800162
Matt DeVillier6a7b7072020-12-18 19:05:09 -0600163 /* Update LPEA resource area */
164 CreateDWordField (MCRS, ^LMEM._MIN, LMIN)
165 CreateDWordField (MCRS, ^LMEM._MAX, LMAX)
166 CreateDWordField (MCRS, ^LMEM._LEN, LLEN)
167 If (LAnd (LNotEqual (LPFW, Zero), LEqual (LPEN, One)))
168 {
169 Store (LPFW, LMIN)
170 Store (0x00100000, LLEN)
171 Subtract (Add (LMIN, LLEN), One, LMAX)
172 }
173 Else
174 {
175 Store (Zero, LMIN)
176 Store (Zero, LMAX)
177 Store (Zero, LLEN)
178 }
179
Angel Pons26b49cc2020-07-07 17:17:51 +0200180 /* Update PCI resource area */
Matt DeVillier6a7b7072020-12-18 19:05:09 -0600181 CreateDWordField (MCRS, ^PMEM._MIN, PMIN)
182 CreateDWordField (MCRS, ^PMEM._MAX, PMAX)
183 CreateDWordField (MCRS, ^PMEM._LEN, PLEN)
Duncan Laurie053bd072013-11-04 17:19:16 -0800184
Angel Pons26b49cc2020-07-07 17:17:51 +0200185 /* TOLM is BMBOUND accessible from IOSF so is saved in NVS */
Duncan Laurie053bd072013-11-04 17:19:16 -0800186 Store (\TOLM, PMIN)
Shelley Chen4e9bb332021-10-20 15:43:45 -0700187 Store (Subtract(CONFIG_ECAM_MMCONF_BASE_ADDRESS, 1), PMAX)
Duncan Laurie053bd072013-11-04 17:19:16 -0800188 Add (Subtract (PMAX, PMIN), 1, PLEN)
189
190 Return (MCRS)
191}
192
Duncan Laurie7fbe20b2013-11-04 17:00:22 -0800193/* Device Resource Consumption */
194Device (PDRC)
195{
196 Name (_HID, EISAID("PNP0C02"))
197 Name (_UID, 1)
198
199 Name (PDRS, ResourceTemplate() {
200 Memory32Fixed(ReadWrite, ABORT_BASE_ADDRESS, ABORT_BASE_SIZE)
Shelley Chen4e9bb332021-10-20 15:43:45 -0700201 Memory32Fixed(ReadWrite, CONFIG_ECAM_MMCONF_BASE_ADDRESS, CONFIG_ECAM_MMCONF_LENGTH)
Duncan Laurie7fbe20b2013-11-04 17:00:22 -0800202 Memory32Fixed(ReadWrite, PMC_BASE_ADDRESS, PMC_BASE_SIZE)
Duncan Laurie7fbe20b2013-11-04 17:00:22 -0800203 Memory32Fixed(ReadWrite, ILB_BASE_ADDRESS, ILB_BASE_SIZE)
204 Memory32Fixed(ReadWrite, SPI_BASE_ADDRESS, SPI_BASE_SIZE)
205 Memory32Fixed(ReadWrite, MPHY_BASE_ADDRESS, MPHY_BASE_SIZE)
206 Memory32Fixed(ReadWrite, PUNIT_BASE_ADDRESS, PUNIT_BASE_SIZE)
207 Memory32Fixed(ReadWrite, RCBA_BASE_ADDRESS, RCBA_BASE_SIZE)
Duncan Laurie7fbe20b2013-11-04 17:00:22 -0800208 })
209
Angel Pons26b49cc2020-07-07 17:17:51 +0200210 /* Current Resource Settings */
Duncan Laurie7fbe20b2013-11-04 17:00:22 -0800211 Method (_CRS, 0, Serialized)
212 {
213 Return(PDRS)
214 }
215}
Duncan Laurie93966e82013-11-04 17:28:19 -0800216
217Method (_OSC, 4)
218{
219 /* Check for proper GUID */
220 If (LEqual (Arg0, ToUUID("33DB4D5B-1FF7-401C-9657-7441C03DD766")))
221 {
222 /* Let OS control everything */
223 Return (Arg3)
224 }
225 Else
226 {
227 /* Unrecognized UUID */
228 CreateDWordField (Arg3, 0, CDW1)
229 Or (CDW1, 4, CDW1)
230 Return (Arg3)
231 }
232}
Aaron Durbin3bde3d72013-11-04 21:45:52 -0600233
Duncan Laurie2e657962013-12-13 16:43:11 -0800234/* IOSF MBI Interface for kernel access */
235Device (IOSF)
236{
237 Name (_HID, "INT33BD")
238 Name (_CID, "INT33BD")
239 Name (_UID, 1)
240
241 Name (RBUF, ResourceTemplate ()
242 {
243 /* MCR / MDR / MCRX */
244 Memory32Fixed (ReadWrite, 0, 12, RBAR)
245 })
246
247 Method (_CRS)
248 {
249 CreateDwordField (^RBUF, ^RBAR._BAS, RBAS)
Shelley Chen4e9bb332021-10-20 15:43:45 -0700250 Store (Add (CONFIG_ECAM_MMCONF_BASE_ADDRESS, 0xD0), RBAS)
Duncan Laurie2e657962013-12-13 16:43:11 -0800251 Return (^RBUF)
252 }
253}
254
Angel Pons26b49cc2020-07-07 17:17:51 +0200255/* LPC Bridge 0:1f.0 */
Aaron Durbin3bde3d72013-11-04 21:45:52 -0600256#include "lpc.asl"
257
Angel Pons26b49cc2020-07-07 17:17:51 +0200258/* USB XHCI 0:14.0 */
Duncan Laurie3f94a742014-01-14 14:59:28 -0800259#include "xhci.asl"
260
Angel Pons26b49cc2020-07-07 17:17:51 +0200261/* IRQ routing for each PCI device */
Aaron Durbin3bde3d72013-11-04 21:45:52 -0600262#include "irqroute.asl"
Duncan Lauriebb0d1ea2013-12-03 10:00:20 -0800263
Matt DeVillier21a9bf82020-12-18 19:33:46 -0600264/* PCI Express Ports 0:1c.x */
Ted Kuo6ecaf652014-09-16 15:31:21 +0800265#include "pcie.asl"
266
Duncan Laurie430bf0d2013-12-10 14:37:42 -0800267Scope (\_SB)
268{
Angel Pons26b49cc2020-07-07 17:17:51 +0200269 /* GPIO Devices */
Duncan Laurie430bf0d2013-12-10 14:37:42 -0800270 #include "gpio.asl"
Matt DeVilliere34a7702017-01-09 01:35:48 -0600271}
Duncan Laurie430bf0d2013-12-10 14:37:42 -0800272
Matt DeVilliere34a7702017-01-09 01:35:48 -0600273Scope (\_SB.PCI0)
274{
Angel Pons26b49cc2020-07-07 17:17:51 +0200275 /* LPSS Devices */
Duncan Laurie430bf0d2013-12-10 14:37:42 -0800276 #include "lpss.asl"
277
Angel Pons26b49cc2020-07-07 17:17:51 +0200278 /* SCC Devices */
Duncan Laurie430bf0d2013-12-10 14:37:42 -0800279 #include "scc.asl"
Shawn Nematbakhsh51d787a2014-01-16 17:52:21 -0800280
Matt DeVillier21a9bf82020-12-18 19:33:46 -0600281 /* LPE Device */
Shawn Nematbakhsh51d787a2014-01-16 17:52:21 -0800282 #include "lpe.asl"
Duncan Laurie430bf0d2013-12-10 14:37:42 -0800283}
Matt DeVillierc6589ae2020-11-28 13:17:54 -0600284
285/* Integrated graphics 0:2.0 */
286#include <drivers/intel/gma/acpi/gfx.asl>