blob: 61642a59a977502bdf51ee48a194139b222f6035 [file] [log] [blame]
Aaron Durbin9a7d7bc2013-09-07 00:41:48 -05001/*
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.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
19 * MA 02110-1301 USA
20 */
21
Aaron Durbin3bde3d72013-11-04 21:45:52 -060022#include <soc/intel/baytrail/baytrail/iomap.h>
Duncan Laurie430bf0d2013-12-10 14:37:42 -080023#include <soc/intel/baytrail/baytrail/irq.h>
Aaron Durbin3bde3d72013-11-04 21:45:52 -060024
Aaron Durbin9a7d7bc2013-09-07 00:41:48 -050025Scope(\)
26{
27 // IO-Trap at 0x800. This is the ACPI->SMI communication interface.
28
29 OperationRegion(IO_T, SystemIO, 0x800, 0x10)
30 Field(IO_T, ByteAcc, NoLock, Preserve)
31 {
32 Offset(0x8),
33 TRP0, 8 // IO-Trap at 0x808
34 }
Aaron Durbin3bde3d72013-11-04 21:45:52 -060035
36 // Intel Legacy Block
37 OperationRegion(ILBS, SystemMemory, ILB_BASE_ADDRESS, ILB_BASE_SIZE)
38 Field (ILBS, AnyAcc, NoLock, Preserve)
39 {
40 Offset (0x8),
41 PRTA, 8,
42 PRTB, 8,
43 PRTC, 8,
44 PRTD, 8,
45 PRTE, 8,
46 PRTF, 8,
47 PRTG, 8,
48 PRTH, 8,
49 }
Aaron Durbin9a7d7bc2013-09-07 00:41:48 -050050}
Duncan Laurie7fbe20b2013-11-04 17:00:22 -080051
Duncan Laurie053bd072013-11-04 17:19:16 -080052Name(_HID,EISAID("PNP0A08")) // PCIe
53Name(_CID,EISAID("PNP0A03")) // PCI
54
55Name(_ADR, 0)
56Name(_BBN, 0)
57
58Method (_CRS, 0, Serialized)
59{
60 Name (MCRS, ResourceTemplate()
61 {
62 // Bus Numbers
63 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
64 0x0000, 0x0000, 0x00ff, 0x0000, 0x0100,,, PB00)
65
66 // IO Region 0
67 DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
68 0x0000, 0x0000, 0x0cf7, 0x0000, 0x0cf8,,, PI00)
69
70 // PCI Config Space
71 Io (Decode16, 0x0cf8, 0x0cf8, 0x0001, 0x0008)
72
73 // IO Region 1
74 DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
75 0x0000, 0x0d00, 0xffff, 0x0000, 0xf300,,, PI01)
76
77 // VGA memory (0xa0000-0xbffff)
78 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
79 Cacheable, ReadWrite,
80 0x00000000, 0x000a0000, 0x000bffff, 0x00000000,
81 0x00020000,,, ASEG)
82
83 // OPROM reserved (0xc0000-0xc3fff)
84 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
85 Cacheable, ReadWrite,
86 0x00000000, 0x000c0000, 0x000c3fff, 0x00000000,
87 0x00004000,,, OPR0)
88
89 // OPROM reserved (0xc4000-0xc7fff)
90 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
91 Cacheable, ReadWrite,
92 0x00000000, 0x000c4000, 0x000c7fff, 0x00000000,
93 0x00004000,,, OPR1)
94
95 // OPROM reserved (0xc8000-0xcbfff)
96 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
97 Cacheable, ReadWrite,
98 0x00000000, 0x000c8000, 0x000cbfff, 0x00000000,
99 0x00004000,,, OPR2)
100
101 // OPROM reserved (0xcc000-0xcffff)
102 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
103 Cacheable, ReadWrite,
104 0x00000000, 0x000cc000, 0x000cffff, 0x00000000,
105 0x00004000,,, OPR3)
106
107 // OPROM reserved (0xd0000-0xd3fff)
108 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
109 Cacheable, ReadWrite,
110 0x00000000, 0x000d0000, 0x000d3fff, 0x00000000,
111 0x00004000,,, OPR4)
112
113 // OPROM reserved (0xd4000-0xd7fff)
114 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
115 Cacheable, ReadWrite,
116 0x00000000, 0x000d4000, 0x000d7fff, 0x00000000,
117 0x00004000,,, OPR5)
118
119 // OPROM reserved (0xd8000-0xdbfff)
120 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
121 Cacheable, ReadWrite,
122 0x00000000, 0x000d8000, 0x000dbfff, 0x00000000,
123 0x00004000,,, OPR6)
124
125 // OPROM reserved (0xdc000-0xdffff)
126 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
127 Cacheable, ReadWrite,
128 0x00000000, 0x000dc000, 0x000dffff, 0x00000000,
129 0x00004000,,, OPR7)
130
131 // BIOS Extension (0xe0000-0xe3fff)
132 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
133 Cacheable, ReadWrite,
134 0x00000000, 0x000e0000, 0x000e3fff, 0x00000000,
135 0x00004000,,, ESG0)
136
137 // BIOS Extension (0xe4000-0xe7fff)
138 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
139 Cacheable, ReadWrite,
140 0x00000000, 0x000e4000, 0x000e7fff, 0x00000000,
141 0x00004000,,, ESG1)
142
143 // BIOS Extension (0xe8000-0xebfff)
144 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
145 Cacheable, ReadWrite,
146 0x00000000, 0x000e8000, 0x000ebfff, 0x00000000,
147 0x00004000,,, ESG2)
148
149 // BIOS Extension (0xec000-0xeffff)
150 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
151 Cacheable, ReadWrite,
152 0x00000000, 0x000ec000, 0x000effff, 0x00000000,
153 0x00004000,,, ESG3)
154
155 // System BIOS (0xf0000-0xfffff)
156 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
157 Cacheable, ReadWrite,
158 0x00000000, 0x000f0000, 0x000fffff, 0x00000000,
159 0x00010000,,, FSEG)
160
161 // PCI Memory Region (Top of memory-0xfeafffff)
162 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
163 Cacheable, ReadWrite,
Duncan Laurieb50566e2013-12-04 18:34:11 -0800164 0x00000000, 0xfea00000, 0xfeafffff, 0x00000000,
165 0x00100000,,, PMEM)
Duncan Laurie053bd072013-11-04 17:19:16 -0800166
167 // TPM Area (0xfed40000-0xfed44fff)
168 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
169 Cacheable, ReadWrite,
170 0x00000000, 0xfed40000, 0xfed44fff, 0x00000000,
171 0x00005000,,, TPMR)
172 })
173
174 // Update PCI resource area
175 CreateDwordField(MCRS, PMEM._MIN, PMIN)
176 CreateDwordField(MCRS, PMEM._MAX, PMAX)
177 CreateDwordField(MCRS, PMEM._LEN, PLEN)
178
179 // TOLM is BMBOUND accessible from IOSF so is saved in NVS
180 Store (\TOLM, PMIN)
181 Add (Subtract (PMAX, PMIN), 1, PLEN)
182
183 Return (MCRS)
184}
185
Duncan Laurie7fbe20b2013-11-04 17:00:22 -0800186/* Device Resource Consumption */
187Device (PDRC)
188{
189 Name (_HID, EISAID("PNP0C02"))
190 Name (_UID, 1)
191
192 Name (PDRS, ResourceTemplate() {
193 Memory32Fixed(ReadWrite, ABORT_BASE_ADDRESS, ABORT_BASE_SIZE)
194 Memory32Fixed(ReadWrite, MCFG_BASE_ADDRESS, MCFG_BASE_SIZE)
195 Memory32Fixed(ReadWrite, PMC_BASE_ADDRESS, PMC_BASE_SIZE)
Duncan Laurie7fbe20b2013-11-04 17:00:22 -0800196 Memory32Fixed(ReadWrite, ILB_BASE_ADDRESS, ILB_BASE_SIZE)
197 Memory32Fixed(ReadWrite, SPI_BASE_ADDRESS, SPI_BASE_SIZE)
198 Memory32Fixed(ReadWrite, MPHY_BASE_ADDRESS, MPHY_BASE_SIZE)
199 Memory32Fixed(ReadWrite, PUNIT_BASE_ADDRESS, PUNIT_BASE_SIZE)
200 Memory32Fixed(ReadWrite, RCBA_BASE_ADDRESS, RCBA_BASE_SIZE)
201#if CONFIG_CHROMEOS_RAMOOPS
202 Memory32Fixed(ReadWrite, CONFIG_CHROMEOS_RAMOOPS_RAM_START,
203 CONFIG_CHROMEOS_RAMOOPS_RAM_SIZE)
204#endif
205 })
206
207 // Current Resource Settings
208 Method (_CRS, 0, Serialized)
209 {
210 Return(PDRS)
211 }
212}
Duncan Laurie93966e82013-11-04 17:28:19 -0800213
214Method (_OSC, 4)
215{
216 /* Check for proper GUID */
217 If (LEqual (Arg0, ToUUID("33DB4D5B-1FF7-401C-9657-7441C03DD766")))
218 {
219 /* Let OS control everything */
220 Return (Arg3)
221 }
222 Else
223 {
224 /* Unrecognized UUID */
225 CreateDWordField (Arg3, 0, CDW1)
226 Or (CDW1, 4, CDW1)
227 Return (Arg3)
228 }
229}
Aaron Durbin3bde3d72013-11-04 21:45:52 -0600230
Duncan Laurie2e657962013-12-13 16:43:11 -0800231/* IOSF MBI Interface for kernel access */
232Device (IOSF)
233{
234 Name (_HID, "INT33BD")
235 Name (_CID, "INT33BD")
236 Name (_UID, 1)
237
238 Name (RBUF, ResourceTemplate ()
239 {
240 /* MCR / MDR / MCRX */
241 Memory32Fixed (ReadWrite, 0, 12, RBAR)
242 })
243
244 Method (_CRS)
245 {
246 CreateDwordField (^RBUF, ^RBAR._BAS, RBAS)
247 Store (Add (MCFG_BASE_ADDRESS, 0xD0), RBAS)
248 Return (^RBUF)
249 }
250}
251
Aaron Durbin3bde3d72013-11-04 21:45:52 -0600252// LPC Bridge 0:1f.0
253#include "lpc.asl"
254
Duncan Laurie3f94a742014-01-14 14:59:28 -0800255// USB XHCI 0:14.0
256#include "xhci.asl"
257
Aaron Durbin3bde3d72013-11-04 21:45:52 -0600258// IRQ routing for each PCI device
259#include "irqroute.asl"
Duncan Lauriebb0d1ea2013-12-03 10:00:20 -0800260
Duncan Laurie430bf0d2013-12-10 14:37:42 -0800261Scope (\_SB)
262{
263 // GPIO Devices
264 #include "gpio.asl"
265
266 // LPSS Devices
267 #include "lpss.asl"
268
269 // SCC Devices
270 #include "scc.asl"
271}