blob: 3dcc6c195114f7e872655df658e5681514f1b60e [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 /* Intel Legacy Block */
Lee Leahy77ff0b12015-05-05 15:07:29 -07009 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 }
22}
23
Kyösti Mälkkid06f8002021-01-27 20:25:51 +020024External (\TOLM, IntObj)
25
Lee Leahy32471722015-04-20 15:20:28 -070026Name(_HID,EISAID("PNP0A08")) /* PCIe */
27Name(_CID,EISAID("PNP0A03")) /* PCI */
Lee Leahy77ff0b12015-05-05 15:07:29 -070028
Lee Leahy77ff0b12015-05-05 15:07:29 -070029Name(_BBN, 0)
30
31Method (_CRS, 0, Serialized)
32{
33 Name (MCRS, ResourceTemplate()
34 {
Lee Leahy32471722015-04-20 15:20:28 -070035 /* Bus Numbers */
Lee Leahy77ff0b12015-05-05 15:07:29 -070036 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
37 0x0000, 0x0000, 0x00ff, 0x0000, 0x0100,,, PB00)
38
Lee Leahy32471722015-04-20 15:20:28 -070039 /* IO Region 0 */
Lee Leahy77ff0b12015-05-05 15:07:29 -070040 DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
41 0x0000, 0x0000, 0x0cf7, 0x0000, 0x0cf8,,, PI00)
42
Lee Leahy32471722015-04-20 15:20:28 -070043 /* PCI Config Space */
Lee Leahy77ff0b12015-05-05 15:07:29 -070044 Io (Decode16, 0x0cf8, 0x0cf8, 0x0001, 0x0008)
45
Lee Leahy32471722015-04-20 15:20:28 -070046 /* IO Region 1 */
Lee Leahy77ff0b12015-05-05 15:07:29 -070047 DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
48 0x0000, 0x0d00, 0xffff, 0x0000, 0xf300,,, PI01)
49
Lee Leahy32471722015-04-20 15:20:28 -070050 /* VGA memory (0xa0000-0xbffff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070051 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
52 Cacheable, ReadWrite,
53 0x00000000, 0x000a0000, 0x000bffff, 0x00000000,
54 0x00020000,,, ASEG)
55
Lee Leahy32471722015-04-20 15:20:28 -070056 /* OPROM reserved (0xc0000-0xc3fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070057 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
58 Cacheable, ReadWrite,
59 0x00000000, 0x000c0000, 0x000c3fff, 0x00000000,
60 0x00004000,,, OPR0)
61
Lee Leahy32471722015-04-20 15:20:28 -070062 /* OPROM reserved (0xc4000-0xc7fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070063 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
64 Cacheable, ReadWrite,
65 0x00000000, 0x000c4000, 0x000c7fff, 0x00000000,
66 0x00004000,,, OPR1)
67
Lee Leahy32471722015-04-20 15:20:28 -070068 /* OPROM reserved (0xc8000-0xcbfff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070069 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
70 Cacheable, ReadWrite,
71 0x00000000, 0x000c8000, 0x000cbfff, 0x00000000,
72 0x00004000,,, OPR2)
73
Lee Leahy32471722015-04-20 15:20:28 -070074 /* OPROM reserved (0xcc000-0xcffff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070075 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
76 Cacheable, ReadWrite,
77 0x00000000, 0x000cc000, 0x000cffff, 0x00000000,
78 0x00004000,,, OPR3)
79
Lee Leahy32471722015-04-20 15:20:28 -070080 /* OPROM reserved (0xd0000-0xd3fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070081 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
82 Cacheable, ReadWrite,
83 0x00000000, 0x000d0000, 0x000d3fff, 0x00000000,
84 0x00004000,,, OPR4)
85
Lee Leahy32471722015-04-20 15:20:28 -070086 /* OPROM reserved (0xd4000-0xd7fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070087 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
88 Cacheable, ReadWrite,
89 0x00000000, 0x000d4000, 0x000d7fff, 0x00000000,
90 0x00004000,,, OPR5)
91
Lee Leahy32471722015-04-20 15:20:28 -070092 /* OPROM reserved (0xd8000-0xdbfff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070093 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
94 Cacheable, ReadWrite,
95 0x00000000, 0x000d8000, 0x000dbfff, 0x00000000,
96 0x00004000,,, OPR6)
97
Lee Leahy32471722015-04-20 15:20:28 -070098 /* OPROM reserved (0xdc000-0xdffff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070099 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
100 Cacheable, ReadWrite,
101 0x00000000, 0x000dc000, 0x000dffff, 0x00000000,
102 0x00004000,,, OPR7)
103
Lee Leahy32471722015-04-20 15:20:28 -0700104 /* BIOS Extension (0xe0000-0xe3fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700105 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
106 Cacheable, ReadWrite,
107 0x00000000, 0x000e0000, 0x000e3fff, 0x00000000,
108 0x00004000,,, ESG0)
109
Lee Leahy32471722015-04-20 15:20:28 -0700110 /* BIOS Extension (0xe4000-0xe7fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700111 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
112 Cacheable, ReadWrite,
113 0x00000000, 0x000e4000, 0x000e7fff, 0x00000000,
114 0x00004000,,, ESG1)
115
Lee Leahy32471722015-04-20 15:20:28 -0700116 /* BIOS Extension (0xe8000-0xebfff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700117 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
118 Cacheable, ReadWrite,
119 0x00000000, 0x000e8000, 0x000ebfff, 0x00000000,
120 0x00004000,,, ESG2)
121
Lee Leahy32471722015-04-20 15:20:28 -0700122 /* BIOS Extension (0xec000-0xeffff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700123 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
124 Cacheable, ReadWrite,
125 0x00000000, 0x000ec000, 0x000effff, 0x00000000,
126 0x00004000,,, ESG3)
127
Lee Leahy32471722015-04-20 15:20:28 -0700128 /* System BIOS (0xf0000-0xfffff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700129 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
130 Cacheable, ReadWrite,
131 0x00000000, 0x000f0000, 0x000fffff, 0x00000000,
132 0x00010000,,, FSEG)
133
Matt DeVillier687eb302017-06-04 14:39:18 -0500134 /* LPEA Memory Region (0x20000000-0x201FFFFF) */
135 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
136 Cacheable, ReadWrite,
137 0x00000000, 0x20000000, 0x201FFFFF, 0x00000000,
138 0x00200000,,, LMEM)
139
Shelley Chen4e9bb332021-10-20 15:43:45 -0700140 /* PCI Memory Region (Top of memory-CONFIG_ECAM_MMCONF_BASE_ADDRESS) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700141 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
142 Cacheable, ReadWrite,
Kyösti Mälkki639cc9c2021-02-01 13:57:45 +0200143 0x00000000, 0x00000000, 0x00000000, 0x00000000,
144 0x00000000,,, PMEM)
Lee Leahy77ff0b12015-05-05 15:07:29 -0700145
Lee Leahy32471722015-04-20 15:20:28 -0700146 /* TPM Area (0xfed40000-0xfed44fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700147 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
148 Cacheable, ReadWrite,
149 0x00000000, 0xfed40000, 0xfed44fff, 0x00000000,
150 0x00005000,,, TPMR)
151 })
152
Matt DeVillier687eb302017-06-04 14:39:18 -0500153 /* Update LPEA resource area */
154 CreateDWordField (MCRS, LMEM._MIN, LMIN)
155 CreateDWordField (MCRS, LMEM._MAX, LMAX)
156 CreateDWordField (MCRS, LMEM._LEN, LLEN)
Felix Singer9df60d32022-12-26 09:43:07 +0100157 If (LPFW != 0 && LPEN == 1)
Matt DeVillier687eb302017-06-04 14:39:18 -0500158 {
Felix Singer84e61232022-12-12 07:39:15 +0100159 LMIN = LPFW
160 LMAX = LMIN + 0x001FFFFF
161 LLEN = 0x00200000
Matt DeVillier687eb302017-06-04 14:39:18 -0500162 }
163 Else
164 {
Felix Singer9df60d32022-12-26 09:43:07 +0100165 LMIN = 0
166 LMAX = 0
167 LLEN = 0
Matt DeVillier687eb302017-06-04 14:39:18 -0500168 }
169
Lee Leahy32471722015-04-20 15:20:28 -0700170 /* Update PCI resource area */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700171 CreateDwordField(MCRS, PMEM._MIN, PMIN)
172 CreateDwordField(MCRS, PMEM._MAX, PMAX)
173 CreateDwordField(MCRS, PMEM._LEN, PLEN)
174
Lee Leahy32471722015-04-20 15:20:28 -0700175 /* TOLM is BMBOUND accessible from IOSF so is saved in NVS */
Felix Singer84e61232022-12-12 07:39:15 +0100176 PMIN = \TOLM
177 PMAX = CONFIG_ECAM_MMCONF_BASE_ADDRESS - 1
Felix Singer4bbd8072022-12-12 01:27:55 +0100178 PLEN = PMAX - PMIN + 1
Lee Leahy77ff0b12015-05-05 15:07:29 -0700179
180 Return (MCRS)
181}
182
183/* Device Resource Consumption */
184Device (PDRC)
185{
186 Name (_HID, EISAID("PNP0C02"))
187 Name (_UID, 1)
188
189 Name (PDRS, ResourceTemplate() {
190 Memory32Fixed(ReadWrite, ABORT_BASE_ADDRESS, ABORT_BASE_SIZE)
Shelley Chen4e9bb332021-10-20 15:43:45 -0700191 Memory32Fixed(ReadWrite, CONFIG_ECAM_MMCONF_BASE_ADDRESS, CONFIG_ECAM_MMCONF_LENGTH)
Lee Leahy77ff0b12015-05-05 15:07:29 -0700192 Memory32Fixed(ReadWrite, PMC_BASE_ADDRESS, PMC_BASE_SIZE)
193 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)
198 })
199
Lee Leahy32471722015-04-20 15:20:28 -0700200 /* Current Resource Settings */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700201 Method (_CRS, 0, Serialized)
202 {
203 Return(PDRS)
204 }
205}
206
207Method (_OSC, 4)
208{
209 /* Check for proper GUID */
Felix Singeredec4d92022-12-11 21:25:32 +0100210 If (Arg0 == ToUUID("33DB4D5B-1FF7-401C-9657-7441C03DD766"))
Lee Leahy77ff0b12015-05-05 15:07:29 -0700211 {
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
Lee Leahy77ff0b12015-05-05 15:07:29 -0700220 Return (Arg3)
221 }
222}
223
224/* 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 Singer84e61232022-12-12 07:39:15 +0100240 RBAS = CONFIG_ECAM_MMCONF_BASE_ADDRESS + 0xD0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700241 Return (^RBUF)
242 }
243}
244
Lee Leahy32471722015-04-20 15:20:28 -0700245/* LPC Bridge 0:1f.0 */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700246#include "lpc.asl"
247
Lee Leahy32471722015-04-20 15:20:28 -0700248/* USB XHCI 0:14.0 */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700249#include "xhci.asl"
250
Lee Leahy32471722015-04-20 15:20:28 -0700251/* IRQ routing for each PCI device */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700252#include "irqroute.asl"
253
Lee Leahy77ff0b12015-05-05 15:07:29 -0700254Scope (\_SB)
255{
Lee Leahy32471722015-04-20 15:20:28 -0700256 /* GPIO Devices */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700257 #include "gpio.asl"
Matt DeVillier6a67ffb2017-06-02 12:30:07 -0500258}
Lee Leahy77ff0b12015-05-05 15:07:29 -0700259
Matt DeVillier6a67ffb2017-06-02 12:30:07 -0500260Scope (\_SB.PCI0)
261{
Lee Leahy32471722015-04-20 15:20:28 -0700262 /* LPSS Devices */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700263 #include "lpss.asl"
264
Lee Leahy32471722015-04-20 15:20:28 -0700265 /* SCC Devices */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700266 #include "scc.asl"
Lee Leahy77ff0b12015-05-05 15:07:29 -0700267}
Matt DeVillierc6589ae2020-11-28 13:17:54 -0600268
269/* Integrated graphics 0:2.0 */
270#include <drivers/intel/gma/acpi/gfx.asl>