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