blob: f7e316812674a9c67b9235199f47dd67e9363563 [file] [log] [blame]
Lee Leahy77ff0b12015-05-05 15:07:29 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2013 Google Inc.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; version 2 of
9 * the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
Lee Leahy77ff0b12015-05-05 15:07:29 -070015 */
16
17#include <soc/iomap.h>
18#include <soc/irq.h>
19
20Scope(\)
21{
Lee Leahy32471722015-04-20 15:20:28 -070022 /* IO-Trap at 0x800. This is the ACPI->SMI communication interface. */
Lee Leahy77ff0b12015-05-05 15:07:29 -070023
24 OperationRegion(IO_T, SystemIO, 0x800, 0x10)
25 Field(IO_T, ByteAcc, NoLock, Preserve)
26 {
27 Offset(0x8),
Lee Leahy32471722015-04-20 15:20:28 -070028 TRP0, 8 /* IO-Trap at 0x808 */
Lee Leahy77ff0b12015-05-05 15:07:29 -070029 }
30
Lee Leahy32471722015-04-20 15:20:28 -070031 /* Intel Legacy Block */
Lee Leahy77ff0b12015-05-05 15:07:29 -070032 OperationRegion(ILBS, SystemMemory, ILB_BASE_ADDRESS, ILB_BASE_SIZE)
33 Field (ILBS, AnyAcc, NoLock, Preserve)
34 {
35 Offset (0x8),
36 PRTA, 8,
37 PRTB, 8,
38 PRTC, 8,
39 PRTD, 8,
40 PRTE, 8,
41 PRTF, 8,
42 PRTG, 8,
43 PRTH, 8,
44 }
45}
46
Lee Leahy32471722015-04-20 15:20:28 -070047Name(_HID,EISAID("PNP0A08")) /* PCIe */
48Name(_CID,EISAID("PNP0A03")) /* PCI */
Lee Leahy77ff0b12015-05-05 15:07:29 -070049
50Name(_ADR, 0)
51Name(_BBN, 0)
52
53Method (_CRS, 0, Serialized)
54{
55 Name (MCRS, ResourceTemplate()
56 {
Lee Leahy32471722015-04-20 15:20:28 -070057 /* Bus Numbers */
Lee Leahy77ff0b12015-05-05 15:07:29 -070058 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
59 0x0000, 0x0000, 0x00ff, 0x0000, 0x0100,,, PB00)
60
Lee Leahy32471722015-04-20 15:20:28 -070061 /* IO Region 0 */
Lee Leahy77ff0b12015-05-05 15:07:29 -070062 DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
63 0x0000, 0x0000, 0x0cf7, 0x0000, 0x0cf8,,, PI00)
64
Lee Leahy32471722015-04-20 15:20:28 -070065 /* PCI Config Space */
Lee Leahy77ff0b12015-05-05 15:07:29 -070066 Io (Decode16, 0x0cf8, 0x0cf8, 0x0001, 0x0008)
67
Lee Leahy32471722015-04-20 15:20:28 -070068 /* IO Region 1 */
Lee Leahy77ff0b12015-05-05 15:07:29 -070069 DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
70 0x0000, 0x0d00, 0xffff, 0x0000, 0xf300,,, PI01)
71
Lee Leahy32471722015-04-20 15:20:28 -070072 /* VGA memory (0xa0000-0xbffff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070073 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
74 Cacheable, ReadWrite,
75 0x00000000, 0x000a0000, 0x000bffff, 0x00000000,
76 0x00020000,,, ASEG)
77
Lee Leahy32471722015-04-20 15:20:28 -070078 /* OPROM reserved (0xc0000-0xc3fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070079 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
80 Cacheable, ReadWrite,
81 0x00000000, 0x000c0000, 0x000c3fff, 0x00000000,
82 0x00004000,,, OPR0)
83
Lee Leahy32471722015-04-20 15:20:28 -070084 /* OPROM reserved (0xc4000-0xc7fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070085 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
86 Cacheable, ReadWrite,
87 0x00000000, 0x000c4000, 0x000c7fff, 0x00000000,
88 0x00004000,,, OPR1)
89
Lee Leahy32471722015-04-20 15:20:28 -070090 /* OPROM reserved (0xc8000-0xcbfff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070091 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
92 Cacheable, ReadWrite,
93 0x00000000, 0x000c8000, 0x000cbfff, 0x00000000,
94 0x00004000,,, OPR2)
95
Lee Leahy32471722015-04-20 15:20:28 -070096 /* OPROM reserved (0xcc000-0xcffff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -070097 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
98 Cacheable, ReadWrite,
99 0x00000000, 0x000cc000, 0x000cffff, 0x00000000,
100 0x00004000,,, OPR3)
101
Lee Leahy32471722015-04-20 15:20:28 -0700102 /* OPROM reserved (0xd0000-0xd3fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700103 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
104 Cacheable, ReadWrite,
105 0x00000000, 0x000d0000, 0x000d3fff, 0x00000000,
106 0x00004000,,, OPR4)
107
Lee Leahy32471722015-04-20 15:20:28 -0700108 /* OPROM reserved (0xd4000-0xd7fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700109 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
110 Cacheable, ReadWrite,
111 0x00000000, 0x000d4000, 0x000d7fff, 0x00000000,
112 0x00004000,,, OPR5)
113
Lee Leahy32471722015-04-20 15:20:28 -0700114 /* OPROM reserved (0xd8000-0xdbfff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700115 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
116 Cacheable, ReadWrite,
117 0x00000000, 0x000d8000, 0x000dbfff, 0x00000000,
118 0x00004000,,, OPR6)
119
Lee Leahy32471722015-04-20 15:20:28 -0700120 /* OPROM reserved (0xdc000-0xdffff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700121 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
122 Cacheable, ReadWrite,
123 0x00000000, 0x000dc000, 0x000dffff, 0x00000000,
124 0x00004000,,, OPR7)
125
Lee Leahy32471722015-04-20 15:20:28 -0700126 /* BIOS Extension (0xe0000-0xe3fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700127 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
128 Cacheable, ReadWrite,
129 0x00000000, 0x000e0000, 0x000e3fff, 0x00000000,
130 0x00004000,,, ESG0)
131
Lee Leahy32471722015-04-20 15:20:28 -0700132 /* BIOS Extension (0xe4000-0xe7fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700133 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
134 Cacheable, ReadWrite,
135 0x00000000, 0x000e4000, 0x000e7fff, 0x00000000,
136 0x00004000,,, ESG1)
137
Lee Leahy32471722015-04-20 15:20:28 -0700138 /* BIOS Extension (0xe8000-0xebfff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700139 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
140 Cacheable, ReadWrite,
141 0x00000000, 0x000e8000, 0x000ebfff, 0x00000000,
142 0x00004000,,, ESG2)
143
Lee Leahy32471722015-04-20 15:20:28 -0700144 /* BIOS Extension (0xec000-0xeffff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700145 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
146 Cacheable, ReadWrite,
147 0x00000000, 0x000ec000, 0x000effff, 0x00000000,
148 0x00004000,,, ESG3)
149
Lee Leahy32471722015-04-20 15:20:28 -0700150 /* System BIOS (0xf0000-0xfffff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700151 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
152 Cacheable, ReadWrite,
153 0x00000000, 0x000f0000, 0x000fffff, 0x00000000,
154 0x00010000,,, FSEG)
155
Matt DeVillier687eb302017-06-04 14:39:18 -0500156 /* LPEA Memory Region (0x20000000-0x201FFFFF) */
157 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
158 Cacheable, ReadWrite,
159 0x00000000, 0x20000000, 0x201FFFFF, 0x00000000,
160 0x00200000,,, LMEM)
161
Lee Leahy32471722015-04-20 15:20:28 -0700162 /* PCI Memory Region (Top of memory-0xfeafffff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700163 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
164 Cacheable, ReadWrite,
Lee Leahy32471722015-04-20 15:20:28 -0700165 0x00000000, 0xfea00000, 0xfeafffff, 0x00000000,
166 0x00100000,,, PMEM)
Lee Leahy77ff0b12015-05-05 15:07:29 -0700167
Lee Leahy32471722015-04-20 15:20:28 -0700168 /* TPM Area (0xfed40000-0xfed44fff) */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700169 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
170 Cacheable, ReadWrite,
171 0x00000000, 0xfed40000, 0xfed44fff, 0x00000000,
172 0x00005000,,, TPMR)
173 })
174
Matt DeVillier687eb302017-06-04 14:39:18 -0500175 /* Update LPEA resource area */
176 CreateDWordField (MCRS, LMEM._MIN, LMIN)
177 CreateDWordField (MCRS, LMEM._MAX, LMAX)
178 CreateDWordField (MCRS, LMEM._LEN, LLEN)
179 If (LAnd (LNotEqual (LPFW, Zero), LEqual (LPEN, One)))
180 {
181 Store (LPFW, LMIN)
182 Store (Add (LMIN, 0x001FFFFF), LMAX)
183 Store (0x00200000, LLEN)
184 }
185 Else
186 {
187 Store (Zero, LMIN)
188 Store (Zero, LMAX)
189 Store (Zero, LLEN)
190 }
191
Lee Leahy32471722015-04-20 15:20:28 -0700192 /* Update PCI resource area */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700193 CreateDwordField(MCRS, PMEM._MIN, PMIN)
194 CreateDwordField(MCRS, PMEM._MAX, PMAX)
195 CreateDwordField(MCRS, PMEM._LEN, PLEN)
196
Lee Leahy32471722015-04-20 15:20:28 -0700197 /* TOLM is BMBOUND accessible from IOSF so is saved in NVS */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700198 Store (\TOLM, PMIN)
Matt DeVillier7440cc82017-06-04 14:37:09 -0500199 Store (Subtract(CONFIG_MMCONF_BASE_ADDRESS, 1), PMAX)
Lee Leahy77ff0b12015-05-05 15:07:29 -0700200 Add (Subtract (PMAX, PMIN), 1, PLEN)
201
202 Return (MCRS)
203}
204
205/* Device Resource Consumption */
206Device (PDRC)
207{
208 Name (_HID, EISAID("PNP0C02"))
209 Name (_UID, 1)
210
211 Name (PDRS, ResourceTemplate() {
212 Memory32Fixed(ReadWrite, ABORT_BASE_ADDRESS, ABORT_BASE_SIZE)
213 Memory32Fixed(ReadWrite, MCFG_BASE_ADDRESS, MCFG_BASE_SIZE)
214 Memory32Fixed(ReadWrite, PMC_BASE_ADDRESS, PMC_BASE_SIZE)
215 Memory32Fixed(ReadWrite, ILB_BASE_ADDRESS, ILB_BASE_SIZE)
216 Memory32Fixed(ReadWrite, SPI_BASE_ADDRESS, SPI_BASE_SIZE)
217 Memory32Fixed(ReadWrite, MPHY_BASE_ADDRESS, MPHY_BASE_SIZE)
218 Memory32Fixed(ReadWrite, PUNIT_BASE_ADDRESS, PUNIT_BASE_SIZE)
219 Memory32Fixed(ReadWrite, RCBA_BASE_ADDRESS, RCBA_BASE_SIZE)
220 })
221
Lee Leahy32471722015-04-20 15:20:28 -0700222 /* Current Resource Settings */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700223 Method (_CRS, 0, Serialized)
224 {
225 Return(PDRS)
226 }
227}
228
229Method (_OSC, 4)
230{
231 /* Check for proper GUID */
232 If (LEqual (Arg0, ToUUID("33DB4D5B-1FF7-401C-9657-7441C03DD766")))
233 {
234 /* Let OS control everything */
235 Return (Arg3)
236 }
237 Else
238 {
239 /* Unrecognized UUID */
240 CreateDWordField (Arg3, 0, CDW1)
241 Or (CDW1, 4, CDW1)
242 Return (Arg3)
243 }
244}
245
246/* IOSF MBI Interface for kernel access */
247Device (IOSF)
248{
249 Name (_HID, "INT33BD")
250 Name (_CID, "INT33BD")
251 Name (_UID, 1)
252
253 Name (RBUF, ResourceTemplate ()
254 {
255 /* MCR / MDR / MCRX */
256 Memory32Fixed (ReadWrite, 0, 12, RBAR)
257 })
258
259 Method (_CRS)
260 {
261 CreateDwordField (^RBUF, ^RBAR._BAS, RBAS)
262 Store (Add (MCFG_BASE_ADDRESS, 0xD0), RBAS)
263 Return (^RBUF)
264 }
265}
266
Lee Leahy32471722015-04-20 15:20:28 -0700267/* LPC Bridge 0:1f.0 */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700268#include "lpc.asl"
269
Lee Leahy32471722015-04-20 15:20:28 -0700270/* USB XHCI 0:14.0 */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700271#include "xhci.asl"
272
Lee Leahy32471722015-04-20 15:20:28 -0700273/* IRQ routing for each PCI device */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700274#include "irqroute.asl"
275
Lee Leahy77ff0b12015-05-05 15:07:29 -0700276Scope (\_SB)
277{
Lee Leahy32471722015-04-20 15:20:28 -0700278 /* GPIO Devices */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700279 #include "gpio.asl"
Matt DeVillier6a67ffb2017-06-02 12:30:07 -0500280}
Lee Leahy77ff0b12015-05-05 15:07:29 -0700281
Matt DeVillier6a67ffb2017-06-02 12:30:07 -0500282Scope (\_SB.PCI0)
283{
Lee Leahy32471722015-04-20 15:20:28 -0700284 /* LPSS Devices */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700285 #include "lpss.asl"
286
Lee Leahy32471722015-04-20 15:20:28 -0700287 /* SCC Devices */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700288 #include "scc.asl"
289
Lee Leahy32471722015-04-20 15:20:28 -0700290 /* LPE Device */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700291 #include "lpe.asl"
292}