Angel Pons | c3f58f6 | 2020-04-05 15:46:41 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Aaron Durbin | 9a7d7bc | 2013-09-07 00:41:48 -0500 | [diff] [blame] | 2 | |
Julius Werner | 18ea2d3 | 2014-10-07 16:42:17 -0700 | [diff] [blame] | 3 | #include <soc/iomap.h> |
| 4 | #include <soc/irq.h> |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 5 | |
Aaron Durbin | 9a7d7bc | 2013-09-07 00:41:48 -0500 | [diff] [blame] | 6 | Scope(\) |
| 7 | { |
Angel Pons | 26b49cc | 2020-07-07 17:17:51 +0200 | [diff] [blame] | 8 | /* IO-Trap at 0x800. This is the ACPI->SMI communication interface. */ |
Aaron Durbin | 9a7d7bc | 2013-09-07 00:41:48 -0500 | [diff] [blame] | 9 | |
| 10 | OperationRegion(IO_T, SystemIO, 0x800, 0x10) |
| 11 | Field(IO_T, ByteAcc, NoLock, Preserve) |
| 12 | { |
| 13 | Offset(0x8), |
Angel Pons | 26b49cc | 2020-07-07 17:17:51 +0200 | [diff] [blame] | 14 | TRP0, 8 /* IO-Trap at 0x808 */ |
Aaron Durbin | 9a7d7bc | 2013-09-07 00:41:48 -0500 | [diff] [blame] | 15 | } |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 16 | |
Angel Pons | 26b49cc | 2020-07-07 17:17:51 +0200 | [diff] [blame] | 17 | /* Intel Legacy Block */ |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 18 | 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 Durbin | 9a7d7bc | 2013-09-07 00:41:48 -0500 | [diff] [blame] | 31 | } |
Duncan Laurie | 7fbe20b | 2013-11-04 17:00:22 -0800 | [diff] [blame] | 32 | |
Angel Pons | 26b49cc | 2020-07-07 17:17:51 +0200 | [diff] [blame] | 33 | Name(_HID,EISAID("PNP0A08")) /* PCIe */ |
| 34 | Name(_CID,EISAID("PNP0A03")) /* PCI */ |
Duncan Laurie | 053bd07 | 2013-11-04 17:19:16 -0800 | [diff] [blame] | 35 | |
Duncan Laurie | 053bd07 | 2013-11-04 17:19:16 -0800 | [diff] [blame] | 36 | Name(_BBN, 0) |
| 37 | |
Martin Roth | 6149233 | 2015-11-23 10:38:10 -0700 | [diff] [blame] | 38 | Name (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 | |
Matt DeVillier | 6a7b707 | 2020-12-18 19:05:09 -0600 | [diff] [blame^] | 139 | // LPEA Memory Region (0x20000000-0x201FFFFF) |
Martin Roth | 6149233 | 2015-11-23 10:38:10 -0700 | [diff] [blame] | 140 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 141 | Cacheable, ReadWrite, |
| 142 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, |
Matt DeVillier | 6a7b707 | 2020-12-18 19:05:09 -0600 | [diff] [blame^] | 143 | 0x00000000,,, LMEM) |
| 144 | |
| 145 | // PCI Memory Region (Top of memory-CONFIG_MMCONF_BASE_ADDRESS) |
| 146 | DwordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 147 | Cacheable, ReadWrite, |
| 148 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, |
| 149 | 0x00000000,,, PMEM) |
Martin Roth | 6149233 | 2015-11-23 10:38:10 -0700 | [diff] [blame] | 150 | |
| 151 | // TPM Area (0xfed40000-0xfed44fff) |
| 152 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 153 | Cacheable, ReadWrite, |
| 154 | 0x00000000, 0xfed40000, 0xfed44fff, 0x00000000, |
| 155 | 0x00005000,,, TPMR) |
| 156 | }) |
| 157 | |
Duncan Laurie | 053bd07 | 2013-11-04 17:19:16 -0800 | [diff] [blame] | 158 | Method (_CRS, 0, Serialized) |
| 159 | { |
Duncan Laurie | 053bd07 | 2013-11-04 17:19:16 -0800 | [diff] [blame] | 160 | |
Matt DeVillier | 6a7b707 | 2020-12-18 19:05:09 -0600 | [diff] [blame^] | 161 | /* 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 (0x00100000, LLEN) |
| 169 | Subtract (Add (LMIN, LLEN), One, LMAX) |
| 170 | } |
| 171 | Else |
| 172 | { |
| 173 | Store (Zero, LMIN) |
| 174 | Store (Zero, LMAX) |
| 175 | Store (Zero, LLEN) |
| 176 | } |
| 177 | |
Angel Pons | 26b49cc | 2020-07-07 17:17:51 +0200 | [diff] [blame] | 178 | /* Update PCI resource area */ |
Matt DeVillier | 6a7b707 | 2020-12-18 19:05:09 -0600 | [diff] [blame^] | 179 | CreateDWordField (MCRS, ^PMEM._MIN, PMIN) |
| 180 | CreateDWordField (MCRS, ^PMEM._MAX, PMAX) |
| 181 | CreateDWordField (MCRS, ^PMEM._LEN, PLEN) |
Duncan Laurie | 053bd07 | 2013-11-04 17:19:16 -0800 | [diff] [blame] | 182 | |
Angel Pons | 26b49cc | 2020-07-07 17:17:51 +0200 | [diff] [blame] | 183 | /* TOLM is BMBOUND accessible from IOSF so is saved in NVS */ |
Duncan Laurie | 053bd07 | 2013-11-04 17:19:16 -0800 | [diff] [blame] | 184 | Store (\TOLM, PMIN) |
Dave Frodin | 2eaa0d4 | 2015-04-23 06:04:46 -0600 | [diff] [blame] | 185 | Store (Subtract(CONFIG_MMCONF_BASE_ADDRESS, 1), PMAX) |
Duncan Laurie | 053bd07 | 2013-11-04 17:19:16 -0800 | [diff] [blame] | 186 | Add (Subtract (PMAX, PMIN), 1, PLEN) |
| 187 | |
| 188 | Return (MCRS) |
| 189 | } |
| 190 | |
Duncan Laurie | 7fbe20b | 2013-11-04 17:00:22 -0800 | [diff] [blame] | 191 | /* Device Resource Consumption */ |
| 192 | Device (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) |
Duncan Laurie | 7fbe20b | 2013-11-04 17:00:22 -0800 | [diff] [blame] | 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) |
Duncan Laurie | 7fbe20b | 2013-11-04 17:00:22 -0800 | [diff] [blame] | 206 | }) |
| 207 | |
Angel Pons | 26b49cc | 2020-07-07 17:17:51 +0200 | [diff] [blame] | 208 | /* Current Resource Settings */ |
Duncan Laurie | 7fbe20b | 2013-11-04 17:00:22 -0800 | [diff] [blame] | 209 | Method (_CRS, 0, Serialized) |
| 210 | { |
| 211 | Return(PDRS) |
| 212 | } |
| 213 | } |
Duncan Laurie | 93966e8 | 2013-11-04 17:28:19 -0800 | [diff] [blame] | 214 | |
| 215 | Method (_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 | } |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 231 | |
Duncan Laurie | 2e65796 | 2013-12-13 16:43:11 -0800 | [diff] [blame] | 232 | /* IOSF MBI Interface for kernel access */ |
| 233 | Device (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 | |
Angel Pons | 26b49cc | 2020-07-07 17:17:51 +0200 | [diff] [blame] | 253 | /* LPC Bridge 0:1f.0 */ |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 254 | #include "lpc.asl" |
| 255 | |
Angel Pons | 26b49cc | 2020-07-07 17:17:51 +0200 | [diff] [blame] | 256 | /* USB XHCI 0:14.0 */ |
Duncan Laurie | 3f94a74 | 2014-01-14 14:59:28 -0800 | [diff] [blame] | 257 | #include "xhci.asl" |
| 258 | |
Angel Pons | 26b49cc | 2020-07-07 17:17:51 +0200 | [diff] [blame] | 259 | /* IRQ routing for each PCI device */ |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 260 | #include "irqroute.asl" |
Duncan Laurie | bb0d1ea | 2013-12-03 10:00:20 -0800 | [diff] [blame] | 261 | |
Ted Kuo | 6ecaf65 | 2014-09-16 15:31:21 +0800 | [diff] [blame] | 262 | // PCI Express Ports 0:1c.x |
| 263 | #include "pcie.asl" |
| 264 | |
Duncan Laurie | 430bf0d | 2013-12-10 14:37:42 -0800 | [diff] [blame] | 265 | Scope (\_SB) |
| 266 | { |
Angel Pons | 26b49cc | 2020-07-07 17:17:51 +0200 | [diff] [blame] | 267 | /* GPIO Devices */ |
Duncan Laurie | 430bf0d | 2013-12-10 14:37:42 -0800 | [diff] [blame] | 268 | #include "gpio.asl" |
Matt DeVillier | e34a770 | 2017-01-09 01:35:48 -0600 | [diff] [blame] | 269 | } |
Duncan Laurie | 430bf0d | 2013-12-10 14:37:42 -0800 | [diff] [blame] | 270 | |
Matt DeVillier | e34a770 | 2017-01-09 01:35:48 -0600 | [diff] [blame] | 271 | Scope (\_SB.PCI0) |
| 272 | { |
Angel Pons | 26b49cc | 2020-07-07 17:17:51 +0200 | [diff] [blame] | 273 | /* LPSS Devices */ |
Duncan Laurie | 430bf0d | 2013-12-10 14:37:42 -0800 | [diff] [blame] | 274 | #include "lpss.asl" |
| 275 | |
Angel Pons | 26b49cc | 2020-07-07 17:17:51 +0200 | [diff] [blame] | 276 | /* SCC Devices */ |
Duncan Laurie | 430bf0d | 2013-12-10 14:37:42 -0800 | [diff] [blame] | 277 | #include "scc.asl" |
Shawn Nematbakhsh | 51d787a | 2014-01-16 17:52:21 -0800 | [diff] [blame] | 278 | |
| 279 | // LPE Device |
| 280 | #include "lpe.asl" |
Duncan Laurie | 430bf0d | 2013-12-10 14:37:42 -0800 | [diff] [blame] | 281 | } |
Matt DeVillier | c6589ae | 2020-11-28 13:17:54 -0600 | [diff] [blame] | 282 | |
| 283 | /* Integrated graphics 0:2.0 */ |
| 284 | #include <drivers/intel/gma/acpi/gfx.asl> |