Angel Pons | ba38f37 | 2020-04-05 15:46:45 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 2 | |
| 3 | #include <soc/iomap.h> |
| 4 | #include <soc/irq.h> |
| 5 | |
| 6 | Scope(\) |
| 7 | { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 8 | /* IO-Trap at 0x800. This is the ACPI->SMI communication interface. */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 9 | |
| 10 | OperationRegion(IO_T, SystemIO, 0x800, 0x10) |
| 11 | Field(IO_T, ByteAcc, NoLock, Preserve) |
| 12 | { |
| 13 | Offset(0x8), |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 14 | TRP0, 8 /* IO-Trap at 0x808 */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 15 | } |
| 16 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 17 | /* Intel Legacy Block */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [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 | } |
| 31 | } |
| 32 | |
Kyösti Mälkki | d06f800 | 2021-01-27 20:25:51 +0200 | [diff] [blame] | 33 | External (\TOLM, IntObj) |
| 34 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 35 | Name(_HID,EISAID("PNP0A08")) /* PCIe */ |
| 36 | Name(_CID,EISAID("PNP0A03")) /* PCI */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 37 | |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 38 | Name(_BBN, 0) |
| 39 | |
| 40 | Method (_CRS, 0, Serialized) |
| 41 | { |
| 42 | Name (MCRS, ResourceTemplate() |
| 43 | { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 44 | /* Bus Numbers */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 45 | WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode, |
| 46 | 0x0000, 0x0000, 0x00ff, 0x0000, 0x0100,,, PB00) |
| 47 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 48 | /* IO Region 0 */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 49 | DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, |
| 50 | 0x0000, 0x0000, 0x0cf7, 0x0000, 0x0cf8,,, PI00) |
| 51 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 52 | /* PCI Config Space */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 53 | Io (Decode16, 0x0cf8, 0x0cf8, 0x0001, 0x0008) |
| 54 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 55 | /* IO Region 1 */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 56 | DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, |
| 57 | 0x0000, 0x0d00, 0xffff, 0x0000, 0xf300,,, PI01) |
| 58 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 59 | /* VGA memory (0xa0000-0xbffff) */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 60 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 61 | Cacheable, ReadWrite, |
| 62 | 0x00000000, 0x000a0000, 0x000bffff, 0x00000000, |
| 63 | 0x00020000,,, ASEG) |
| 64 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 65 | /* OPROM reserved (0xc0000-0xc3fff) */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 66 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 67 | Cacheable, ReadWrite, |
| 68 | 0x00000000, 0x000c0000, 0x000c3fff, 0x00000000, |
| 69 | 0x00004000,,, OPR0) |
| 70 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 71 | /* OPROM reserved (0xc4000-0xc7fff) */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 72 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 73 | Cacheable, ReadWrite, |
| 74 | 0x00000000, 0x000c4000, 0x000c7fff, 0x00000000, |
| 75 | 0x00004000,,, OPR1) |
| 76 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 77 | /* OPROM reserved (0xc8000-0xcbfff) */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 78 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 79 | Cacheable, ReadWrite, |
| 80 | 0x00000000, 0x000c8000, 0x000cbfff, 0x00000000, |
| 81 | 0x00004000,,, OPR2) |
| 82 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 83 | /* OPROM reserved (0xcc000-0xcffff) */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 84 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 85 | Cacheable, ReadWrite, |
| 86 | 0x00000000, 0x000cc000, 0x000cffff, 0x00000000, |
| 87 | 0x00004000,,, OPR3) |
| 88 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 89 | /* OPROM reserved (0xd0000-0xd3fff) */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 90 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 91 | Cacheable, ReadWrite, |
| 92 | 0x00000000, 0x000d0000, 0x000d3fff, 0x00000000, |
| 93 | 0x00004000,,, OPR4) |
| 94 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 95 | /* OPROM reserved (0xd4000-0xd7fff) */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 96 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 97 | Cacheable, ReadWrite, |
| 98 | 0x00000000, 0x000d4000, 0x000d7fff, 0x00000000, |
| 99 | 0x00004000,,, OPR5) |
| 100 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 101 | /* OPROM reserved (0xd8000-0xdbfff) */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 102 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 103 | Cacheable, ReadWrite, |
| 104 | 0x00000000, 0x000d8000, 0x000dbfff, 0x00000000, |
| 105 | 0x00004000,,, OPR6) |
| 106 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 107 | /* OPROM reserved (0xdc000-0xdffff) */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 108 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 109 | Cacheable, ReadWrite, |
| 110 | 0x00000000, 0x000dc000, 0x000dffff, 0x00000000, |
| 111 | 0x00004000,,, OPR7) |
| 112 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 113 | /* BIOS Extension (0xe0000-0xe3fff) */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 114 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 115 | Cacheable, ReadWrite, |
| 116 | 0x00000000, 0x000e0000, 0x000e3fff, 0x00000000, |
| 117 | 0x00004000,,, ESG0) |
| 118 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 119 | /* BIOS Extension (0xe4000-0xe7fff) */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 120 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 121 | Cacheable, ReadWrite, |
| 122 | 0x00000000, 0x000e4000, 0x000e7fff, 0x00000000, |
| 123 | 0x00004000,,, ESG1) |
| 124 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 125 | /* BIOS Extension (0xe8000-0xebfff) */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 126 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 127 | Cacheable, ReadWrite, |
| 128 | 0x00000000, 0x000e8000, 0x000ebfff, 0x00000000, |
| 129 | 0x00004000,,, ESG2) |
| 130 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 131 | /* BIOS Extension (0xec000-0xeffff) */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 132 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 133 | Cacheable, ReadWrite, |
| 134 | 0x00000000, 0x000ec000, 0x000effff, 0x00000000, |
| 135 | 0x00004000,,, ESG3) |
| 136 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 137 | /* System BIOS (0xf0000-0xfffff) */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 138 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 139 | Cacheable, ReadWrite, |
| 140 | 0x00000000, 0x000f0000, 0x000fffff, 0x00000000, |
| 141 | 0x00010000,,, FSEG) |
| 142 | |
Matt DeVillier | 687eb30 | 2017-06-04 14:39:18 -0500 | [diff] [blame] | 143 | /* LPEA Memory Region (0x20000000-0x201FFFFF) */ |
| 144 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 145 | Cacheable, ReadWrite, |
| 146 | 0x00000000, 0x20000000, 0x201FFFFF, 0x00000000, |
| 147 | 0x00200000,,, LMEM) |
| 148 | |
Kyösti Mälkki | 639cc9c | 2021-02-01 13:57:45 +0200 | [diff] [blame] | 149 | /* PCI Memory Region (Top of memory-CONFIG_MMCONF_BASE_ADDRESS) */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 150 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 151 | Cacheable, ReadWrite, |
Kyösti Mälkki | 639cc9c | 2021-02-01 13:57:45 +0200 | [diff] [blame] | 152 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, |
| 153 | 0x00000000,,, PMEM) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 154 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 155 | /* TPM Area (0xfed40000-0xfed44fff) */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 156 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 157 | Cacheable, ReadWrite, |
| 158 | 0x00000000, 0xfed40000, 0xfed44fff, 0x00000000, |
| 159 | 0x00005000,,, TPMR) |
| 160 | }) |
| 161 | |
Matt DeVillier | 687eb30 | 2017-06-04 14:39:18 -0500 | [diff] [blame] | 162 | /* Update LPEA resource area */ |
| 163 | CreateDWordField (MCRS, LMEM._MIN, LMIN) |
| 164 | CreateDWordField (MCRS, LMEM._MAX, LMAX) |
| 165 | CreateDWordField (MCRS, LMEM._LEN, LLEN) |
| 166 | If (LAnd (LNotEqual (LPFW, Zero), LEqual (LPEN, One))) |
| 167 | { |
| 168 | Store (LPFW, LMIN) |
| 169 | Store (Add (LMIN, 0x001FFFFF), LMAX) |
| 170 | Store (0x00200000, LLEN) |
| 171 | } |
| 172 | Else |
| 173 | { |
| 174 | Store (Zero, LMIN) |
| 175 | Store (Zero, LMAX) |
| 176 | Store (Zero, LLEN) |
| 177 | } |
| 178 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 179 | /* Update PCI resource area */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 180 | CreateDwordField(MCRS, PMEM._MIN, PMIN) |
| 181 | CreateDwordField(MCRS, PMEM._MAX, PMAX) |
| 182 | CreateDwordField(MCRS, PMEM._LEN, PLEN) |
| 183 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 184 | /* TOLM is BMBOUND accessible from IOSF so is saved in NVS */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 185 | Store (\TOLM, PMIN) |
Matt DeVillier | 7440cc8 | 2017-06-04 14:37:09 -0500 | [diff] [blame] | 186 | Store (Subtract(CONFIG_MMCONF_BASE_ADDRESS, 1), PMAX) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 187 | Add (Subtract (PMAX, PMIN), 1, PLEN) |
| 188 | |
| 189 | Return (MCRS) |
| 190 | } |
| 191 | |
| 192 | /* Device Resource Consumption */ |
| 193 | Device (PDRC) |
| 194 | { |
| 195 | Name (_HID, EISAID("PNP0C02")) |
| 196 | Name (_UID, 1) |
| 197 | |
| 198 | Name (PDRS, ResourceTemplate() { |
| 199 | Memory32Fixed(ReadWrite, ABORT_BASE_ADDRESS, ABORT_BASE_SIZE) |
Kyösti Mälkki | 6d08544 | 2021-02-14 01:55:18 +0200 | [diff] [blame] | 200 | Memory32Fixed(ReadWrite, CONFIG_MMCONF_BASE_ADDRESS, CONFIG_MMCONF_LENGTH) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 201 | Memory32Fixed(ReadWrite, PMC_BASE_ADDRESS, PMC_BASE_SIZE) |
| 202 | Memory32Fixed(ReadWrite, ILB_BASE_ADDRESS, ILB_BASE_SIZE) |
| 203 | Memory32Fixed(ReadWrite, SPI_BASE_ADDRESS, SPI_BASE_SIZE) |
| 204 | Memory32Fixed(ReadWrite, MPHY_BASE_ADDRESS, MPHY_BASE_SIZE) |
| 205 | Memory32Fixed(ReadWrite, PUNIT_BASE_ADDRESS, PUNIT_BASE_SIZE) |
| 206 | Memory32Fixed(ReadWrite, RCBA_BASE_ADDRESS, RCBA_BASE_SIZE) |
| 207 | }) |
| 208 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 209 | /* Current Resource Settings */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 210 | Method (_CRS, 0, Serialized) |
| 211 | { |
| 212 | Return(PDRS) |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | Method (_OSC, 4) |
| 217 | { |
| 218 | /* Check for proper GUID */ |
| 219 | If (LEqual (Arg0, ToUUID("33DB4D5B-1FF7-401C-9657-7441C03DD766"))) |
| 220 | { |
| 221 | /* Let OS control everything */ |
| 222 | Return (Arg3) |
| 223 | } |
| 224 | Else |
| 225 | { |
| 226 | /* Unrecognized UUID */ |
| 227 | CreateDWordField (Arg3, 0, CDW1) |
| 228 | Or (CDW1, 4, CDW1) |
| 229 | Return (Arg3) |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | /* IOSF MBI Interface for kernel access */ |
| 234 | Device (IOSF) |
| 235 | { |
| 236 | Name (_HID, "INT33BD") |
| 237 | Name (_CID, "INT33BD") |
| 238 | Name (_UID, 1) |
| 239 | |
| 240 | Name (RBUF, ResourceTemplate () |
| 241 | { |
| 242 | /* MCR / MDR / MCRX */ |
| 243 | Memory32Fixed (ReadWrite, 0, 12, RBAR) |
| 244 | }) |
| 245 | |
| 246 | Method (_CRS) |
| 247 | { |
| 248 | CreateDwordField (^RBUF, ^RBAR._BAS, RBAS) |
Kyösti Mälkki | 6d08544 | 2021-02-14 01:55:18 +0200 | [diff] [blame] | 249 | Store (Add (CONFIG_MMCONF_BASE_ADDRESS, 0xD0), RBAS) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 250 | Return (^RBUF) |
| 251 | } |
| 252 | } |
| 253 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 254 | /* LPC Bridge 0:1f.0 */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 255 | #include "lpc.asl" |
| 256 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 257 | /* USB XHCI 0:14.0 */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 258 | #include "xhci.asl" |
| 259 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 260 | /* IRQ routing for each PCI device */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 261 | #include "irqroute.asl" |
| 262 | |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 263 | Scope (\_SB) |
| 264 | { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 265 | /* GPIO Devices */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 266 | #include "gpio.asl" |
Matt DeVillier | 6a67ffb | 2017-06-02 12:30:07 -0500 | [diff] [blame] | 267 | } |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 268 | |
Matt DeVillier | 6a67ffb | 2017-06-02 12:30:07 -0500 | [diff] [blame] | 269 | Scope (\_SB.PCI0) |
| 270 | { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 271 | /* LPSS Devices */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 272 | #include "lpss.asl" |
| 273 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 274 | /* SCC Devices */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 275 | #include "scc.asl" |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 276 | } |
Matt DeVillier | c6589ae | 2020-11-28 13:17:54 -0600 | [diff] [blame] | 277 | |
| 278 | /* Integrated graphics 0:2.0 */ |
| 279 | #include <drivers/intel/gma/acpi/gfx.asl> |