blob: a3b4d922ead2eb8f445f59701f2f227fffecae84 [file] [log] [blame]
Angel Ponsba38f372020-04-05 15:46:45 +02001/* SPDX-License-Identifier: GPL-2.0-only */
2/* This file is part of the coreboot project. */
Lee Leahy77ff0b12015-05-05 15:07:29 -07003
4#include <soc/iomap.h>
5#include <soc/irq.h>
6
7Scope(\)
8{
Lee Leahy32471722015-04-20 15:20:28 -07009 /* IO-Trap at 0x800. This is the ACPI->SMI communication interface. */
Lee Leahy77ff0b12015-05-05 15:07:29 -070010
11 OperationRegion(IO_T, SystemIO, 0x800, 0x10)
12 Field(IO_T, ByteAcc, NoLock, Preserve)
13 {
14 Offset(0x8),
Lee Leahy32471722015-04-20 15:20:28 -070015 TRP0, 8 /* IO-Trap at 0x808 */
Lee Leahy77ff0b12015-05-05 15:07:29 -070016 }
17
Lee Leahy32471722015-04-20 15:20:28 -070018 /* Intel Legacy Block */
Lee Leahy77ff0b12015-05-05 15:07:29 -070019 OperationRegion(ILBS, SystemMemory, ILB_BASE_ADDRESS, ILB_BASE_SIZE)
20 Field (ILBS, AnyAcc, NoLock, Preserve)
21 {
22 Offset (0x8),
23 PRTA, 8,
24 PRTB, 8,
25 PRTC, 8,
26 PRTD, 8,
27 PRTE, 8,
28 PRTF, 8,
29 PRTG, 8,
30 PRTH, 8,
31 }
32}
33
Lee Leahy32471722015-04-20 15:20:28 -070034Name(_HID,EISAID("PNP0A08")) /* PCIe */
35Name(_CID,EISAID("PNP0A03")) /* PCI */
Lee Leahy77ff0b12015-05-05 15:07:29 -070036
Lee Leahy77ff0b12015-05-05 15:07:29 -070037Name(_BBN, 0)
38
39Method (_CRS, 0, Serialized)
40{
41 Name (MCRS, ResourceTemplate()
42 {
Lee Leahy32471722015-04-20 15:20:28 -070043 /* Bus Numbers */
Lee Leahy77ff0b12015-05-05 15:07:29 -070044 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
45 0x0000, 0x0000, 0x00ff, 0x0000, 0x0100,,, PB00)
46
Lee Leahy32471722015-04-20 15:20:28 -070047 /* IO Region 0 */
Lee Leahy77ff0b12015-05-05 15:07:29 -070048 DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
49 0x0000, 0x0000, 0x0cf7, 0x0000, 0x0cf8,,, PI00)
50
Lee Leahy32471722015-04-20 15:20:28 -070051 /* PCI Config Space */
Lee Leahy77ff0b12015-05-05 15:07:29 -070052 Io (Decode16, 0x0cf8, 0x0cf8, 0x0001, 0x0008)
53
Lee Leahy32471722015-04-20 15:20:28 -070054 /* IO Region 1 */
Lee Leahy77ff0b12015-05-05 15:07:29 -070055 DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
56 0x0000, 0x0d00, 0xffff, 0x0000, 0xf300,,, PI01)
57
Lee Leahy32471722015-04-20 15:20:28 -070058 /* VGA memory (0xa0000-0xbffff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070059 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
60 Cacheable, ReadWrite,
61 0x00000000, 0x000a0000, 0x000bffff, 0x00000000,
62 0x00020000,,, ASEG)
63
Lee Leahy32471722015-04-20 15:20:28 -070064 /* OPROM reserved (0xc0000-0xc3fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070065 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
66 Cacheable, ReadWrite,
67 0x00000000, 0x000c0000, 0x000c3fff, 0x00000000,
68 0x00004000,,, OPR0)
69
Lee Leahy32471722015-04-20 15:20:28 -070070 /* OPROM reserved (0xc4000-0xc7fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070071 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
72 Cacheable, ReadWrite,
73 0x00000000, 0x000c4000, 0x000c7fff, 0x00000000,
74 0x00004000,,, OPR1)
75
Lee Leahy32471722015-04-20 15:20:28 -070076 /* OPROM reserved (0xc8000-0xcbfff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070077 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
78 Cacheable, ReadWrite,
79 0x00000000, 0x000c8000, 0x000cbfff, 0x00000000,
80 0x00004000,,, OPR2)
81
Lee Leahy32471722015-04-20 15:20:28 -070082 /* OPROM reserved (0xcc000-0xcffff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070083 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
84 Cacheable, ReadWrite,
85 0x00000000, 0x000cc000, 0x000cffff, 0x00000000,
86 0x00004000,,, OPR3)
87
Lee Leahy32471722015-04-20 15:20:28 -070088 /* OPROM reserved (0xd0000-0xd3fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070089 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
90 Cacheable, ReadWrite,
91 0x00000000, 0x000d0000, 0x000d3fff, 0x00000000,
92 0x00004000,,, OPR4)
93
Lee Leahy32471722015-04-20 15:20:28 -070094 /* OPROM reserved (0xd4000-0xd7fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070095 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
96 Cacheable, ReadWrite,
97 0x00000000, 0x000d4000, 0x000d7fff, 0x00000000,
98 0x00004000,,, OPR5)
99
Lee Leahy32471722015-04-20 15:20:28 -0700100 /* OPROM reserved (0xd8000-0xdbfff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700101 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
102 Cacheable, ReadWrite,
103 0x00000000, 0x000d8000, 0x000dbfff, 0x00000000,
104 0x00004000,,, OPR6)
105
Lee Leahy32471722015-04-20 15:20:28 -0700106 /* OPROM reserved (0xdc000-0xdffff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700107 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
108 Cacheable, ReadWrite,
109 0x00000000, 0x000dc000, 0x000dffff, 0x00000000,
110 0x00004000,,, OPR7)
111
Lee Leahy32471722015-04-20 15:20:28 -0700112 /* BIOS Extension (0xe0000-0xe3fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700113 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
114 Cacheable, ReadWrite,
115 0x00000000, 0x000e0000, 0x000e3fff, 0x00000000,
116 0x00004000,,, ESG0)
117
Lee Leahy32471722015-04-20 15:20:28 -0700118 /* BIOS Extension (0xe4000-0xe7fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700119 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
120 Cacheable, ReadWrite,
121 0x00000000, 0x000e4000, 0x000e7fff, 0x00000000,
122 0x00004000,,, ESG1)
123
Lee Leahy32471722015-04-20 15:20:28 -0700124 /* BIOS Extension (0xe8000-0xebfff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700125 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
126 Cacheable, ReadWrite,
127 0x00000000, 0x000e8000, 0x000ebfff, 0x00000000,
128 0x00004000,,, ESG2)
129
Lee Leahy32471722015-04-20 15:20:28 -0700130 /* BIOS Extension (0xec000-0xeffff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700131 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
132 Cacheable, ReadWrite,
133 0x00000000, 0x000ec000, 0x000effff, 0x00000000,
134 0x00004000,,, ESG3)
135
Lee Leahy32471722015-04-20 15:20:28 -0700136 /* System BIOS (0xf0000-0xfffff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700137 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
138 Cacheable, ReadWrite,
139 0x00000000, 0x000f0000, 0x000fffff, 0x00000000,
140 0x00010000,,, FSEG)
141
Matt DeVillier687eb302017-06-04 14:39:18 -0500142 /* LPEA Memory Region (0x20000000-0x201FFFFF) */
143 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
144 Cacheable, ReadWrite,
145 0x00000000, 0x20000000, 0x201FFFFF, 0x00000000,
146 0x00200000,,, LMEM)
147
Lee Leahy32471722015-04-20 15:20:28 -0700148 /* PCI Memory Region (Top of memory-0xfeafffff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700149 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
150 Cacheable, ReadWrite,
Lee Leahy32471722015-04-20 15:20:28 -0700151 0x00000000, 0xfea00000, 0xfeafffff, 0x00000000,
152 0x00100000,,, PMEM)
Lee Leahy77ff0b12015-05-05 15:07:29 -0700153
Lee Leahy32471722015-04-20 15:20:28 -0700154 /* TPM Area (0xfed40000-0xfed44fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700155 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
156 Cacheable, ReadWrite,
157 0x00000000, 0xfed40000, 0xfed44fff, 0x00000000,
158 0x00005000,,, TPMR)
159 })
160
Matt DeVillier687eb302017-06-04 14:39:18 -0500161 /* Update LPEA resource area */
162 CreateDWordField (MCRS, LMEM._MIN, LMIN)
163 CreateDWordField (MCRS, LMEM._MAX, LMAX)
164 CreateDWordField (MCRS, LMEM._LEN, LLEN)
165 If (LAnd (LNotEqual (LPFW, Zero), LEqual (LPEN, One)))
166 {
167 Store (LPFW, LMIN)
168 Store (Add (LMIN, 0x001FFFFF), LMAX)
169 Store (0x00200000, LLEN)
170 }
171 Else
172 {
173 Store (Zero, LMIN)
174 Store (Zero, LMAX)
175 Store (Zero, LLEN)
176 }
177
Lee Leahy32471722015-04-20 15:20:28 -0700178 /* Update PCI resource area */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700179 CreateDwordField(MCRS, PMEM._MIN, PMIN)
180 CreateDwordField(MCRS, PMEM._MAX, PMAX)
181 CreateDwordField(MCRS, PMEM._LEN, PLEN)
182
Lee Leahy32471722015-04-20 15:20:28 -0700183 /* TOLM is BMBOUND accessible from IOSF so is saved in NVS */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700184 Store (\TOLM, PMIN)
Matt DeVillier7440cc82017-06-04 14:37:09 -0500185 Store (Subtract(CONFIG_MMCONF_BASE_ADDRESS, 1), PMAX)
Lee Leahy77ff0b12015-05-05 15:07:29 -0700186 Add (Subtract (PMAX, PMIN), 1, PLEN)
187
188 Return (MCRS)
189}
190
191/* Device Resource Consumption */
192Device (PDRC)
193{
194 Name (_HID, EISAID("PNP0C02"))
195 Name (_UID, 1)
196
197 Name (PDRS, ResourceTemplate() {
198 Memory32Fixed(ReadWrite, ABORT_BASE_ADDRESS, ABORT_BASE_SIZE)
199 Memory32Fixed(ReadWrite, MCFG_BASE_ADDRESS, MCFG_BASE_SIZE)
200 Memory32Fixed(ReadWrite, PMC_BASE_ADDRESS, PMC_BASE_SIZE)
201 Memory32Fixed(ReadWrite, ILB_BASE_ADDRESS, ILB_BASE_SIZE)
202 Memory32Fixed(ReadWrite, SPI_BASE_ADDRESS, SPI_BASE_SIZE)
203 Memory32Fixed(ReadWrite, MPHY_BASE_ADDRESS, MPHY_BASE_SIZE)
204 Memory32Fixed(ReadWrite, PUNIT_BASE_ADDRESS, PUNIT_BASE_SIZE)
205 Memory32Fixed(ReadWrite, RCBA_BASE_ADDRESS, RCBA_BASE_SIZE)
206 })
207
Lee Leahy32471722015-04-20 15:20:28 -0700208 /* Current Resource Settings */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700209 Method (_CRS, 0, Serialized)
210 {
211 Return(PDRS)
212 }
213}
214
215Method (_OSC, 4)
216{
217 /* Check for proper GUID */
218 If (LEqual (Arg0, ToUUID("33DB4D5B-1FF7-401C-9657-7441C03DD766")))
219 {
220 /* Let OS control everything */
221 Return (Arg3)
222 }
223 Else
224 {
225 /* Unrecognized UUID */
226 CreateDWordField (Arg3, 0, CDW1)
227 Or (CDW1, 4, CDW1)
228 Return (Arg3)
229 }
230}
231
232/* IOSF MBI Interface for kernel access */
233Device (IOSF)
234{
235 Name (_HID, "INT33BD")
236 Name (_CID, "INT33BD")
237 Name (_UID, 1)
238
239 Name (RBUF, ResourceTemplate ()
240 {
241 /* MCR / MDR / MCRX */
242 Memory32Fixed (ReadWrite, 0, 12, RBAR)
243 })
244
245 Method (_CRS)
246 {
247 CreateDwordField (^RBUF, ^RBAR._BAS, RBAS)
248 Store (Add (MCFG_BASE_ADDRESS, 0xD0), RBAS)
249 Return (^RBUF)
250 }
251}
252
Lee Leahy32471722015-04-20 15:20:28 -0700253/* LPC Bridge 0:1f.0 */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700254#include "lpc.asl"
255
Lee Leahy32471722015-04-20 15:20:28 -0700256/* USB XHCI 0:14.0 */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700257#include "xhci.asl"
258
Lee Leahy32471722015-04-20 15:20:28 -0700259/* IRQ routing for each PCI device */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700260#include "irqroute.asl"
261
Lee Leahy77ff0b12015-05-05 15:07:29 -0700262Scope (\_SB)
263{
Lee Leahy32471722015-04-20 15:20:28 -0700264 /* GPIO Devices */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700265 #include "gpio.asl"
Matt DeVillier6a67ffb2017-06-02 12:30:07 -0500266}
Lee Leahy77ff0b12015-05-05 15:07:29 -0700267
Matt DeVillier6a67ffb2017-06-02 12:30:07 -0500268Scope (\_SB.PCI0)
269{
Lee Leahy32471722015-04-20 15:20:28 -0700270 /* LPSS Devices */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700271 #include "lpss.asl"
272
Lee Leahy32471722015-04-20 15:20:28 -0700273 /* SCC Devices */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700274 #include "scc.asl"
Lee Leahy77ff0b12015-05-05 15:07:29 -0700275}