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 | { |
| 8 | // IO-Trap at 0x800. This is the ACPI->SMI communication interface. |
| 9 | |
| 10 | OperationRegion(IO_T, SystemIO, 0x800, 0x10) |
| 11 | Field(IO_T, ByteAcc, NoLock, Preserve) |
| 12 | { |
| 13 | Offset(0x8), |
| 14 | TRP0, 8 // IO-Trap at 0x808 |
| 15 | } |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 16 | |
| 17 | // Intel Legacy Block |
| 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 | |
Duncan Laurie | 053bd07 | 2013-11-04 17:19:16 -0800 | [diff] [blame] | 33 | Name(_HID,EISAID("PNP0A08")) // PCIe |
| 34 | Name(_CID,EISAID("PNP0A03")) // PCI |
| 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 | |
| 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 Laurie | 053bd07 | 2013-11-04 17:19:16 -0800 | [diff] [blame] | 152 | Method (_CRS, 0, Serialized) |
| 153 | { |
Duncan Laurie | 053bd07 | 2013-11-04 17:19:16 -0800 | [diff] [blame] | 154 | |
| 155 | // Update PCI resource area |
Martin Roth | 6149233 | 2015-11-23 10:38:10 -0700 | [diff] [blame] | 156 | CreateDwordField(MCRS, ^PMEM._MIN, PMIN) |
| 157 | CreateDwordField(MCRS, ^PMEM._MAX, PMAX) |
| 158 | CreateDwordField(MCRS, ^PMEM._LEN, PLEN) |
Duncan Laurie | 053bd07 | 2013-11-04 17:19:16 -0800 | [diff] [blame] | 159 | |
| 160 | // TOLM is BMBOUND accessible from IOSF so is saved in NVS |
| 161 | Store (\TOLM, PMIN) |
Dave Frodin | 2eaa0d4 | 2015-04-23 06:04:46 -0600 | [diff] [blame] | 162 | Store (Subtract(CONFIG_MMCONF_BASE_ADDRESS, 1), PMAX) |
Duncan Laurie | 053bd07 | 2013-11-04 17:19:16 -0800 | [diff] [blame] | 163 | Add (Subtract (PMAX, PMIN), 1, PLEN) |
| 164 | |
| 165 | Return (MCRS) |
| 166 | } |
| 167 | |
Duncan Laurie | 7fbe20b | 2013-11-04 17:00:22 -0800 | [diff] [blame] | 168 | /* Device Resource Consumption */ |
| 169 | Device (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 Laurie | 7fbe20b | 2013-11-04 17:00:22 -0800 | [diff] [blame] | 178 | 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 Laurie | 7fbe20b | 2013-11-04 17:00:22 -0800 | [diff] [blame] | 183 | }) |
| 184 | |
| 185 | // Current Resource Settings |
| 186 | Method (_CRS, 0, Serialized) |
| 187 | { |
| 188 | Return(PDRS) |
| 189 | } |
| 190 | } |
Duncan Laurie | 93966e8 | 2013-11-04 17:28:19 -0800 | [diff] [blame] | 191 | |
| 192 | Method (_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 Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 208 | |
Duncan Laurie | 2e65796 | 2013-12-13 16:43:11 -0800 | [diff] [blame] | 209 | /* IOSF MBI Interface for kernel access */ |
| 210 | Device (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 | |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 230 | // LPC Bridge 0:1f.0 |
| 231 | #include "lpc.asl" |
| 232 | |
Duncan Laurie | 3f94a74 | 2014-01-14 14:59:28 -0800 | [diff] [blame] | 233 | // USB XHCI 0:14.0 |
| 234 | #include "xhci.asl" |
| 235 | |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 236 | // IRQ routing for each PCI device |
| 237 | #include "irqroute.asl" |
Duncan Laurie | bb0d1ea | 2013-12-03 10:00:20 -0800 | [diff] [blame] | 238 | |
Ted Kuo | 6ecaf65 | 2014-09-16 15:31:21 +0800 | [diff] [blame] | 239 | // PCI Express Ports 0:1c.x |
| 240 | #include "pcie.asl" |
| 241 | |
Duncan Laurie | 430bf0d | 2013-12-10 14:37:42 -0800 | [diff] [blame] | 242 | Scope (\_SB) |
| 243 | { |
| 244 | // GPIO Devices |
| 245 | #include "gpio.asl" |
Matt DeVillier | e34a770 | 2017-01-09 01:35:48 -0600 | [diff] [blame] | 246 | } |
Duncan Laurie | 430bf0d | 2013-12-10 14:37:42 -0800 | [diff] [blame] | 247 | |
Matt DeVillier | e34a770 | 2017-01-09 01:35:48 -0600 | [diff] [blame] | 248 | Scope (\_SB.PCI0) |
| 249 | { |
Duncan Laurie | 430bf0d | 2013-12-10 14:37:42 -0800 | [diff] [blame] | 250 | // LPSS Devices |
| 251 | #include "lpss.asl" |
| 252 | |
| 253 | // SCC Devices |
| 254 | #include "scc.asl" |
Shawn Nematbakhsh | 51d787a | 2014-01-16 17:52:21 -0800 | [diff] [blame] | 255 | |
| 256 | // LPE Device |
| 257 | #include "lpe.asl" |
Duncan Laurie | 430bf0d | 2013-12-10 14:37:42 -0800 | [diff] [blame] | 258 | } |