blob: 8e765de4ff031957944ce4dd11a0f332e043d2d0 [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
Kyösti Mälkkid06f8002021-01-27 20:25:51 +020033External (\TOLM, IntObj)
34
Lee Leahy32471722015-04-20 15:20:28 -070035Name(_HID,EISAID("PNP0A08")) /* PCIe */
36Name(_CID,EISAID("PNP0A03")) /* PCI */
Lee Leahy77ff0b12015-05-05 15:07:29 -070037
Lee Leahy77ff0b12015-05-05 15:07:29 -070038Name(_BBN, 0)
39
40Method (_CRS, 0, Serialized)
41{
42 Name (MCRS, ResourceTemplate()
43 {
Lee Leahy32471722015-04-20 15:20:28 -070044 /* Bus Numbers */
Lee Leahy77ff0b12015-05-05 15:07:29 -070045 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
46 0x0000, 0x0000, 0x00ff, 0x0000, 0x0100,,, PB00)
47
Lee Leahy32471722015-04-20 15:20:28 -070048 /* IO Region 0 */
Lee Leahy77ff0b12015-05-05 15:07:29 -070049 DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
50 0x0000, 0x0000, 0x0cf7, 0x0000, 0x0cf8,,, PI00)
51
Lee Leahy32471722015-04-20 15:20:28 -070052 /* PCI Config Space */
Lee Leahy77ff0b12015-05-05 15:07:29 -070053 Io (Decode16, 0x0cf8, 0x0cf8, 0x0001, 0x0008)
54
Lee Leahy32471722015-04-20 15:20:28 -070055 /* IO Region 1 */
Lee Leahy77ff0b12015-05-05 15:07:29 -070056 DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
57 0x0000, 0x0d00, 0xffff, 0x0000, 0xf300,,, PI01)
58
Lee Leahy32471722015-04-20 15:20:28 -070059 /* VGA memory (0xa0000-0xbffff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070060 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
61 Cacheable, ReadWrite,
62 0x00000000, 0x000a0000, 0x000bffff, 0x00000000,
63 0x00020000,,, ASEG)
64
Lee Leahy32471722015-04-20 15:20:28 -070065 /* OPROM reserved (0xc0000-0xc3fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070066 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
67 Cacheable, ReadWrite,
68 0x00000000, 0x000c0000, 0x000c3fff, 0x00000000,
69 0x00004000,,, OPR0)
70
Lee Leahy32471722015-04-20 15:20:28 -070071 /* OPROM reserved (0xc4000-0xc7fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070072 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
73 Cacheable, ReadWrite,
74 0x00000000, 0x000c4000, 0x000c7fff, 0x00000000,
75 0x00004000,,, OPR1)
76
Lee Leahy32471722015-04-20 15:20:28 -070077 /* OPROM reserved (0xc8000-0xcbfff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070078 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
79 Cacheable, ReadWrite,
80 0x00000000, 0x000c8000, 0x000cbfff, 0x00000000,
81 0x00004000,,, OPR2)
82
Lee Leahy32471722015-04-20 15:20:28 -070083 /* OPROM reserved (0xcc000-0xcffff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070084 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
85 Cacheable, ReadWrite,
86 0x00000000, 0x000cc000, 0x000cffff, 0x00000000,
87 0x00004000,,, OPR3)
88
Lee Leahy32471722015-04-20 15:20:28 -070089 /* OPROM reserved (0xd0000-0xd3fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070090 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
91 Cacheable, ReadWrite,
92 0x00000000, 0x000d0000, 0x000d3fff, 0x00000000,
93 0x00004000,,, OPR4)
94
Lee Leahy32471722015-04-20 15:20:28 -070095 /* OPROM reserved (0xd4000-0xd7fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070096 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
97 Cacheable, ReadWrite,
98 0x00000000, 0x000d4000, 0x000d7fff, 0x00000000,
99 0x00004000,,, OPR5)
100
Lee Leahy32471722015-04-20 15:20:28 -0700101 /* OPROM reserved (0xd8000-0xdbfff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700102 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
103 Cacheable, ReadWrite,
104 0x00000000, 0x000d8000, 0x000dbfff, 0x00000000,
105 0x00004000,,, OPR6)
106
Lee Leahy32471722015-04-20 15:20:28 -0700107 /* OPROM reserved (0xdc000-0xdffff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700108 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
109 Cacheable, ReadWrite,
110 0x00000000, 0x000dc000, 0x000dffff, 0x00000000,
111 0x00004000,,, OPR7)
112
Lee Leahy32471722015-04-20 15:20:28 -0700113 /* BIOS Extension (0xe0000-0xe3fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700114 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
115 Cacheable, ReadWrite,
116 0x00000000, 0x000e0000, 0x000e3fff, 0x00000000,
117 0x00004000,,, ESG0)
118
Lee Leahy32471722015-04-20 15:20:28 -0700119 /* BIOS Extension (0xe4000-0xe7fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700120 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
121 Cacheable, ReadWrite,
122 0x00000000, 0x000e4000, 0x000e7fff, 0x00000000,
123 0x00004000,,, ESG1)
124
Lee Leahy32471722015-04-20 15:20:28 -0700125 /* BIOS Extension (0xe8000-0xebfff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700126 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
127 Cacheable, ReadWrite,
128 0x00000000, 0x000e8000, 0x000ebfff, 0x00000000,
129 0x00004000,,, ESG2)
130
Lee Leahy32471722015-04-20 15:20:28 -0700131 /* BIOS Extension (0xec000-0xeffff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700132 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
133 Cacheable, ReadWrite,
134 0x00000000, 0x000ec000, 0x000effff, 0x00000000,
135 0x00004000,,, ESG3)
136
Lee Leahy32471722015-04-20 15:20:28 -0700137 /* System BIOS (0xf0000-0xfffff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700138 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
139 Cacheable, ReadWrite,
140 0x00000000, 0x000f0000, 0x000fffff, 0x00000000,
141 0x00010000,,, FSEG)
142
Matt DeVillier687eb302017-06-04 14:39:18 -0500143 /* LPEA Memory Region (0x20000000-0x201FFFFF) */
144 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
145 Cacheable, ReadWrite,
146 0x00000000, 0x20000000, 0x201FFFFF, 0x00000000,
147 0x00200000,,, LMEM)
148
Shelley Chen4e9bb332021-10-20 15:43:45 -0700149 /* PCI Memory Region (Top of memory-CONFIG_ECAM_MMCONF_BASE_ADDRESS) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700150 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
151 Cacheable, ReadWrite,
Kyösti Mälkki639cc9c2021-02-01 13:57:45 +0200152 0x00000000, 0x00000000, 0x00000000, 0x00000000,
153 0x00000000,,, PMEM)
Lee Leahy77ff0b12015-05-05 15:07:29 -0700154
Lee Leahy32471722015-04-20 15:20:28 -0700155 /* TPM Area (0xfed40000-0xfed44fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700156 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
157 Cacheable, ReadWrite,
158 0x00000000, 0xfed40000, 0xfed44fff, 0x00000000,
159 0x00005000,,, TPMR)
160 })
161
Matt DeVillier687eb302017-06-04 14:39:18 -0500162 /* Update LPEA resource area */
163 CreateDWordField (MCRS, LMEM._MIN, LMIN)
164 CreateDWordField (MCRS, LMEM._MAX, LMAX)
165 CreateDWordField (MCRS, LMEM._LEN, LLEN)
166 If (LAnd (LNotEqual (LPFW, Zero), LEqual (LPEN, One)))
167 {
168 Store (LPFW, LMIN)
169 Store (Add (LMIN, 0x001FFFFF), LMAX)
170 Store (0x00200000, LLEN)
171 }
172 Else
173 {
174 Store (Zero, LMIN)
175 Store (Zero, LMAX)
176 Store (Zero, LLEN)
177 }
178
Lee Leahy32471722015-04-20 15:20:28 -0700179 /* Update PCI resource area */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700180 CreateDwordField(MCRS, PMEM._MIN, PMIN)
181 CreateDwordField(MCRS, PMEM._MAX, PMAX)
182 CreateDwordField(MCRS, PMEM._LEN, PLEN)
183
Lee Leahy32471722015-04-20 15:20:28 -0700184 /* TOLM is BMBOUND accessible from IOSF so is saved in NVS */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700185 Store (\TOLM, PMIN)
Shelley Chen4e9bb332021-10-20 15:43:45 -0700186 Store (Subtract(CONFIG_ECAM_MMCONF_BASE_ADDRESS, 1), PMAX)
Lee Leahy77ff0b12015-05-05 15:07:29 -0700187 Add (Subtract (PMAX, PMIN), 1, PLEN)
188
189 Return (MCRS)
190}
191
192/* Device Resource Consumption */
193Device (PDRC)
194{
195 Name (_HID, EISAID("PNP0C02"))
196 Name (_UID, 1)
197
198 Name (PDRS, ResourceTemplate() {
199 Memory32Fixed(ReadWrite, ABORT_BASE_ADDRESS, ABORT_BASE_SIZE)
Shelley Chen4e9bb332021-10-20 15:43:45 -0700200 Memory32Fixed(ReadWrite, CONFIG_ECAM_MMCONF_BASE_ADDRESS, CONFIG_ECAM_MMCONF_LENGTH)
Lee Leahy77ff0b12015-05-05 15:07:29 -0700201 Memory32Fixed(ReadWrite, PMC_BASE_ADDRESS, PMC_BASE_SIZE)
202 Memory32Fixed(ReadWrite, ILB_BASE_ADDRESS, ILB_BASE_SIZE)
203 Memory32Fixed(ReadWrite, SPI_BASE_ADDRESS, SPI_BASE_SIZE)
204 Memory32Fixed(ReadWrite, MPHY_BASE_ADDRESS, MPHY_BASE_SIZE)
205 Memory32Fixed(ReadWrite, PUNIT_BASE_ADDRESS, PUNIT_BASE_SIZE)
206 Memory32Fixed(ReadWrite, RCBA_BASE_ADDRESS, RCBA_BASE_SIZE)
207 })
208
Lee Leahy32471722015-04-20 15:20:28 -0700209 /* Current Resource Settings */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700210 Method (_CRS, 0, Serialized)
211 {
212 Return(PDRS)
213 }
214}
215
216Method (_OSC, 4)
217{
218 /* Check for proper GUID */
219 If (LEqual (Arg0, ToUUID("33DB4D5B-1FF7-401C-9657-7441C03DD766")))
220 {
221 /* Let OS control everything */
222 Return (Arg3)
223 }
224 Else
225 {
226 /* Unrecognized UUID */
227 CreateDWordField (Arg3, 0, CDW1)
228 Or (CDW1, 4, CDW1)
229 Return (Arg3)
230 }
231}
232
233/* IOSF MBI Interface for kernel access */
234Device (IOSF)
235{
236 Name (_HID, "INT33BD")
237 Name (_CID, "INT33BD")
238 Name (_UID, 1)
239
240 Name (RBUF, ResourceTemplate ()
241 {
242 /* MCR / MDR / MCRX */
243 Memory32Fixed (ReadWrite, 0, 12, RBAR)
244 })
245
246 Method (_CRS)
247 {
248 CreateDwordField (^RBUF, ^RBAR._BAS, RBAS)
Shelley Chen4e9bb332021-10-20 15:43:45 -0700249 Store (Add (CONFIG_ECAM_MMCONF_BASE_ADDRESS, 0xD0), RBAS)
Lee Leahy77ff0b12015-05-05 15:07:29 -0700250 Return (^RBUF)
251 }
252}
253
Lee Leahy32471722015-04-20 15:20:28 -0700254/* LPC Bridge 0:1f.0 */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700255#include "lpc.asl"
256
Lee Leahy32471722015-04-20 15:20:28 -0700257/* USB XHCI 0:14.0 */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700258#include "xhci.asl"
259
Lee Leahy32471722015-04-20 15:20:28 -0700260/* IRQ routing for each PCI device */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700261#include "irqroute.asl"
262
Lee Leahy77ff0b12015-05-05 15:07:29 -0700263Scope (\_SB)
264{
Lee Leahy32471722015-04-20 15:20:28 -0700265 /* GPIO Devices */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700266 #include "gpio.asl"
Matt DeVillier6a67ffb2017-06-02 12:30:07 -0500267}
Lee Leahy77ff0b12015-05-05 15:07:29 -0700268
Matt DeVillier6a67ffb2017-06-02 12:30:07 -0500269Scope (\_SB.PCI0)
270{
Lee Leahy32471722015-04-20 15:20:28 -0700271 /* LPSS Devices */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700272 #include "lpss.asl"
273
Lee Leahy32471722015-04-20 15:20:28 -0700274 /* SCC Devices */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700275 #include "scc.asl"
Lee Leahy77ff0b12015-05-05 15:07:29 -0700276}
Matt DeVillierc6589ae2020-11-28 13:17:54 -0600277
278/* Integrated graphics 0:2.0 */
279#include <drivers/intel/gma/acpi/gfx.asl>