blob: 131825e3410c04972c1c9c434b5fa2694508ace3 [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 /* Intel Legacy Block */
Aaron Durbin3bde3d72013-11-04 21:45:52 -06009 OperationRegion(ILBS, SystemMemory, ILB_BASE_ADDRESS, ILB_BASE_SIZE)
10 Field (ILBS, AnyAcc, NoLock, Preserve)
11 {
12 Offset (0x8),
13 PRTA, 8,
14 PRTB, 8,
15 PRTC, 8,
16 PRTD, 8,
17 PRTE, 8,
18 PRTF, 8,
19 PRTG, 8,
20 PRTH, 8,
21 }
Aaron Durbin9a7d7bc2013-09-07 00:41:48 -050022}
Duncan Laurie7fbe20b2013-11-04 17:00:22 -080023
Kyösti Mälkkid06f8002021-01-27 20:25:51 +020024External (\TOLM, IntObj)
25
Angel Pons26b49cc2020-07-07 17:17:51 +020026Name(_HID,EISAID("PNP0A08")) /* PCIe */
27Name(_CID,EISAID("PNP0A03")) /* PCI */
Duncan Laurie053bd072013-11-04 17:19:16 -080028
Duncan Laurie053bd072013-11-04 17:19:16 -080029Name(_BBN, 0)
30
Martin Roth61492332015-11-23 10:38:10 -070031Name (MCRS, ResourceTemplate()
32{
Matt DeVillier21a9bf82020-12-18 19:33:46 -060033 /* Bus Numbers */
Martin Roth61492332015-11-23 10:38:10 -070034 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
35 0x0000, 0x0000, 0x00ff, 0x0000, 0x0100,,, PB00)
36
Matt DeVillier21a9bf82020-12-18 19:33:46 -060037 /* IO Region 0 */
Martin Roth61492332015-11-23 10:38:10 -070038 DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
39 0x0000, 0x0000, 0x0cf7, 0x0000, 0x0cf8,,, PI00)
40
Matt DeVillier21a9bf82020-12-18 19:33:46 -060041 /* PCI Config Space */
Martin Roth61492332015-11-23 10:38:10 -070042 Io (Decode16, 0x0cf8, 0x0cf8, 0x0001, 0x0008)
43
Matt DeVillier21a9bf82020-12-18 19:33:46 -060044 /* IO Region 1 */
Martin Roth61492332015-11-23 10:38:10 -070045 DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
46 0x0000, 0x0d00, 0xffff, 0x0000, 0xf300,,, PI01)
47
Matt DeVillier21a9bf82020-12-18 19:33:46 -060048 /* VGA memory (0xa0000-0xbffff) */
Martin Roth61492332015-11-23 10:38:10 -070049 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
50 Cacheable, ReadWrite,
51 0x00000000, 0x000a0000, 0x000bffff, 0x00000000,
52 0x00020000,,, ASEG)
53
Matt DeVillier21a9bf82020-12-18 19:33:46 -060054 /* OPROM reserved (0xc0000-0xc3fff) */
Martin Roth61492332015-11-23 10:38:10 -070055 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
56 Cacheable, ReadWrite,
57 0x00000000, 0x000c0000, 0x000c3fff, 0x00000000,
58 0x00004000,,, OPR0)
59
Matt DeVillier21a9bf82020-12-18 19:33:46 -060060 /* OPROM reserved (0xc4000-0xc7fff) */
Martin Roth61492332015-11-23 10:38:10 -070061 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
62 Cacheable, ReadWrite,
63 0x00000000, 0x000c4000, 0x000c7fff, 0x00000000,
64 0x00004000,,, OPR1)
65
Matt DeVillier21a9bf82020-12-18 19:33:46 -060066 /* OPROM reserved (0xc8000-0xcbfff) */
Martin Roth61492332015-11-23 10:38:10 -070067 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
68 Cacheable, ReadWrite,
69 0x00000000, 0x000c8000, 0x000cbfff, 0x00000000,
70 0x00004000,,, OPR2)
71
Matt DeVillier21a9bf82020-12-18 19:33:46 -060072 /* OPROM reserved (0xcc000-0xcffff) */
Martin Roth61492332015-11-23 10:38:10 -070073 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
74 Cacheable, ReadWrite,
75 0x00000000, 0x000cc000, 0x000cffff, 0x00000000,
76 0x00004000,,, OPR3)
77
Matt DeVillier21a9bf82020-12-18 19:33:46 -060078 /* OPROM reserved (0xd0000-0xd3fff) */
Martin Roth61492332015-11-23 10:38:10 -070079 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
80 Cacheable, ReadWrite,
81 0x00000000, 0x000d0000, 0x000d3fff, 0x00000000,
82 0x00004000,,, OPR4)
83
Matt DeVillier21a9bf82020-12-18 19:33:46 -060084 /* OPROM reserved (0xd4000-0xd7fff) */
Martin Roth61492332015-11-23 10:38:10 -070085 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
86 Cacheable, ReadWrite,
87 0x00000000, 0x000d4000, 0x000d7fff, 0x00000000,
88 0x00004000,,, OPR5)
89
Matt DeVillier21a9bf82020-12-18 19:33:46 -060090 /* OPROM reserved (0xd8000-0xdbfff) */
Martin Roth61492332015-11-23 10:38:10 -070091 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
92 Cacheable, ReadWrite,
93 0x00000000, 0x000d8000, 0x000dbfff, 0x00000000,
94 0x00004000,,, OPR6)
95
Matt DeVillier21a9bf82020-12-18 19:33:46 -060096 /* OPROM reserved (0xdc000-0xdffff) */
Martin Roth61492332015-11-23 10:38:10 -070097 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
98 Cacheable, ReadWrite,
99 0x00000000, 0x000dc000, 0x000dffff, 0x00000000,
100 0x00004000,,, OPR7)
101
Matt DeVillier21a9bf82020-12-18 19:33:46 -0600102 /* BIOS Extension (0xe0000-0xe3fff) */
Martin Roth61492332015-11-23 10:38:10 -0700103 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
104 Cacheable, ReadWrite,
105 0x00000000, 0x000e0000, 0x000e3fff, 0x00000000,
106 0x00004000,,, ESG0)
107
Matt DeVillier21a9bf82020-12-18 19:33:46 -0600108 /* BIOS Extension (0xe4000-0xe7fff) */
Martin Roth61492332015-11-23 10:38:10 -0700109 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
110 Cacheable, ReadWrite,
111 0x00000000, 0x000e4000, 0x000e7fff, 0x00000000,
112 0x00004000,,, ESG1)
113
Matt DeVillier21a9bf82020-12-18 19:33:46 -0600114 /* BIOS Extension (0xe8000-0xebfff) */
Martin Roth61492332015-11-23 10:38:10 -0700115 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
116 Cacheable, ReadWrite,
117 0x00000000, 0x000e8000, 0x000ebfff, 0x00000000,
118 0x00004000,,, ESG2)
119
Matt DeVillier21a9bf82020-12-18 19:33:46 -0600120 /* BIOS Extension (0xec000-0xeffff) */
Martin Roth61492332015-11-23 10:38:10 -0700121 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
122 Cacheable, ReadWrite,
123 0x00000000, 0x000ec000, 0x000effff, 0x00000000,
124 0x00004000,,, ESG3)
125
Matt DeVillier21a9bf82020-12-18 19:33:46 -0600126 /* System BIOS (0xf0000-0xfffff) */
Martin Roth61492332015-11-23 10:38:10 -0700127 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
128 Cacheable, ReadWrite,
129 0x00000000, 0x000f0000, 0x000fffff, 0x00000000,
130 0x00010000,,, FSEG)
131
Matt DeVillier21a9bf82020-12-18 19:33:46 -0600132 /* LPEA Memory Region (0x20000000-0x201FFFFF) */
Martin Roth61492332015-11-23 10:38:10 -0700133 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
134 Cacheable, ReadWrite,
135 0x00000000, 0x00000000, 0x00000000, 0x00000000,
Matt DeVillier6a7b7072020-12-18 19:05:09 -0600136 0x00000000,,, LMEM)
137
Shelley Chen4e9bb332021-10-20 15:43:45 -0700138 /* PCI Memory Region (Top of memory-CONFIG_ECAM_MMCONF_BASE_ADDRESS) */
Kyösti Mälkki639cc9c2021-02-01 13:57:45 +0200139 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
Matt DeVillier6a7b7072020-12-18 19:05:09 -0600140 Cacheable, ReadWrite,
141 0x00000000, 0x00000000, 0x00000000, 0x00000000,
142 0x00000000,,, PMEM)
Martin Roth61492332015-11-23 10:38:10 -0700143
Matt DeVillier21a9bf82020-12-18 19:33:46 -0600144 /* TPM Area (0xfed40000-0xfed44fff) */
Martin Roth61492332015-11-23 10:38:10 -0700145 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
146 Cacheable, ReadWrite,
147 0x00000000, 0xfed40000, 0xfed44fff, 0x00000000,
148 0x00005000,,, TPMR)
149})
150
Duncan Laurie053bd072013-11-04 17:19:16 -0800151Method (_CRS, 0, Serialized)
152{
Duncan Laurie053bd072013-11-04 17:19:16 -0800153
Matt DeVillier6a7b7072020-12-18 19:05:09 -0600154 /* Update LPEA resource area */
155 CreateDWordField (MCRS, ^LMEM._MIN, LMIN)
156 CreateDWordField (MCRS, ^LMEM._MAX, LMAX)
157 CreateDWordField (MCRS, ^LMEM._LEN, LLEN)
Felix Singer9df60d32022-12-26 09:43:07 +0100158 If (LPFW != 0 && LPEN == 1)
Matt DeVillier6a7b7072020-12-18 19:05:09 -0600159 {
Felix Singer476fe6a2022-12-12 07:30:07 +0100160 LMIN = LPFW
161 LLEN = 0x00100000
Felix Singer7b8ac002022-12-26 08:45:56 +0100162 LMAX = LMIN + LLEN - 1
Matt DeVillier6a7b7072020-12-18 19:05:09 -0600163 }
164 Else
165 {
Felix Singer9df60d32022-12-26 09:43:07 +0100166 LMIN = 0
167 LMAX = 0
168 LLEN = 0
Matt DeVillier6a7b7072020-12-18 19:05:09 -0600169 }
170
Angel Pons26b49cc2020-07-07 17:17:51 +0200171 /* Update PCI resource area */
Matt DeVillier6a7b7072020-12-18 19:05:09 -0600172 CreateDWordField (MCRS, ^PMEM._MIN, PMIN)
173 CreateDWordField (MCRS, ^PMEM._MAX, PMAX)
174 CreateDWordField (MCRS, ^PMEM._LEN, PLEN)
Duncan Laurie053bd072013-11-04 17:19:16 -0800175
Angel Pons26b49cc2020-07-07 17:17:51 +0200176 /* TOLM is BMBOUND accessible from IOSF so is saved in NVS */
Felix Singer476fe6a2022-12-12 07:30:07 +0100177 PMIN = \TOLM
178 PMAX = CONFIG_ECAM_MMCONF_BASE_ADDRESS - 1
Felix Singer4bbd8072022-12-12 01:27:55 +0100179 PLEN = PMAX - PMIN + 1
Duncan Laurie053bd072013-11-04 17:19:16 -0800180
181 Return (MCRS)
182}
183
Duncan Laurie7fbe20b2013-11-04 17:00:22 -0800184/* Device Resource Consumption */
185Device (PDRC)
186{
187 Name (_HID, EISAID("PNP0C02"))
188 Name (_UID, 1)
189
190 Name (PDRS, ResourceTemplate() {
191 Memory32Fixed(ReadWrite, ABORT_BASE_ADDRESS, ABORT_BASE_SIZE)
Duncan Laurie7fbe20b2013-11-04 17:00:22 -0800192 Memory32Fixed(ReadWrite, PMC_BASE_ADDRESS, PMC_BASE_SIZE)
Duncan Laurie7fbe20b2013-11-04 17:00:22 -0800193 Memory32Fixed(ReadWrite, ILB_BASE_ADDRESS, ILB_BASE_SIZE)
194 Memory32Fixed(ReadWrite, SPI_BASE_ADDRESS, SPI_BASE_SIZE)
195 Memory32Fixed(ReadWrite, MPHY_BASE_ADDRESS, MPHY_BASE_SIZE)
196 Memory32Fixed(ReadWrite, PUNIT_BASE_ADDRESS, PUNIT_BASE_SIZE)
197 Memory32Fixed(ReadWrite, RCBA_BASE_ADDRESS, RCBA_BASE_SIZE)
Duncan Laurie7fbe20b2013-11-04 17:00:22 -0800198 })
199
Angel Pons26b49cc2020-07-07 17:17:51 +0200200 /* Current Resource Settings */
Duncan Laurie7fbe20b2013-11-04 17:00:22 -0800201 Method (_CRS, 0, Serialized)
202 {
203 Return(PDRS)
204 }
205}
Duncan Laurie93966e82013-11-04 17:28:19 -0800206
207Method (_OSC, 4)
208{
209 /* Check for proper GUID */
Felix Singer26c76722022-12-11 21:15:05 +0100210 If (Arg0 == ToUUID("33DB4D5B-1FF7-401C-9657-7441C03DD766"))
Duncan Laurie93966e82013-11-04 17:28:19 -0800211 {
212 /* Let OS control everything */
213 Return (Arg3)
214 }
215 Else
216 {
217 /* Unrecognized UUID */
218 CreateDWordField (Arg3, 0, CDW1)
Felix Singer86bc2e72022-12-16 04:40:39 +0100219 CDW1 |= 4
Duncan Laurie93966e82013-11-04 17:28:19 -0800220 Return (Arg3)
221 }
222}
Aaron Durbin3bde3d72013-11-04 21:45:52 -0600223
Duncan Laurie2e657962013-12-13 16:43:11 -0800224/* IOSF MBI Interface for kernel access */
225Device (IOSF)
226{
227 Name (_HID, "INT33BD")
228 Name (_CID, "INT33BD")
229 Name (_UID, 1)
230
231 Name (RBUF, ResourceTemplate ()
232 {
233 /* MCR / MDR / MCRX */
234 Memory32Fixed (ReadWrite, 0, 12, RBAR)
235 })
236
237 Method (_CRS)
238 {
239 CreateDwordField (^RBUF, ^RBAR._BAS, RBAS)
Felix Singer476fe6a2022-12-12 07:30:07 +0100240 RBAS = CONFIG_ECAM_MMCONF_BASE_ADDRESS + 0xD0
Duncan Laurie2e657962013-12-13 16:43:11 -0800241 Return (^RBUF)
242 }
243}
244
Angel Pons26b49cc2020-07-07 17:17:51 +0200245/* LPC Bridge 0:1f.0 */
Aaron Durbin3bde3d72013-11-04 21:45:52 -0600246#include "lpc.asl"
247
Angel Pons26b49cc2020-07-07 17:17:51 +0200248/* USB XHCI 0:14.0 */
Duncan Laurie3f94a742014-01-14 14:59:28 -0800249#include "xhci.asl"
250
Angel Pons26b49cc2020-07-07 17:17:51 +0200251/* IRQ routing for each PCI device */
Aaron Durbin3bde3d72013-11-04 21:45:52 -0600252#include "irqroute.asl"
Duncan Lauriebb0d1ea2013-12-03 10:00:20 -0800253
Matt DeVillier21a9bf82020-12-18 19:33:46 -0600254/* PCI Express Ports 0:1c.x */
Ted Kuo6ecaf652014-09-16 15:31:21 +0800255#include "pcie.asl"
256
Duncan Laurie430bf0d2013-12-10 14:37:42 -0800257Scope (\_SB)
258{
Angel Pons26b49cc2020-07-07 17:17:51 +0200259 /* GPIO Devices */
Duncan Laurie430bf0d2013-12-10 14:37:42 -0800260 #include "gpio.asl"
Matt DeVilliere34a7702017-01-09 01:35:48 -0600261}
Duncan Laurie430bf0d2013-12-10 14:37:42 -0800262
Matt DeVilliere34a7702017-01-09 01:35:48 -0600263Scope (\_SB.PCI0)
264{
Angel Pons26b49cc2020-07-07 17:17:51 +0200265 /* LPSS Devices */
Duncan Laurie430bf0d2013-12-10 14:37:42 -0800266 #include "lpss.asl"
267
Angel Pons26b49cc2020-07-07 17:17:51 +0200268 /* SCC Devices */
Duncan Laurie430bf0d2013-12-10 14:37:42 -0800269 #include "scc.asl"
Shawn Nematbakhsh51d787a2014-01-16 17:52:21 -0800270
Matt DeVillier21a9bf82020-12-18 19:33:46 -0600271 /* LPE Device */
Shawn Nematbakhsh51d787a2014-01-16 17:52:21 -0800272 #include "lpe.asl"
Duncan Laurie430bf0d2013-12-10 14:37:42 -0800273}
Matt DeVillierc6589ae2020-11-28 13:17:54 -0600274
275/* Integrated graphics 0:2.0 */
276#include <drivers/intel/gma/acpi/gfx.asl>