blob: 4bf47b35bb89617f1e5b780368a049429ae23eaa [file] [log] [blame]
Patrick Georgi2efc8802012-11-06 11:03:53 +01001/*
2 * This file is part of the coreboot project.
3 *
Patrick Georgi2efc8802012-11-06 11:03:53 +01004 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; version 2 of
8 * the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
Patrick Georgi2efc8802012-11-06 11:03:53 +010014 */
15
16#include <arch/ioapic.h>
17
18Name(_HID,EISAID("PNP0A08")) // PCIe
19Name(_CID,EISAID("PNP0A03")) // PCI
20
Patrick Georgi2efc8802012-11-06 11:03:53 +010021Name(_BBN, 0)
22
23Device (MCHC)
24{
25 Name(_ADR, 0x00000000) // 0:0.0
26
27 OperationRegion(MCHP, PCI_Config, 0x00, 0x100)
28 Field (MCHP, DWordAcc, NoLock, Preserve)
29 {
30 Offset (0x40), // EPBAR
31 EPEN, 1, // Enable
32 , 11, //
33 EPBR, 24, // EPBAR
34
35 Offset (0x48), // MCHBAR
36 MHEN, 1, // Enable
37 , 13, //
38 MHBR, 22, // MCHBAR
39
40 Offset (0x60), // PCIe BAR
41 PXEN, 1, // Enable
42 PXSZ, 2, // BAR size
43 , 23, //
44 PXBR, 10, // PCIe BAR
45
46 Offset (0x68), // DMIBAR
47 DMEN, 1, // Enable
48 , 11, //
49 DMBR, 24, // DMIBAR
50
51 // ...
52
53 Offset (0x90), // PAM0
54 , 4,
55 PM0H, 2,
56 , 2,
57 Offset (0x91), // PAM1
58 PM1L, 2,
59 , 2,
60 PM1H, 2,
61 , 2,
62 Offset (0x92), // PAM2
63 PM2L, 2,
64 , 2,
65 PM2H, 2,
66 , 2,
67 Offset (0x93), // PAM3
68 PM3L, 2,
69 , 2,
70 PM3H, 2,
71 , 2,
72 Offset (0x94), // PAM4
73 PM4L, 2,
74 , 2,
75 PM4H, 2,
76 , 2,
77 Offset (0x95), // PAM5
78 PM5L, 2,
79 , 2,
80 PM5H, 2,
81 , 2,
82 Offset (0x96), // PAM6
83 PM6L, 2,
84 , 2,
85 PM6H, 2,
86 , 2,
87
88 Offset (0xa0), // Top of Used Memory
89 TOM, 8,
90
91 Offset (0xb0), // Top of Low Used Memory
92 , 4,
93 TLUD, 12,
94 }
95
96}
97
98
99// Current Resource Settings
Martin Rothfc706432015-08-18 16:56:05 -0600100Name (MCRS, ResourceTemplate()
101{
102 // Bus Numbers
103 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
104 0x0000, 0x0000, 0x00ff, 0x0000, 0x0100,,, PB00)
105
106 // IO Region 0
107 DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
108 0x0000, 0x0000, 0x0cf7, 0x0000, 0x0cf8,,, PI00)
109
110 // PCI Config Space
111 Io (Decode16, 0x0cf8, 0x0cf8, 0x0001, 0x0008)
112
113 // IO Region 1
114 DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
115 0x0000, 0x0d00, 0xffff, 0x0000, 0xf300,,, PI01)
116
117 // VGA memory (0xa0000-0xbffff)
118 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
119 Cacheable, ReadWrite,
120 0x00000000, 0x000a0000, 0x000bffff, 0x00000000,
121 0x00020000,,, ASEG)
122
123 // OPROM reserved (0xc0000-0xc3fff)
124 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
125 Cacheable, ReadWrite,
126 0x00000000, 0x000c0000, 0x000c3fff, 0x00000000,
127 0x00004000,,, OPR0)
128
129 // OPROM reserved (0xc4000-0xc7fff)
130 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
131 Cacheable, ReadWrite,
132 0x00000000, 0x000c4000, 0x000c7fff, 0x00000000,
133 0x00004000,,, OPR1)
134
135 // OPROM reserved (0xc8000-0xcbfff)
136 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
137 Cacheable, ReadWrite,
138 0x00000000, 0x000c8000, 0x000cbfff, 0x00000000,
139 0x00004000,,, OPR2)
140
141 // OPROM reserved (0xcc000-0xcffff)
142 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
143 Cacheable, ReadWrite,
144 0x00000000, 0x000cc000, 0x000cffff, 0x00000000,
145 0x00004000,,, OPR3)
146
147 // OPROM reserved (0xd0000-0xd3fff)
148 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
149 Cacheable, ReadWrite,
150 0x00000000, 0x000d0000, 0x000d3fff, 0x00000000,
151 0x00004000,,, OPR4)
152
153 // OPROM reserved (0xd4000-0xd7fff)
154 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
155 Cacheable, ReadWrite,
156 0x00000000, 0x000d4000, 0x000d7fff, 0x00000000,
157 0x00004000,,, OPR5)
158
159 // OPROM reserved (0xd8000-0xdbfff)
160 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
161 Cacheable, ReadWrite,
162 0x00000000, 0x000d8000, 0x000dbfff, 0x00000000,
163 0x00004000,,, OPR6)
164
165 // OPROM reserved (0xdc000-0xdffff)
166 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
167 Cacheable, ReadWrite,
168 0x00000000, 0x000dc000, 0x000dffff, 0x00000000,
169 0x00004000,,, OPR7)
170
171 // BIOS Extension (0xe0000-0xe3fff)
172 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
173 Cacheable, ReadWrite,
174 0x00000000, 0x000e0000, 0x000e3fff, 0x00000000,
175 0x00004000,,, ESG0)
176
177 // BIOS Extension (0xe4000-0xe7fff)
178 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
179 Cacheable, ReadWrite,
180 0x00000000, 0x000e4000, 0x000e7fff, 0x00000000,
181 0x00004000,,, ESG1)
182
183 // BIOS Extension (0xe8000-0xebfff)
184 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
185 Cacheable, ReadWrite,
186 0x00000000, 0x000e8000, 0x000ebfff, 0x00000000,
187 0x00004000,,, ESG2)
188
189 // BIOS Extension (0xec000-0xeffff)
190 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
191 Cacheable, ReadWrite,
192 0x00000000, 0x000ec000, 0x000effff, 0x00000000,
193 0x00004000,,, ESG3)
194
195 // System BIOS (0xf0000-0xfffff)
196 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
197 Cacheable, ReadWrite,
198 0x00000000, 0x000f0000, 0x000fffff, 0x00000000,
199 0x00010000,,, FSEG)
200
201 // PCI Memory Region (Top of memory-0xfebfffff)
202 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
203 Cacheable, ReadWrite,
204 0x00000000, 0x00000000, 0xfebfffff, 0x00000000,
205 IO_APIC_ADDR,,, PM01)
206
207 // TPM Area (0xfed40000-0xfed44fff)
208 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
209 Cacheable, ReadWrite,
210 0x00000000, 0xfed40000, 0xfed44fff, 0x00000000,
211 0x00005000,,, TPMR)
212})
Patrick Georgi2efc8802012-11-06 11:03:53 +0100213
214Method (_CRS, 0, Serialized)
215{
Patrick Georgi2efc8802012-11-06 11:03:53 +0100216 // Find PCI resource area in MCRS
Martin Rothfc706432015-08-18 16:56:05 -0600217 CreateDwordField(MCRS, ^PM01._MIN, PMIN)
218 CreateDwordField(MCRS, ^PM01._MAX, PMAX)
219 CreateDwordField(MCRS, ^PM01._LEN, PLEN)
Patrick Georgi2efc8802012-11-06 11:03:53 +0100220
221 // Fix up PCI memory region:
222 // Enter actual TOLUD. The TOLUD register contains bits 20-31 of
223 // the top of memory address.
224 ShiftLeft (^MCHC.TLUD, 20, PMIN)
225 Add(Subtract(PMAX, PMIN), 1, PLEN)
226
227 Return (MCRS)
228}