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