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 | |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 22 | #include <soc/intel/baytrail/baytrail/iomap.h> |
| 23 | |
Aaron Durbin | 9a7d7bc | 2013-09-07 00:41:48 -0500 | [diff] [blame] | 24 | Scope(\) |
| 25 | { |
| 26 | // IO-Trap at 0x800. This is the ACPI->SMI communication interface. |
| 27 | |
| 28 | OperationRegion(IO_T, SystemIO, 0x800, 0x10) |
| 29 | Field(IO_T, ByteAcc, NoLock, Preserve) |
| 30 | { |
| 31 | Offset(0x8), |
| 32 | TRP0, 8 // IO-Trap at 0x808 |
| 33 | } |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 34 | |
| 35 | // Intel Legacy Block |
| 36 | OperationRegion(ILBS, SystemMemory, ILB_BASE_ADDRESS, ILB_BASE_SIZE) |
| 37 | Field (ILBS, AnyAcc, NoLock, Preserve) |
| 38 | { |
| 39 | Offset (0x8), |
| 40 | PRTA, 8, |
| 41 | PRTB, 8, |
| 42 | PRTC, 8, |
| 43 | PRTD, 8, |
| 44 | PRTE, 8, |
| 45 | PRTF, 8, |
| 46 | PRTG, 8, |
| 47 | PRTH, 8, |
| 48 | } |
Aaron Durbin | 9a7d7bc | 2013-09-07 00:41:48 -0500 | [diff] [blame] | 49 | } |
Duncan Laurie | 7fbe20b | 2013-11-04 17:00:22 -0800 | [diff] [blame] | 50 | |
Duncan Laurie | 053bd07 | 2013-11-04 17:19:16 -0800 | [diff] [blame] | 51 | Name(_HID,EISAID("PNP0A08")) // PCIe |
| 52 | Name(_CID,EISAID("PNP0A03")) // PCI |
| 53 | |
| 54 | Name(_ADR, 0) |
| 55 | Name(_BBN, 0) |
| 56 | |
| 57 | Method (_CRS, 0, Serialized) |
| 58 | { |
| 59 | Name (MCRS, ResourceTemplate() |
| 60 | { |
| 61 | // Bus Numbers |
| 62 | WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode, |
| 63 | 0x0000, 0x0000, 0x00ff, 0x0000, 0x0100,,, PB00) |
| 64 | |
| 65 | // IO Region 0 |
| 66 | DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, |
| 67 | 0x0000, 0x0000, 0x0cf7, 0x0000, 0x0cf8,,, PI00) |
| 68 | |
| 69 | // PCI Config Space |
| 70 | Io (Decode16, 0x0cf8, 0x0cf8, 0x0001, 0x0008) |
| 71 | |
| 72 | // IO Region 1 |
| 73 | DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, |
| 74 | 0x0000, 0x0d00, 0xffff, 0x0000, 0xf300,,, PI01) |
| 75 | |
| 76 | // VGA memory (0xa0000-0xbffff) |
| 77 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 78 | Cacheable, ReadWrite, |
| 79 | 0x00000000, 0x000a0000, 0x000bffff, 0x00000000, |
| 80 | 0x00020000,,, ASEG) |
| 81 | |
| 82 | // OPROM reserved (0xc0000-0xc3fff) |
| 83 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 84 | Cacheable, ReadWrite, |
| 85 | 0x00000000, 0x000c0000, 0x000c3fff, 0x00000000, |
| 86 | 0x00004000,,, OPR0) |
| 87 | |
| 88 | // OPROM reserved (0xc4000-0xc7fff) |
| 89 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 90 | Cacheable, ReadWrite, |
| 91 | 0x00000000, 0x000c4000, 0x000c7fff, 0x00000000, |
| 92 | 0x00004000,,, OPR1) |
| 93 | |
| 94 | // OPROM reserved (0xc8000-0xcbfff) |
| 95 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 96 | Cacheable, ReadWrite, |
| 97 | 0x00000000, 0x000c8000, 0x000cbfff, 0x00000000, |
| 98 | 0x00004000,,, OPR2) |
| 99 | |
| 100 | // OPROM reserved (0xcc000-0xcffff) |
| 101 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 102 | Cacheable, ReadWrite, |
| 103 | 0x00000000, 0x000cc000, 0x000cffff, 0x00000000, |
| 104 | 0x00004000,,, OPR3) |
| 105 | |
| 106 | // OPROM reserved (0xd0000-0xd3fff) |
| 107 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 108 | Cacheable, ReadWrite, |
| 109 | 0x00000000, 0x000d0000, 0x000d3fff, 0x00000000, |
| 110 | 0x00004000,,, OPR4) |
| 111 | |
| 112 | // OPROM reserved (0xd4000-0xd7fff) |
| 113 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 114 | Cacheable, ReadWrite, |
| 115 | 0x00000000, 0x000d4000, 0x000d7fff, 0x00000000, |
| 116 | 0x00004000,,, OPR5) |
| 117 | |
| 118 | // OPROM reserved (0xd8000-0xdbfff) |
| 119 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 120 | Cacheable, ReadWrite, |
| 121 | 0x00000000, 0x000d8000, 0x000dbfff, 0x00000000, |
| 122 | 0x00004000,,, OPR6) |
| 123 | |
| 124 | // OPROM reserved (0xdc000-0xdffff) |
| 125 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 126 | Cacheable, ReadWrite, |
| 127 | 0x00000000, 0x000dc000, 0x000dffff, 0x00000000, |
| 128 | 0x00004000,,, OPR7) |
| 129 | |
| 130 | // BIOS Extension (0xe0000-0xe3fff) |
| 131 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 132 | Cacheable, ReadWrite, |
| 133 | 0x00000000, 0x000e0000, 0x000e3fff, 0x00000000, |
| 134 | 0x00004000,,, ESG0) |
| 135 | |
| 136 | // BIOS Extension (0xe4000-0xe7fff) |
| 137 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 138 | Cacheable, ReadWrite, |
| 139 | 0x00000000, 0x000e4000, 0x000e7fff, 0x00000000, |
| 140 | 0x00004000,,, ESG1) |
| 141 | |
| 142 | // BIOS Extension (0xe8000-0xebfff) |
| 143 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 144 | Cacheable, ReadWrite, |
| 145 | 0x00000000, 0x000e8000, 0x000ebfff, 0x00000000, |
| 146 | 0x00004000,,, ESG2) |
| 147 | |
| 148 | // BIOS Extension (0xec000-0xeffff) |
| 149 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 150 | Cacheable, ReadWrite, |
| 151 | 0x00000000, 0x000ec000, 0x000effff, 0x00000000, |
| 152 | 0x00004000,,, ESG3) |
| 153 | |
| 154 | // System BIOS (0xf0000-0xfffff) |
| 155 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 156 | Cacheable, ReadWrite, |
| 157 | 0x00000000, 0x000f0000, 0x000fffff, 0x00000000, |
| 158 | 0x00010000,,, FSEG) |
| 159 | |
| 160 | // PCI Memory Region (Top of memory-0xfeafffff) |
| 161 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 162 | Cacheable, ReadWrite, |
Duncan Laurie | b50566e | 2013-12-04 18:34:11 -0800 | [diff] [blame] | 163 | 0x00000000, 0xfea00000, 0xfeafffff, 0x00000000, |
| 164 | 0x00100000,,, PMEM) |
Duncan Laurie | 053bd07 | 2013-11-04 17:19:16 -0800 | [diff] [blame] | 165 | |
| 166 | // TPM Area (0xfed40000-0xfed44fff) |
| 167 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 168 | Cacheable, ReadWrite, |
| 169 | 0x00000000, 0xfed40000, 0xfed44fff, 0x00000000, |
| 170 | 0x00005000,,, TPMR) |
| 171 | }) |
| 172 | |
| 173 | // Update PCI resource area |
| 174 | CreateDwordField(MCRS, PMEM._MIN, PMIN) |
| 175 | CreateDwordField(MCRS, PMEM._MAX, PMAX) |
| 176 | CreateDwordField(MCRS, PMEM._LEN, PLEN) |
| 177 | |
| 178 | // TOLM is BMBOUND accessible from IOSF so is saved in NVS |
| 179 | Store (\TOLM, PMIN) |
| 180 | Add (Subtract (PMAX, PMIN), 1, PLEN) |
| 181 | |
| 182 | Return (MCRS) |
| 183 | } |
| 184 | |
Duncan Laurie | 7fbe20b | 2013-11-04 17:00:22 -0800 | [diff] [blame] | 185 | /* Device Resource Consumption */ |
| 186 | Device (PDRC) |
| 187 | { |
| 188 | Name (_HID, EISAID("PNP0C02")) |
| 189 | Name (_UID, 1) |
| 190 | |
| 191 | Name (PDRS, ResourceTemplate() { |
| 192 | Memory32Fixed(ReadWrite, ABORT_BASE_ADDRESS, ABORT_BASE_SIZE) |
| 193 | Memory32Fixed(ReadWrite, MCFG_BASE_ADDRESS, MCFG_BASE_SIZE) |
| 194 | Memory32Fixed(ReadWrite, PMC_BASE_ADDRESS, PMC_BASE_SIZE) |
Duncan Laurie | 7fbe20b | 2013-11-04 17:00:22 -0800 | [diff] [blame] | 195 | Memory32Fixed(ReadWrite, ILB_BASE_ADDRESS, ILB_BASE_SIZE) |
| 196 | Memory32Fixed(ReadWrite, SPI_BASE_ADDRESS, SPI_BASE_SIZE) |
| 197 | Memory32Fixed(ReadWrite, MPHY_BASE_ADDRESS, MPHY_BASE_SIZE) |
| 198 | Memory32Fixed(ReadWrite, PUNIT_BASE_ADDRESS, PUNIT_BASE_SIZE) |
| 199 | Memory32Fixed(ReadWrite, RCBA_BASE_ADDRESS, RCBA_BASE_SIZE) |
| 200 | #if CONFIG_CHROMEOS_RAMOOPS |
| 201 | Memory32Fixed(ReadWrite, CONFIG_CHROMEOS_RAMOOPS_RAM_START, |
| 202 | CONFIG_CHROMEOS_RAMOOPS_RAM_SIZE) |
| 203 | #endif |
| 204 | }) |
| 205 | |
| 206 | // Current Resource Settings |
| 207 | Method (_CRS, 0, Serialized) |
| 208 | { |
| 209 | Return(PDRS) |
| 210 | } |
| 211 | } |
Duncan Laurie | 93966e8 | 2013-11-04 17:28:19 -0800 | [diff] [blame] | 212 | |
| 213 | Method (_OSC, 4) |
| 214 | { |
| 215 | /* Check for proper GUID */ |
| 216 | If (LEqual (Arg0, ToUUID("33DB4D5B-1FF7-401C-9657-7441C03DD766"))) |
| 217 | { |
| 218 | /* Let OS control everything */ |
| 219 | Return (Arg3) |
| 220 | } |
| 221 | Else |
| 222 | { |
| 223 | /* Unrecognized UUID */ |
| 224 | CreateDWordField (Arg3, 0, CDW1) |
| 225 | Or (CDW1, 4, CDW1) |
| 226 | Return (Arg3) |
| 227 | } |
| 228 | } |
Aaron Durbin | 3bde3d7 | 2013-11-04 21:45:52 -0600 | [diff] [blame] | 229 | |
| 230 | // LPC Bridge 0:1f.0 |
| 231 | #include "lpc.asl" |
| 232 | |
| 233 | // IRQ routing for each PCI device |
| 234 | #include "irqroute.asl" |
Duncan Laurie | bb0d1ea | 2013-12-03 10:00:20 -0800 | [diff] [blame] | 235 | |
| 236 | // GPIO Devices |
| 237 | #include "gpio.asl" |