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