blob: a930afe875fca6d3adb914193a19d381f7a0e8aa [file] [log] [blame]
Angel Pons4b429832020-04-02 23:48:50 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Aaron Durbin76c37002012-10-30 09:03:43 -05002
Angel Pons79e3a1f2020-10-25 23:44:30 +01003#include "../haswell.h"
4#include <southbridge/intel/common/rcba.h>
5
Angel Ponsc5381e02020-10-25 12:56:29 +01006Name (_HID, EISAID ("PNP0A08")) // PCIe
7Name (_CID, EISAID ("PNP0A03")) // PCI
Aaron Durbin76c37002012-10-30 09:03:43 -05008
Angel Ponsc5381e02020-10-25 12:56:29 +01009Name (_BBN, 0)
Aaron Durbin76c37002012-10-30 09:03:43 -050010
11Device (MCHC)
12{
Angel Ponsc5381e02020-10-25 12:56:29 +010013 Name (_ADR, 0x00000000) // 0:0.0
Aaron Durbin76c37002012-10-30 09:03:43 -050014
Angel Ponsc5381e02020-10-25 12:56:29 +010015 OperationRegion (MCHP, PCI_Config, 0x00, 0x100)
Aaron Durbin76c37002012-10-30 09:03:43 -050016 Field (MCHP, DWordAcc, NoLock, Preserve)
17 {
Aaron Durbin76c37002012-10-30 09:03:43 -050018 Offset (0x70), // ME Base Address
19 MEBA, 64,
Aaron Durbin76c37002012-10-30 09:03:43 -050020 Offset (0xa0), // Top of Used Memory
21 TOM, 64,
Aaron Durbin76c37002012-10-30 09:03:43 -050022 Offset (0xbc), // Top of Low Used Memory
23 TLUD, 32,
24 }
Aaron Durbin76c37002012-10-30 09:03:43 -050025}
26
27// Current Resource Settings
Martin Rothfc706432015-08-18 16:56:05 -060028Name (MCRS, ResourceTemplate()
29{
30 // Bus Numbers
31 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
32 0x0000, 0x0000, 0x00ff, 0x0000, 0x0100,,, PB00)
33
34 // IO Region 0
35 DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
36 0x0000, 0x0000, 0x0cf7, 0x0000, 0x0cf8,,, PI00)
37
38 // PCI Config Space
39 Io (Decode16, 0x0cf8, 0x0cf8, 0x0001, 0x0008)
40
41 // IO Region 1
42 DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
43 0x0000, 0x0d00, 0xffff, 0x0000, 0xf300,,, PI01)
44
45 // VGA memory (0xa0000-0xbffff)
46 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
47 Cacheable, ReadWrite,
48 0x00000000, 0x000a0000, 0x000bffff, 0x00000000,
49 0x00020000,,, ASEG)
50
51 // OPROM reserved (0xc0000-0xc3fff)
52 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
53 Cacheable, ReadWrite,
54 0x00000000, 0x000c0000, 0x000c3fff, 0x00000000,
55 0x00004000,,, OPR0)
56
57 // OPROM reserved (0xc4000-0xc7fff)
58 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
59 Cacheable, ReadWrite,
60 0x00000000, 0x000c4000, 0x000c7fff, 0x00000000,
61 0x00004000,,, OPR1)
62
63 // OPROM reserved (0xc8000-0xcbfff)
64 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
65 Cacheable, ReadWrite,
66 0x00000000, 0x000c8000, 0x000cbfff, 0x00000000,
67 0x00004000,,, OPR2)
68
69 // OPROM reserved (0xcc000-0xcffff)
70 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
71 Cacheable, ReadWrite,
72 0x00000000, 0x000cc000, 0x000cffff, 0x00000000,
73 0x00004000,,, OPR3)
74
75 // OPROM reserved (0xd0000-0xd3fff)
76 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
77 Cacheable, ReadWrite,
78 0x00000000, 0x000d0000, 0x000d3fff, 0x00000000,
79 0x00004000,,, OPR4)
80
81 // OPROM reserved (0xd4000-0xd7fff)
82 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
83 Cacheable, ReadWrite,
84 0x00000000, 0x000d4000, 0x000d7fff, 0x00000000,
85 0x00004000,,, OPR5)
86
87 // OPROM reserved (0xd8000-0xdbfff)
88 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
89 Cacheable, ReadWrite,
90 0x00000000, 0x000d8000, 0x000dbfff, 0x00000000,
91 0x00004000,,, OPR6)
92
93 // OPROM reserved (0xdc000-0xdffff)
94 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
95 Cacheable, ReadWrite,
96 0x00000000, 0x000dc000, 0x000dffff, 0x00000000,
97 0x00004000,,, OPR7)
98
99 // BIOS Extension (0xe0000-0xe3fff)
100 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
101 Cacheable, ReadWrite,
102 0x00000000, 0x000e0000, 0x000e3fff, 0x00000000,
103 0x00004000,,, ESG0)
104
105 // BIOS Extension (0xe4000-0xe7fff)
106 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
107 Cacheable, ReadWrite,
108 0x00000000, 0x000e4000, 0x000e7fff, 0x00000000,
109 0x00004000,,, ESG1)
110
111 // BIOS Extension (0xe8000-0xebfff)
112 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
113 Cacheable, ReadWrite,
114 0x00000000, 0x000e8000, 0x000ebfff, 0x00000000,
115 0x00004000,,, ESG2)
116
117 // BIOS Extension (0xec000-0xeffff)
118 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
119 Cacheable, ReadWrite,
120 0x00000000, 0x000ec000, 0x000effff, 0x00000000,
121 0x00004000,,, ESG3)
122
123 // System BIOS (0xf0000-0xfffff)
124 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
125 Cacheable, ReadWrite,
126 0x00000000, 0x000f0000, 0x000fffff, 0x00000000,
127 0x00010000,,, FSEG)
128
129 // PCI Memory Region (Top of memory-CONFIG_MMCONF_BASE_ADDRESS)
130 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
131 Cacheable, ReadWrite,
132 0x00000000, 0x00000000, 0x00000000, 0x00000000,
133 0x00000000,,, PM01)
134
135 // TPM Area (0xfed40000-0xfed44fff)
136 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
137 Cacheable, ReadWrite,
138 0x00000000, 0xfed40000, 0xfed44fff, 0x00000000,
139 0x00005000,,, TPMR)
140})
Aaron Durbin76c37002012-10-30 09:03:43 -0500141
142Method (_CRS, 0, Serialized)
143{
Aaron Durbin76c37002012-10-30 09:03:43 -0500144 // Find PCI resource area in MCRS
Angel Ponsc5381e02020-10-25 12:56:29 +0100145 CreateDwordField (MCRS, ^PM01._MIN, PMIN)
146 CreateDwordField (MCRS, ^PM01._MAX, PMAX)
147 CreateDwordField (MCRS, ^PM01._LEN, PLEN)
Aaron Durbin76c37002012-10-30 09:03:43 -0500148
149 // Fix up PCI memory region
150 // Start with Top of Lower Usable DRAM
Furquan Shaikh506479d2020-06-01 13:27:16 -0700151 // Lower 20 bits of TOLUD register need to be masked since they contain lock and
152 // reserved bits.
153 Local0 = ^MCHC.TLUD & (0xfff << 20)
Furquan Shaikh181e2d42020-06-01 13:03:45 -0700154 Local1 = ^MCHC.MEBA
Aaron Durbin76c37002012-10-30 09:03:43 -0500155
156 // Check if ME base is equal
Furquan Shaikh181e2d42020-06-01 13:03:45 -0700157 If (Local0 == Local1) {
Aaron Durbin76c37002012-10-30 09:03:43 -0500158 // Use Top Of Memory instead
Furquan Shaikh506479d2020-06-01 13:27:16 -0700159 // Lower 20 bits of TOM register need to be masked since they contain lock and
160 // reserved bits.
161 Local0 = ^MCHC.TOM & (0x7ffff << 20)
Aaron Durbin76c37002012-10-30 09:03:43 -0500162 }
163
Furquan Shaikh181e2d42020-06-01 13:03:45 -0700164 PMIN = Local0
165 PMAX = CONFIG_MMCONF_BASE_ADDRESS - 1
Angel Ponsc5381e02020-10-25 12:56:29 +0100166 PLEN = (PMAX - PMIN) + 1
Aaron Durbin76c37002012-10-30 09:03:43 -0500167
168 Return (MCRS)
169}
Angel Ponsf239b5a2020-10-25 12:58:32 +0100170
Angel Pons79e3a1f2020-10-25 23:44:30 +0100171/* PCI Device Resource Consumption */
172Device (PDRC)
173{
174 Name (_HID, EISAID ("PNP0C02"))
175 Name (_UID, 1)
176
177 Name (PDRS, ResourceTemplate () {
178 Memory32Fixed (ReadWrite, DEFAULT_RCBA, 0x00004000)
179 Memory32Fixed (ReadWrite, DEFAULT_MCHBAR, 0x00008000)
180 Memory32Fixed (ReadWrite, DEFAULT_DMIBAR, 0x00001000)
181 Memory32Fixed (ReadWrite, DEFAULT_EPBAR, 0x00001000)
182 Memory32Fixed (ReadWrite, CONFIG_MMCONF_BASE_ADDRESS, 0x04000000)
183 Memory32Fixed (ReadWrite, 0xfed20000, 0x00020000) // Misc ICH
184 Memory32Fixed (ReadWrite, 0xfed40000, 0x00005000) // Misc ICH
185 Memory32Fixed (ReadWrite, 0xfed45000, 0x0004b000) // Misc ICH
186
187#if CONFIG(CHROMEOS_RAMOOPS)
188 Memory32Fixed (ReadWrite, CONFIG_CHROMEOS_RAMOOPS_RAM_START,
189 CONFIG_CHROMEOS_RAMOOPS_RAM_SIZE)
190#endif
191 })
192
193 // Current Resource Settings
194 Method (_CRS, 0, Serialized)
195 {
196 Return (PDRS)
197 }
198}
Angel Pons90f6a312020-10-26 00:01:13 +0100199
200/* Configurable TDP */
201#include "ctdp.asl"
202
Angel Ponsc29d8e02020-10-26 00:02:31 +0100203#if !CONFIG(INTEL_LYNXPOINT_LP)
Angel Pons90f6a312020-10-26 00:01:13 +0100204/* PCI Express Graphics */
205#include "peg.asl"
Angel Ponsc29d8e02020-10-26 00:02:31 +0100206#endif
Matt DeVillierc6589ae2020-11-28 13:17:54 -0600207
208/* Integrated graphics 0:2.0 */
209#include <drivers/intel/gma/acpi/gfx.asl>