Angel Pons | 4b42983 | 2020-04-02 23:48:50 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 2 | |
Angel Pons | 3eeefba | 2021-06-14 09:23:40 +0200 | [diff] [blame] | 3 | #include <northbridge/intel/haswell/memmap.h> |
| 4 | |
Angel Pons | c5381e0 | 2020-10-25 12:56:29 +0100 | [diff] [blame] | 5 | Name (_HID, EISAID ("PNP0A08")) // PCIe |
| 6 | Name (_CID, EISAID ("PNP0A03")) // PCI |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 7 | |
Angel Pons | c5381e0 | 2020-10-25 12:56:29 +0100 | [diff] [blame] | 8 | Name (_BBN, 0) |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 9 | |
| 10 | Device (MCHC) |
| 11 | { |
Angel Pons | c5381e0 | 2020-10-25 12:56:29 +0100 | [diff] [blame] | 12 | Name (_ADR, 0x00000000) // 0:0.0 |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 13 | |
Angel Pons | c5381e0 | 2020-10-25 12:56:29 +0100 | [diff] [blame] | 14 | OperationRegion (MCHP, PCI_Config, 0x00, 0x100) |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 15 | Field (MCHP, DWordAcc, NoLock, Preserve) |
| 16 | { |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 17 | Offset (0x70), // ME Base Address |
| 18 | MEBA, 64, |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 19 | Offset (0xa0), // Top of Used Memory |
| 20 | TOM, 64, |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 21 | Offset (0xbc), // Top of Low Used Memory |
| 22 | TLUD, 32, |
| 23 | } |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | // Current Resource Settings |
Martin Roth | fc70643 | 2015-08-18 16:56:05 -0600 | [diff] [blame] | 27 | Name (MCRS, ResourceTemplate() |
| 28 | { |
| 29 | // Bus Numbers |
| 30 | WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode, |
| 31 | 0x0000, 0x0000, 0x00ff, 0x0000, 0x0100,,, PB00) |
| 32 | |
| 33 | // IO Region 0 |
| 34 | DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, |
| 35 | 0x0000, 0x0000, 0x0cf7, 0x0000, 0x0cf8,,, PI00) |
| 36 | |
| 37 | // PCI Config Space |
| 38 | Io (Decode16, 0x0cf8, 0x0cf8, 0x0001, 0x0008) |
| 39 | |
| 40 | // IO Region 1 |
| 41 | DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, |
| 42 | 0x0000, 0x0d00, 0xffff, 0x0000, 0xf300,,, PI01) |
| 43 | |
| 44 | // VGA memory (0xa0000-0xbffff) |
| 45 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 46 | Cacheable, ReadWrite, |
| 47 | 0x00000000, 0x000a0000, 0x000bffff, 0x00000000, |
| 48 | 0x00020000,,, ASEG) |
| 49 | |
| 50 | // OPROM reserved (0xc0000-0xc3fff) |
| 51 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 52 | Cacheable, ReadWrite, |
| 53 | 0x00000000, 0x000c0000, 0x000c3fff, 0x00000000, |
| 54 | 0x00004000,,, OPR0) |
| 55 | |
| 56 | // OPROM reserved (0xc4000-0xc7fff) |
| 57 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 58 | Cacheable, ReadWrite, |
| 59 | 0x00000000, 0x000c4000, 0x000c7fff, 0x00000000, |
| 60 | 0x00004000,,, OPR1) |
| 61 | |
| 62 | // OPROM reserved (0xc8000-0xcbfff) |
| 63 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 64 | Cacheable, ReadWrite, |
| 65 | 0x00000000, 0x000c8000, 0x000cbfff, 0x00000000, |
| 66 | 0x00004000,,, OPR2) |
| 67 | |
| 68 | // OPROM reserved (0xcc000-0xcffff) |
| 69 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 70 | Cacheable, ReadWrite, |
| 71 | 0x00000000, 0x000cc000, 0x000cffff, 0x00000000, |
| 72 | 0x00004000,,, OPR3) |
| 73 | |
| 74 | // OPROM reserved (0xd0000-0xd3fff) |
| 75 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 76 | Cacheable, ReadWrite, |
| 77 | 0x00000000, 0x000d0000, 0x000d3fff, 0x00000000, |
| 78 | 0x00004000,,, OPR4) |
| 79 | |
| 80 | // OPROM reserved (0xd4000-0xd7fff) |
| 81 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 82 | Cacheable, ReadWrite, |
| 83 | 0x00000000, 0x000d4000, 0x000d7fff, 0x00000000, |
| 84 | 0x00004000,,, OPR5) |
| 85 | |
| 86 | // OPROM reserved (0xd8000-0xdbfff) |
| 87 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 88 | Cacheable, ReadWrite, |
| 89 | 0x00000000, 0x000d8000, 0x000dbfff, 0x00000000, |
| 90 | 0x00004000,,, OPR6) |
| 91 | |
| 92 | // OPROM reserved (0xdc000-0xdffff) |
| 93 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 94 | Cacheable, ReadWrite, |
| 95 | 0x00000000, 0x000dc000, 0x000dffff, 0x00000000, |
| 96 | 0x00004000,,, OPR7) |
| 97 | |
| 98 | // BIOS Extension (0xe0000-0xe3fff) |
| 99 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 100 | Cacheable, ReadWrite, |
| 101 | 0x00000000, 0x000e0000, 0x000e3fff, 0x00000000, |
| 102 | 0x00004000,,, ESG0) |
| 103 | |
| 104 | // BIOS Extension (0xe4000-0xe7fff) |
| 105 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 106 | Cacheable, ReadWrite, |
| 107 | 0x00000000, 0x000e4000, 0x000e7fff, 0x00000000, |
| 108 | 0x00004000,,, ESG1) |
| 109 | |
| 110 | // BIOS Extension (0xe8000-0xebfff) |
| 111 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 112 | Cacheable, ReadWrite, |
| 113 | 0x00000000, 0x000e8000, 0x000ebfff, 0x00000000, |
| 114 | 0x00004000,,, ESG2) |
| 115 | |
| 116 | // BIOS Extension (0xec000-0xeffff) |
| 117 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 118 | Cacheable, ReadWrite, |
| 119 | 0x00000000, 0x000ec000, 0x000effff, 0x00000000, |
| 120 | 0x00004000,,, ESG3) |
| 121 | |
| 122 | // System BIOS (0xf0000-0xfffff) |
| 123 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 124 | Cacheable, ReadWrite, |
| 125 | 0x00000000, 0x000f0000, 0x000fffff, 0x00000000, |
| 126 | 0x00010000,,, FSEG) |
| 127 | |
| 128 | // PCI Memory Region (Top of memory-CONFIG_MMCONF_BASE_ADDRESS) |
| 129 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 130 | Cacheable, ReadWrite, |
| 131 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, |
| 132 | 0x00000000,,, PM01) |
| 133 | |
| 134 | // TPM Area (0xfed40000-0xfed44fff) |
| 135 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, |
| 136 | Cacheable, ReadWrite, |
| 137 | 0x00000000, 0xfed40000, 0xfed44fff, 0x00000000, |
| 138 | 0x00005000,,, TPMR) |
| 139 | }) |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 140 | |
| 141 | Method (_CRS, 0, Serialized) |
| 142 | { |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 143 | // Find PCI resource area in MCRS |
Angel Pons | c5381e0 | 2020-10-25 12:56:29 +0100 | [diff] [blame] | 144 | CreateDwordField (MCRS, ^PM01._MIN, PMIN) |
| 145 | CreateDwordField (MCRS, ^PM01._MAX, PMAX) |
| 146 | CreateDwordField (MCRS, ^PM01._LEN, PLEN) |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 147 | |
| 148 | // Fix up PCI memory region |
| 149 | // Start with Top of Lower Usable DRAM |
Furquan Shaikh | 506479d | 2020-06-01 13:27:16 -0700 | [diff] [blame] | 150 | // Lower 20 bits of TOLUD register need to be masked since they contain lock and |
| 151 | // reserved bits. |
| 152 | Local0 = ^MCHC.TLUD & (0xfff << 20) |
Furquan Shaikh | 181e2d4 | 2020-06-01 13:03:45 -0700 | [diff] [blame] | 153 | Local1 = ^MCHC.MEBA |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 154 | |
| 155 | // Check if ME base is equal |
Furquan Shaikh | 181e2d4 | 2020-06-01 13:03:45 -0700 | [diff] [blame] | 156 | If (Local0 == Local1) { |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 157 | // Use Top Of Memory instead |
Furquan Shaikh | 506479d | 2020-06-01 13:27:16 -0700 | [diff] [blame] | 158 | // Lower 20 bits of TOM register need to be masked since they contain lock and |
| 159 | // reserved bits. |
| 160 | Local0 = ^MCHC.TOM & (0x7ffff << 20) |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 161 | } |
| 162 | |
Furquan Shaikh | 181e2d4 | 2020-06-01 13:03:45 -0700 | [diff] [blame] | 163 | PMIN = Local0 |
| 164 | PMAX = CONFIG_MMCONF_BASE_ADDRESS - 1 |
Angel Pons | c5381e0 | 2020-10-25 12:56:29 +0100 | [diff] [blame] | 165 | PLEN = (PMAX - PMIN) + 1 |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 166 | |
| 167 | Return (MCRS) |
| 168 | } |
Angel Pons | f239b5a | 2020-10-25 12:58:32 +0100 | [diff] [blame] | 169 | |
Angel Pons | 79e3a1f | 2020-10-25 23:44:30 +0100 | [diff] [blame] | 170 | /* PCI Device Resource Consumption */ |
| 171 | Device (PDRC) |
| 172 | { |
| 173 | Name (_HID, EISAID ("PNP0C02")) |
| 174 | Name (_UID, 1) |
| 175 | |
| 176 | Name (PDRS, ResourceTemplate () { |
Angel Pons | b70ff52 | 2021-01-28 14:27:46 +0100 | [diff] [blame] | 177 | Memory32Fixed (ReadWrite, CONFIG_FIXED_RCBA_MMIO_BASE, CONFIG_RCBA_LENGTH) |
Angel Pons | 3eeefba | 2021-06-14 09:23:40 +0200 | [diff] [blame] | 178 | Memory32Fixed (ReadWrite, CONFIG_FIXED_MCHBAR_MMIO_BASE, MCH_BASE_SIZE) |
| 179 | Memory32Fixed (ReadWrite, CONFIG_FIXED_DMIBAR_MMIO_BASE, DMI_BASE_SIZE) |
| 180 | Memory32Fixed (ReadWrite, CONFIG_FIXED_EPBAR_MMIO_BASE, EP_BASE_SIZE) |
Angel Pons | 32770f8 | 2021-01-20 15:03:30 +0100 | [diff] [blame] | 181 | Memory32Fixed (ReadWrite, CONFIG_MMCONF_BASE_ADDRESS, CONFIG_MMCONF_LENGTH) |
Angel Pons | ef5eb96 | 2021-06-13 15:29:54 +0200 | [diff] [blame] | 182 | Memory32Fixed (ReadWrite, 0xfed20000, 0x00020000) // TXT |
| 183 | Memory32Fixed (ReadWrite, 0xfed40000, 0x00005000) // TPM |
Angel Pons | 79e3a1f | 2020-10-25 23:44:30 +0100 | [diff] [blame] | 184 | Memory32Fixed (ReadWrite, 0xfed45000, 0x0004b000) // Misc ICH |
Angel Pons | 6a2a514 | 2021-06-14 09:39:01 +0200 | [diff] [blame] | 185 | Memory32Fixed (ReadWrite, EDRAM_BASE_ADDRESS, EDRAM_BASE_SIZE) |
| 186 | Memory32Fixed (ReadWrite, GDXC_BASE_ADDRESS, GDXC_BASE_SIZE) |
Angel Pons | 79e3a1f | 2020-10-25 23:44:30 +0100 | [diff] [blame] | 187 | }) |
| 188 | |
| 189 | // Current Resource Settings |
| 190 | Method (_CRS, 0, Serialized) |
| 191 | { |
| 192 | Return (PDRS) |
| 193 | } |
| 194 | } |
Angel Pons | 90f6a31 | 2020-10-26 00:01:13 +0100 | [diff] [blame] | 195 | |
| 196 | /* Configurable TDP */ |
| 197 | #include "ctdp.asl" |
| 198 | |
Angel Pons | c29d8e0 | 2020-10-26 00:02:31 +0100 | [diff] [blame] | 199 | #if !CONFIG(INTEL_LYNXPOINT_LP) |
Angel Pons | 90f6a31 | 2020-10-26 00:01:13 +0100 | [diff] [blame] | 200 | /* PCI Express Graphics */ |
| 201 | #include "peg.asl" |
Angel Pons | c29d8e0 | 2020-10-26 00:02:31 +0100 | [diff] [blame] | 202 | #endif |
Matt DeVillier | c6589ae | 2020-11-28 13:17:54 -0600 | [diff] [blame] | 203 | |
| 204 | /* Integrated graphics 0:2.0 */ |
| 205 | #include <drivers/intel/gma/acpi/gfx.asl> |
Matt DeVillier | 51254ee | 2020-05-18 23:41:45 -0500 | [diff] [blame] | 206 | |
| 207 | /* Intel Mini-HD 0:03.0 */ |
| 208 | Device (HDAU) |
| 209 | { |
| 210 | Name (_ADR, 0x00030000) |
| 211 | } |