Aaron Durbin | 9a7d7bc | 2013-09-07 00:41:48 -0500 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2013 Google Inc. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License as |
| 8 | * published by the Free Software Foundation; version 2 of |
| 9 | * the License. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, |
| 19 | * MA 02110-1301 USA |
| 20 | */ |
| 21 | |
Julius Werner | 18ea2d3 | 2014-10-07 16:42:17 -0700 | [diff] [blame] | 22 | #include <soc/iomap.h> |
| 23 | #include <soc/irq.h> |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 24 | |
Aaron Durbin | 9a7d7bc | 2013-09-07 00:41:48 -0500 | [diff] [blame] | 25 | Scope(\) |
| 26 | { |
| 27 | // IO-Trap at 0x800. This is the ACPI->SMI communication interface. |
| 28 | |
| 29 | OperationRegion(IO_T, SystemIO, 0x800, 0x10) |
| 30 | Field(IO_T, ByteAcc, NoLock, Preserve) |
| 31 | { |
| 32 | Offset(0x8), |
| 33 | TRP0, 8 // IO-Trap at 0x808 |
| 34 | } |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 35 | |
| 36 | // Intel Legacy Block |
| 37 | OperationRegion(ILBS, SystemMemory, ILB_BASE_ADDRESS, ILB_BASE_SIZE) |
| 38 | Field (ILBS, AnyAcc, NoLock, Preserve) |
| 39 | { |
| 40 | Offset (0x8), |
| 41 | PRTA, 8, |
| 42 | PRTB, 8, |
| 43 | PRTC, 8, |
| 44 | PRTD, 8, |
| 45 | PRTE, 8, |
| 46 | PRTF, 8, |
| 47 | PRTG, 8, |
| 48 | PRTH, 8, |
| 49 | } |
Aaron Durbin | 9a7d7bc | 2013-09-07 00:41:48 -0500 | [diff] [blame] | 50 | } |
Duncan Laurie | 7fbe20b | 2013-11-04 17:00:22 -0800 | [diff] [blame] | 51 | |
Duncan Laurie | 053bd07 | 2013-11-04 17:19:16 -0800 | [diff] [blame] | 52 | Name(_HID,EISAID("PNP0A08")) // PCIe |
| 53 | Name(_CID,EISAID("PNP0A03")) // PCI |
| 54 | |
| 55 | Name(_ADR, 0) |
| 56 | Name(_BBN, 0) |
| 57 | |
| 58 | Method (_CRS, 0, Serialized) |
| 59 | { |
| 60 | Name (MCRS, ResourceTemplate() |
| 61 | { |
| 62 | // Bus Numbers |
| 63 | WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode, |
| 64 | 0x0000, 0x0000, 0x00ff, 0x0000, 0x0100,,, PB00) |
| 65 | |
| 66 | // IO Region 0 |
| 67 | DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, |
| 68 | 0x0000, 0x0000, 0x0cf7, 0x0000, 0x0cf8,,, PI00) |
| 69 | |
| 70 | // PCI Config Space |
| 71 | Io (Decode16, 0x0cf8, 0x0cf8, 0x0001, 0x0008) |
| 72 | |
| 73 | // IO Region 1 |
| 74 | DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, |
| 75 | 0x0000, 0x0d00, 0xffff, 0x0000, 0xf300,,, PI01) |
| 76 | |
| 77 | // VGA memory (0xa0000-0xbffff) |
| 78 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 79 | Cacheable, ReadWrite, |
| 80 | 0x00000000, 0x000a0000, 0x000bffff, 0x00000000, |
| 81 | 0x00020000,,, ASEG) |
| 82 | |
| 83 | // OPROM reserved (0xc0000-0xc3fff) |
| 84 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 85 | Cacheable, ReadWrite, |
| 86 | 0x00000000, 0x000c0000, 0x000c3fff, 0x00000000, |
| 87 | 0x00004000,,, OPR0) |
| 88 | |
| 89 | // OPROM reserved (0xc4000-0xc7fff) |
| 90 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 91 | Cacheable, ReadWrite, |
| 92 | 0x00000000, 0x000c4000, 0x000c7fff, 0x00000000, |
| 93 | 0x00004000,,, OPR1) |
| 94 | |
| 95 | // OPROM reserved (0xc8000-0xcbfff) |
| 96 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 97 | Cacheable, ReadWrite, |
| 98 | 0x00000000, 0x000c8000, 0x000cbfff, 0x00000000, |
| 99 | 0x00004000,,, OPR2) |
| 100 | |
| 101 | // OPROM reserved (0xcc000-0xcffff) |
| 102 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 103 | Cacheable, ReadWrite, |
| 104 | 0x00000000, 0x000cc000, 0x000cffff, 0x00000000, |
| 105 | 0x00004000,,, OPR3) |
| 106 | |
| 107 | // OPROM reserved (0xd0000-0xd3fff) |
| 108 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 109 | Cacheable, ReadWrite, |
| 110 | 0x00000000, 0x000d0000, 0x000d3fff, 0x00000000, |
| 111 | 0x00004000,,, OPR4) |
| 112 | |
| 113 | // OPROM reserved (0xd4000-0xd7fff) |
| 114 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 115 | Cacheable, ReadWrite, |
| 116 | 0x00000000, 0x000d4000, 0x000d7fff, 0x00000000, |
| 117 | 0x00004000,,, OPR5) |
| 118 | |
| 119 | // OPROM reserved (0xd8000-0xdbfff) |
| 120 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 121 | Cacheable, ReadWrite, |
| 122 | 0x00000000, 0x000d8000, 0x000dbfff, 0x00000000, |
| 123 | 0x00004000,,, OPR6) |
| 124 | |
| 125 | // OPROM reserved (0xdc000-0xdffff) |
| 126 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 127 | Cacheable, ReadWrite, |
| 128 | 0x00000000, 0x000dc000, 0x000dffff, 0x00000000, |
| 129 | 0x00004000,,, OPR7) |
| 130 | |
| 131 | // BIOS Extension (0xe0000-0xe3fff) |
| 132 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 133 | Cacheable, ReadWrite, |
| 134 | 0x00000000, 0x000e0000, 0x000e3fff, 0x00000000, |
| 135 | 0x00004000,,, ESG0) |
| 136 | |
| 137 | // BIOS Extension (0xe4000-0xe7fff) |
| 138 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 139 | Cacheable, ReadWrite, |
| 140 | 0x00000000, 0x000e4000, 0x000e7fff, 0x00000000, |
| 141 | 0x00004000,,, ESG1) |
| 142 | |
| 143 | // BIOS Extension (0xe8000-0xebfff) |
| 144 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 145 | Cacheable, ReadWrite, |
| 146 | 0x00000000, 0x000e8000, 0x000ebfff, 0x00000000, |
| 147 | 0x00004000,,, ESG2) |
| 148 | |
| 149 | // BIOS Extension (0xec000-0xeffff) |
| 150 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 151 | Cacheable, ReadWrite, |
| 152 | 0x00000000, 0x000ec000, 0x000effff, 0x00000000, |
| 153 | 0x00004000,,, ESG3) |
| 154 | |
| 155 | // System BIOS (0xf0000-0xfffff) |
| 156 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 157 | Cacheable, ReadWrite, |
| 158 | 0x00000000, 0x000f0000, 0x000fffff, 0x00000000, |
| 159 | 0x00010000,,, FSEG) |
| 160 | |
Dave Frodin | 2eaa0d4 | 2015-04-23 06:04:46 -0600 | [diff] [blame^] | 161 | // PCI Memory Region (Top of memory-CONFIG_MMCONF_BASE_ADDRESS) |
Duncan Laurie | 053bd07 | 2013-11-04 17:19:16 -0800 | [diff] [blame] | 162 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 163 | Cacheable, ReadWrite, |
Dave Frodin | 2eaa0d4 | 2015-04-23 06:04:46 -0600 | [diff] [blame^] | 164 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, |
| 165 | 0x00000000,,, PMEM) |
Duncan Laurie | 053bd07 | 2013-11-04 17:19:16 -0800 | [diff] [blame] | 166 | |
| 167 | // TPM Area (0xfed40000-0xfed44fff) |
| 168 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 169 | Cacheable, ReadWrite, |
| 170 | 0x00000000, 0xfed40000, 0xfed44fff, 0x00000000, |
| 171 | 0x00005000,,, TPMR) |
| 172 | }) |
| 173 | |
| 174 | // Update PCI resource area |
| 175 | CreateDwordField(MCRS, PMEM._MIN, PMIN) |
| 176 | CreateDwordField(MCRS, PMEM._MAX, PMAX) |
| 177 | CreateDwordField(MCRS, PMEM._LEN, PLEN) |
| 178 | |
| 179 | // TOLM is BMBOUND accessible from IOSF so is saved in NVS |
| 180 | Store (\TOLM, PMIN) |
Dave Frodin | 2eaa0d4 | 2015-04-23 06:04:46 -0600 | [diff] [blame^] | 181 | Store (Subtract(CONFIG_MMCONF_BASE_ADDRESS, 1), PMAX) |
Duncan Laurie | 053bd07 | 2013-11-04 17:19:16 -0800 | [diff] [blame] | 182 | Add (Subtract (PMAX, PMIN), 1, PLEN) |
| 183 | |
| 184 | Return (MCRS) |
| 185 | } |
| 186 | |
Duncan Laurie | 7fbe20b | 2013-11-04 17:00:22 -0800 | [diff] [blame] | 187 | /* Device Resource Consumption */ |
| 188 | Device (PDRC) |
| 189 | { |
| 190 | Name (_HID, EISAID("PNP0C02")) |
| 191 | Name (_UID, 1) |
| 192 | |
| 193 | Name (PDRS, ResourceTemplate() { |
| 194 | Memory32Fixed(ReadWrite, ABORT_BASE_ADDRESS, ABORT_BASE_SIZE) |
| 195 | Memory32Fixed(ReadWrite, MCFG_BASE_ADDRESS, MCFG_BASE_SIZE) |
| 196 | Memory32Fixed(ReadWrite, PMC_BASE_ADDRESS, PMC_BASE_SIZE) |
Duncan Laurie | 7fbe20b | 2013-11-04 17:00:22 -0800 | [diff] [blame] | 197 | Memory32Fixed(ReadWrite, ILB_BASE_ADDRESS, ILB_BASE_SIZE) |
| 198 | Memory32Fixed(ReadWrite, SPI_BASE_ADDRESS, SPI_BASE_SIZE) |
| 199 | Memory32Fixed(ReadWrite, MPHY_BASE_ADDRESS, MPHY_BASE_SIZE) |
| 200 | Memory32Fixed(ReadWrite, PUNIT_BASE_ADDRESS, PUNIT_BASE_SIZE) |
| 201 | Memory32Fixed(ReadWrite, RCBA_BASE_ADDRESS, RCBA_BASE_SIZE) |
Duncan Laurie | 7fbe20b | 2013-11-04 17:00:22 -0800 | [diff] [blame] | 202 | }) |
| 203 | |
| 204 | // Current Resource Settings |
| 205 | Method (_CRS, 0, Serialized) |
| 206 | { |
| 207 | Return(PDRS) |
| 208 | } |
| 209 | } |
Duncan Laurie | 93966e8 | 2013-11-04 17:28:19 -0800 | [diff] [blame] | 210 | |
| 211 | Method (_OSC, 4) |
| 212 | { |
| 213 | /* Check for proper GUID */ |
| 214 | If (LEqual (Arg0, ToUUID("33DB4D5B-1FF7-401C-9657-7441C03DD766"))) |
| 215 | { |
| 216 | /* Let OS control everything */ |
| 217 | Return (Arg3) |
| 218 | } |
| 219 | Else |
| 220 | { |
| 221 | /* Unrecognized UUID */ |
| 222 | CreateDWordField (Arg3, 0, CDW1) |
| 223 | Or (CDW1, 4, CDW1) |
| 224 | Return (Arg3) |
| 225 | } |
| 226 | } |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 227 | |
Duncan Laurie | 2e65796 | 2013-12-13 16:43:11 -0800 | [diff] [blame] | 228 | /* IOSF MBI Interface for kernel access */ |
| 229 | Device (IOSF) |
| 230 | { |
| 231 | Name (_HID, "INT33BD") |
| 232 | Name (_CID, "INT33BD") |
| 233 | Name (_UID, 1) |
| 234 | |
| 235 | Name (RBUF, ResourceTemplate () |
| 236 | { |
| 237 | /* MCR / MDR / MCRX */ |
| 238 | Memory32Fixed (ReadWrite, 0, 12, RBAR) |
| 239 | }) |
| 240 | |
| 241 | Method (_CRS) |
| 242 | { |
| 243 | CreateDwordField (^RBUF, ^RBAR._BAS, RBAS) |
| 244 | Store (Add (MCFG_BASE_ADDRESS, 0xD0), RBAS) |
| 245 | Return (^RBUF) |
| 246 | } |
| 247 | } |
| 248 | |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 249 | // LPC Bridge 0:1f.0 |
| 250 | #include "lpc.asl" |
| 251 | |
Duncan Laurie | 3f94a74 | 2014-01-14 14:59:28 -0800 | [diff] [blame] | 252 | // USB XHCI 0:14.0 |
| 253 | #include "xhci.asl" |
| 254 | |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 255 | // IRQ routing for each PCI device |
| 256 | #include "irqroute.asl" |
Duncan Laurie | bb0d1ea | 2013-12-03 10:00:20 -0800 | [diff] [blame] | 257 | |
Ted Kuo | 6ecaf65 | 2014-09-16 15:31:21 +0800 | [diff] [blame] | 258 | // PCI Express Ports 0:1c.x |
| 259 | #include "pcie.asl" |
| 260 | |
Duncan Laurie | 430bf0d | 2013-12-10 14:37:42 -0800 | [diff] [blame] | 261 | Scope (\_SB) |
| 262 | { |
| 263 | // GPIO Devices |
| 264 | #include "gpio.asl" |
| 265 | |
| 266 | // LPSS Devices |
| 267 | #include "lpss.asl" |
| 268 | |
| 269 | // SCC Devices |
| 270 | #include "scc.asl" |
Shawn Nematbakhsh | 51d787a | 2014-01-16 17:52:21 -0800 | [diff] [blame] | 271 | |
| 272 | // LPE Device |
| 273 | #include "lpe.asl" |
Duncan Laurie | 430bf0d | 2013-12-10 14:37:42 -0800 | [diff] [blame] | 274 | } |