blob: e3997d75f71a2a6e8f89ff957c10a7299d55fa54 [file] [log] [blame]
Angel Ponsc3f58f62020-04-05 15:46:41 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Aaron Durbin9a7d7bc2013-09-07 00:41:48 -05002
Julius Werner18ea2d32014-10-07 16:42:17 -07003#include <soc/iomap.h>
4#include <soc/irq.h>
Aaron Durbin3bde3d72013-11-04 21:45:52 -06005
Aaron Durbin9a7d7bc2013-09-07 00:41:48 -05006Scope(\)
7{
Angel Pons26b49cc2020-07-07 17:17:51 +02008 /* IO-Trap at 0x800. This is the ACPI->SMI communication interface. */
Aaron Durbin9a7d7bc2013-09-07 00:41:48 -05009
10 OperationRegion(IO_T, SystemIO, 0x800, 0x10)
11 Field(IO_T, ByteAcc, NoLock, Preserve)
12 {
13 Offset(0x8),
Angel Pons26b49cc2020-07-07 17:17:51 +020014 TRP0, 8 /* IO-Trap at 0x808 */
Aaron Durbin9a7d7bc2013-09-07 00:41:48 -050015 }
Aaron Durbin3bde3d72013-11-04 21:45:52 -060016
Angel Pons26b49cc2020-07-07 17:17:51 +020017 /* Intel Legacy Block */
Aaron Durbin3bde3d72013-11-04 21:45:52 -060018 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 }
Aaron Durbin9a7d7bc2013-09-07 00:41:48 -050031}
Duncan Laurie7fbe20b2013-11-04 17:00:22 -080032
Angel Pons26b49cc2020-07-07 17:17:51 +020033Name(_HID,EISAID("PNP0A08")) /* PCIe */
34Name(_CID,EISAID("PNP0A03")) /* PCI */
Duncan Laurie053bd072013-11-04 17:19:16 -080035
Duncan Laurie053bd072013-11-04 17:19:16 -080036Name(_BBN, 0)
37
Martin Roth61492332015-11-23 10:38:10 -070038Name (MCRS, ResourceTemplate()
39{
40 // Bus Numbers
41 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
42 0x0000, 0x0000, 0x00ff, 0x0000, 0x0100,,, PB00)
43
44 // IO Region 0
45 DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
46 0x0000, 0x0000, 0x0cf7, 0x0000, 0x0cf8,,, PI00)
47
48 // PCI Config Space
49 Io (Decode16, 0x0cf8, 0x0cf8, 0x0001, 0x0008)
50
51 // IO Region 1
52 DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
53 0x0000, 0x0d00, 0xffff, 0x0000, 0xf300,,, PI01)
54
55 // VGA memory (0xa0000-0xbffff)
56 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
57 Cacheable, ReadWrite,
58 0x00000000, 0x000a0000, 0x000bffff, 0x00000000,
59 0x00020000,,, ASEG)
60
61 // OPROM reserved (0xc0000-0xc3fff)
62 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
63 Cacheable, ReadWrite,
64 0x00000000, 0x000c0000, 0x000c3fff, 0x00000000,
65 0x00004000,,, OPR0)
66
67 // OPROM reserved (0xc4000-0xc7fff)
68 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
69 Cacheable, ReadWrite,
70 0x00000000, 0x000c4000, 0x000c7fff, 0x00000000,
71 0x00004000,,, OPR1)
72
73 // OPROM reserved (0xc8000-0xcbfff)
74 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
75 Cacheable, ReadWrite,
76 0x00000000, 0x000c8000, 0x000cbfff, 0x00000000,
77 0x00004000,,, OPR2)
78
79 // OPROM reserved (0xcc000-0xcffff)
80 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
81 Cacheable, ReadWrite,
82 0x00000000, 0x000cc000, 0x000cffff, 0x00000000,
83 0x00004000,,, OPR3)
84
85 // OPROM reserved (0xd0000-0xd3fff)
86 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
87 Cacheable, ReadWrite,
88 0x00000000, 0x000d0000, 0x000d3fff, 0x00000000,
89 0x00004000,,, OPR4)
90
91 // OPROM reserved (0xd4000-0xd7fff)
92 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
93 Cacheable, ReadWrite,
94 0x00000000, 0x000d4000, 0x000d7fff, 0x00000000,
95 0x00004000,,, OPR5)
96
97 // OPROM reserved (0xd8000-0xdbfff)
98 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
99 Cacheable, ReadWrite,
100 0x00000000, 0x000d8000, 0x000dbfff, 0x00000000,
101 0x00004000,,, OPR6)
102
103 // OPROM reserved (0xdc000-0xdffff)
104 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
105 Cacheable, ReadWrite,
106 0x00000000, 0x000dc000, 0x000dffff, 0x00000000,
107 0x00004000,,, OPR7)
108
109 // BIOS Extension (0xe0000-0xe3fff)
110 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
111 Cacheable, ReadWrite,
112 0x00000000, 0x000e0000, 0x000e3fff, 0x00000000,
113 0x00004000,,, ESG0)
114
115 // BIOS Extension (0xe4000-0xe7fff)
116 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
117 Cacheable, ReadWrite,
118 0x00000000, 0x000e4000, 0x000e7fff, 0x00000000,
119 0x00004000,,, ESG1)
120
121 // BIOS Extension (0xe8000-0xebfff)
122 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
123 Cacheable, ReadWrite,
124 0x00000000, 0x000e8000, 0x000ebfff, 0x00000000,
125 0x00004000,,, ESG2)
126
127 // BIOS Extension (0xec000-0xeffff)
128 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
129 Cacheable, ReadWrite,
130 0x00000000, 0x000ec000, 0x000effff, 0x00000000,
131 0x00004000,,, ESG3)
132
133 // System BIOS (0xf0000-0xfffff)
134 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
135 Cacheable, ReadWrite,
136 0x00000000, 0x000f0000, 0x000fffff, 0x00000000,
137 0x00010000,,, FSEG)
138
139 // PCI Memory Region (Top of memory-CONFIG_MMCONF_BASE_ADDRESS)
140 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
141 Cacheable, ReadWrite,
142 0x00000000, 0x00000000, 0x00000000, 0x00000000,
143 0x00000000,,, PMEM)
144
145 // TPM Area (0xfed40000-0xfed44fff)
146 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
147 Cacheable, ReadWrite,
148 0x00000000, 0xfed40000, 0xfed44fff, 0x00000000,
149 0x00005000,,, TPMR)
150})
151
Duncan Laurie053bd072013-11-04 17:19:16 -0800152Method (_CRS, 0, Serialized)
153{
Duncan Laurie053bd072013-11-04 17:19:16 -0800154
Angel Pons26b49cc2020-07-07 17:17:51 +0200155 /* Update PCI resource area */
Martin Roth61492332015-11-23 10:38:10 -0700156 CreateDwordField(MCRS, ^PMEM._MIN, PMIN)
157 CreateDwordField(MCRS, ^PMEM._MAX, PMAX)
158 CreateDwordField(MCRS, ^PMEM._LEN, PLEN)
Duncan Laurie053bd072013-11-04 17:19:16 -0800159
Angel Pons26b49cc2020-07-07 17:17:51 +0200160 /* TOLM is BMBOUND accessible from IOSF so is saved in NVS */
Duncan Laurie053bd072013-11-04 17:19:16 -0800161 Store (\TOLM, PMIN)
Dave Frodin2eaa0d42015-04-23 06:04:46 -0600162 Store (Subtract(CONFIG_MMCONF_BASE_ADDRESS, 1), PMAX)
Duncan Laurie053bd072013-11-04 17:19:16 -0800163 Add (Subtract (PMAX, PMIN), 1, PLEN)
164
165 Return (MCRS)
166}
167
Duncan Laurie7fbe20b2013-11-04 17:00:22 -0800168/* Device Resource Consumption */
169Device (PDRC)
170{
171 Name (_HID, EISAID("PNP0C02"))
172 Name (_UID, 1)
173
174 Name (PDRS, ResourceTemplate() {
175 Memory32Fixed(ReadWrite, ABORT_BASE_ADDRESS, ABORT_BASE_SIZE)
176 Memory32Fixed(ReadWrite, MCFG_BASE_ADDRESS, MCFG_BASE_SIZE)
177 Memory32Fixed(ReadWrite, PMC_BASE_ADDRESS, PMC_BASE_SIZE)
Duncan Laurie7fbe20b2013-11-04 17:00:22 -0800178 Memory32Fixed(ReadWrite, ILB_BASE_ADDRESS, ILB_BASE_SIZE)
179 Memory32Fixed(ReadWrite, SPI_BASE_ADDRESS, SPI_BASE_SIZE)
180 Memory32Fixed(ReadWrite, MPHY_BASE_ADDRESS, MPHY_BASE_SIZE)
181 Memory32Fixed(ReadWrite, PUNIT_BASE_ADDRESS, PUNIT_BASE_SIZE)
182 Memory32Fixed(ReadWrite, RCBA_BASE_ADDRESS, RCBA_BASE_SIZE)
Duncan Laurie7fbe20b2013-11-04 17:00:22 -0800183 })
184
Angel Pons26b49cc2020-07-07 17:17:51 +0200185 /* Current Resource Settings */
Duncan Laurie7fbe20b2013-11-04 17:00:22 -0800186 Method (_CRS, 0, Serialized)
187 {
188 Return(PDRS)
189 }
190}
Duncan Laurie93966e82013-11-04 17:28:19 -0800191
192Method (_OSC, 4)
193{
194 /* Check for proper GUID */
195 If (LEqual (Arg0, ToUUID("33DB4D5B-1FF7-401C-9657-7441C03DD766")))
196 {
197 /* Let OS control everything */
198 Return (Arg3)
199 }
200 Else
201 {
202 /* Unrecognized UUID */
203 CreateDWordField (Arg3, 0, CDW1)
204 Or (CDW1, 4, CDW1)
205 Return (Arg3)
206 }
207}
Aaron Durbin3bde3d72013-11-04 21:45:52 -0600208
Duncan Laurie2e657962013-12-13 16:43:11 -0800209/* IOSF MBI Interface for kernel access */
210Device (IOSF)
211{
212 Name (_HID, "INT33BD")
213 Name (_CID, "INT33BD")
214 Name (_UID, 1)
215
216 Name (RBUF, ResourceTemplate ()
217 {
218 /* MCR / MDR / MCRX */
219 Memory32Fixed (ReadWrite, 0, 12, RBAR)
220 })
221
222 Method (_CRS)
223 {
224 CreateDwordField (^RBUF, ^RBAR._BAS, RBAS)
225 Store (Add (MCFG_BASE_ADDRESS, 0xD0), RBAS)
226 Return (^RBUF)
227 }
228}
229
Angel Pons26b49cc2020-07-07 17:17:51 +0200230/* LPC Bridge 0:1f.0 */
Aaron Durbin3bde3d72013-11-04 21:45:52 -0600231#include "lpc.asl"
232
Angel Pons26b49cc2020-07-07 17:17:51 +0200233/* USB XHCI 0:14.0 */
Duncan Laurie3f94a742014-01-14 14:59:28 -0800234#include "xhci.asl"
235
Angel Pons26b49cc2020-07-07 17:17:51 +0200236/* IRQ routing for each PCI device */
Aaron Durbin3bde3d72013-11-04 21:45:52 -0600237#include "irqroute.asl"
Duncan Lauriebb0d1ea2013-12-03 10:00:20 -0800238
Ted Kuo6ecaf652014-09-16 15:31:21 +0800239// PCI Express Ports 0:1c.x
240#include "pcie.asl"
241
Duncan Laurie430bf0d2013-12-10 14:37:42 -0800242Scope (\_SB)
243{
Angel Pons26b49cc2020-07-07 17:17:51 +0200244 /* GPIO Devices */
Duncan Laurie430bf0d2013-12-10 14:37:42 -0800245 #include "gpio.asl"
Matt DeVilliere34a7702017-01-09 01:35:48 -0600246}
Duncan Laurie430bf0d2013-12-10 14:37:42 -0800247
Matt DeVilliere34a7702017-01-09 01:35:48 -0600248Scope (\_SB.PCI0)
249{
Angel Pons26b49cc2020-07-07 17:17:51 +0200250 /* LPSS Devices */
Duncan Laurie430bf0d2013-12-10 14:37:42 -0800251 #include "lpss.asl"
252
Angel Pons26b49cc2020-07-07 17:17:51 +0200253 /* SCC Devices */
Duncan Laurie430bf0d2013-12-10 14:37:42 -0800254 #include "scc.asl"
Shawn Nematbakhsh51d787a2014-01-16 17:52:21 -0800255
256 // LPE Device
257 #include "lpe.asl"
Duncan Laurie430bf0d2013-12-10 14:37:42 -0800258}