blob: 84e107b8b30736cdfbcdf48c2fe88a73fa829242 [file] [log] [blame]
Josef Kellermannbfa7ee52011-05-11 07:47:43 +00001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2008 Advanced Micro Devices, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of 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.
Josef Kellermannbfa7ee52011-05-11 07:47:43 +000014 */
15
16static void setup_sitemp_resource_map(void)
17{
18 static const unsigned int register_values[] = {
19 /* Careful set limit registers before base registers which contain the enables */
20 /* DRAM Limit i Registers
21 * F1:0x44 i = 0
22 * F1:0x4C i = 1
23 * F1:0x54 i = 2
24 * F1:0x5C i = 3
25 * F1:0x64 i = 4
26 * F1:0x6C i = 5
27 * F1:0x74 i = 6
28 * F1:0x7C i = 7
29 * [ 2: 0] Destination Node ID
30 * 000 = Node 0
31 * 001 = Node 1
32 * 010 = Node 2
33 * 011 = Node 3
34 * 100 = Node 4
35 * 101 = Node 5
36 * 110 = Node 6
37 * 111 = Node 7
38 * [ 7: 3] Reserved
39 * [10: 8] Interleave select
40 * specifies the values of A[14:12] to use with interleave enable.
41 * [15:11] Reserved
42 * [31:16] DRAM Limit Address i Bits 39-24
43 * This field defines the upper address bits of a 40 bit address
44 * that define the end of the DRAM region.
45 */
46 PCI_ADDR(0, 0x18, 1, 0x44), 0x0000f8f8, 0x00000000,
47 PCI_ADDR(0, 0x18, 1, 0x4C), 0x0000f8f8, 0x00000001,
48 PCI_ADDR(0, 0x18, 1, 0x54), 0x0000f8f8, 0x00000002,
49 PCI_ADDR(0, 0x18, 1, 0x5C), 0x0000f8f8, 0x00000003,
50 PCI_ADDR(0, 0x18, 1, 0x64), 0x0000f8f8, 0x00000004,
51 PCI_ADDR(0, 0x18, 1, 0x6C), 0x0000f8f8, 0x00000005,
52 PCI_ADDR(0, 0x18, 1, 0x74), 0x0000f8f8, 0x00000006,
53 PCI_ADDR(0, 0x18, 1, 0x7C), 0x0000f8f8, 0x00000007,
54 /* DRAM Base i Registers
55 * F1:0x40 i = 0
56 * F1:0x48 i = 1
57 * F1:0x50 i = 2
58 * F1:0x58 i = 3
59 * F1:0x60 i = 4
60 * F1:0x68 i = 5
61 * F1:0x70 i = 6
62 * F1:0x78 i = 7
63 * [ 0: 0] Read Enable
64 * 0 = Reads Disabled
65 * 1 = Reads Enabled
66 * [ 1: 1] Write Enable
67 * 0 = Writes Disabled
68 * 1 = Writes Enabled
69 * [ 7: 2] Reserved
70 * [10: 8] Interleave Enable
71 * 000 = No interleave
72 * 001 = Interleave on A[12] (2 nodes)
73 * 010 = reserved
74 * 011 = Interleave on A[12] and A[14] (4 nodes)
75 * 100 = reserved
76 * 101 = reserved
77 * 110 = reserved
78 * 111 = Interleve on A[12] and A[13] and A[14] (8 nodes)
79 * [15:11] Reserved
80 * [13:16] DRAM Base Address i Bits 39-24
81 * This field defines the upper address bits of a 40-bit address
82 * that define the start of the DRAM region.
83 */
84 PCI_ADDR(0, 0x18, 1, 0x40), 0x0000f8fc, 0x00000000,
85 PCI_ADDR(0, 0x18, 1, 0x48), 0x0000f8fc, 0x00000000,
86 PCI_ADDR(0, 0x18, 1, 0x50), 0x0000f8fc, 0x00000000,
87 PCI_ADDR(0, 0x18, 1, 0x58), 0x0000f8fc, 0x00000000,
88 PCI_ADDR(0, 0x18, 1, 0x60), 0x0000f8fc, 0x00000000,
89 PCI_ADDR(0, 0x18, 1, 0x68), 0x0000f8fc, 0x00000000,
90 PCI_ADDR(0, 0x18, 1, 0x70), 0x0000f8fc, 0x00000000,
91 PCI_ADDR(0, 0x18, 1, 0x78), 0x0000f8fc, 0x00000000,
92
93 /* Memory-Mapped I/O Limit i Registers
94 * F1:0x84 i = 0
95 * F1:0x8C i = 1
96 * F1:0x94 i = 2
97 * F1:0x9C i = 3
98 * F1:0xA4 i = 4
99 * F1:0xAC i = 5
100 * F1:0xB4 i = 6
101 * F1:0xBC i = 7
102 * [ 2: 0] Destination Node ID
103 * 000 = Node 0
104 * 001 = Node 1
105 * 010 = Node 2
106 * 011 = Node 3
107 * 100 = Node 4
108 * 101 = Node 5
109 * 110 = Node 6
110 * 111 = Node 7
111 * [ 3: 3] Reserved
112 * [ 5: 4] Destination Link ID
113 * 00 = Link 0
114 * 01 = Link 1
115 * 10 = Link 2
116 * 11 = Reserved
117 * [ 6: 6] Reserved
118 * [ 7: 7] Non-Posted
119 * 0 = CPU writes may be posted
120 * 1 = CPU writes must be non-posted
121 * [31: 8] Memory-Mapped I/O Limit Address i (39-16)
122 * This field defines the upp adddress bits of a 40-bit address that
123 * defines the end of a memory-mapped I/O region n
124 */
125 PCI_ADDR(0, 0x18, 1, 0x84), 0x00000048, 0x00000000,
126 PCI_ADDR(0, 0x18, 1, 0x8C), 0x00000048, 0x00000000,
127 PCI_ADDR(0, 0x18, 1, 0x94), 0x00000048, 0x00000000,
128 PCI_ADDR(0, 0x18, 1, 0x9C), 0x00000048, 0x00000000,
129 PCI_ADDR(0, 0x18, 1, 0xA4), 0x00000048, 0x00000000,
130 PCI_ADDR(0, 0x18, 1, 0xAC), 0x00000048, 0x00000000,
131 PCI_ADDR(0, 0x18, 1, 0xB4), 0x00000048, 0x00000000,
132 PCI_ADDR(0, 0x18, 1, 0xBC), 0x00000048, 0x00ffff00,
133
134 /* Memory-Mapped I/O Base i Registers
135 * F1:0x80 i = 0
136 * F1:0x88 i = 1
137 * F1:0x90 i = 2
138 * F1:0x98 i = 3
139 * F1:0xA0 i = 4
140 * F1:0xA8 i = 5
141 * F1:0xB0 i = 6
142 * F1:0xB8 i = 7
143 * [ 0: 0] Read Enable
144 * 0 = Reads disabled
145 * 1 = Reads Enabled
146 * [ 1: 1] Write Enable
147 * 0 = Writes disabled
148 * 1 = Writes Enabled
149 * [ 2: 2] Cpu Disable
150 * 0 = Cpu can use this I/O range
151 * 1 = Cpu requests do not use this I/O range
152 * [ 3: 3] Lock
153 * 0 = base/limit registers i are read/write
154 * 1 = base/limit registers i are read-only
155 * [ 7: 4] Reserved
156 * [31: 8] Memory-Mapped I/O Base Address i (39-16)
157 * This field defines the upper address bits of a 40bit address
158 * that defines the start of memory-mapped I/O region i
159 */
160 PCI_ADDR(0, 0x18, 1, 0x80), 0x000000f0, 0x00000000,
161 PCI_ADDR(0, 0x18, 1, 0x88), 0x000000f0, 0x00000000,
162 PCI_ADDR(0, 0x18, 1, 0x90), 0x000000f0, 0x00000000,
163 PCI_ADDR(0, 0x18, 1, 0x98), 0x000000f0, 0x00000000,
164 PCI_ADDR(0, 0x18, 1, 0xA0), 0x000000f0, 0x00000000,
165 PCI_ADDR(0, 0x18, 1, 0xA8), 0x000000f0, 0x00000000,
166 PCI_ADDR(0, 0x18, 1, 0xB0), 0x000000f0, 0x00000000,
167 PCI_ADDR(0, 0x18, 1, 0xB8), 0x000000f0, 0x00fc0003,
168
169 /* PCI I/O Limit i Registers
170 * F1:0xC4 i = 0
171 * F1:0xCC i = 1
172 * F1:0xD4 i = 2
173 * F1:0xDC i = 3
174 * [ 2: 0] Destination Node ID
175 * 000 = Node 0
176 * 001 = Node 1
177 * 010 = Node 2
178 * 011 = Node 3
179 * 100 = Node 4
180 * 101 = Node 5
181 * 110 = Node 6
182 * 111 = Node 7
183 * [ 3: 3] Reserved
184 * [ 5: 4] Destination Link ID
185 * 00 = Link 0
186 * 01 = Link 1
187 * 10 = Link 2
188 * 11 = reserved
189 * [11: 6] Reserved
190 * [24:12] PCI I/O Limit Address i
191 * This field defines the end of PCI I/O region n
192 * [31:25] Reserved
193 */
194 PCI_ADDR(0, 0x18, 1, 0xC4), 0xFE000FC8, 0x01fff000,
195 PCI_ADDR(0, 0x18, 1, 0xCC), 0xFE000FC8, 0x00000000,
196 PCI_ADDR(0, 0x18, 1, 0xD4), 0xFE000FC8, 0x00000000,
197 PCI_ADDR(0, 0x18, 1, 0xDC), 0xFE000FC8, 0x00000000,
198
199 /* PCI I/O Base i Registers
200 * F1:0xC0 i = 0
201 * F1:0xC8 i = 1
202 * F1:0xD0 i = 2
203 * F1:0xD8 i = 3
204 * [ 0: 0] Read Enable
205 * 0 = Reads Disabled
206 * 1 = Reads Enabled
207 * [ 1: 1] Write Enable
208 * 0 = Writes Disabled
209 * 1 = Writes Enabled
210 * [ 3: 2] Reserved
211 * [ 4: 4] VGA Enable
212 * 0 = VGA matches Disabled
213 * 1 = matches all address < 64K and where A[9:0] is in the
214 * range 3B0-3BB or 3C0-3DF independen of the base & limit registers
215 * [ 5: 5] ISA Enable
216 * 0 = ISA matches Disabled
217 * 1 = Blocks address < 64K and in the last 768 bytes of eack 1K block
218 * from matching agains this base/limit pair
219 * [11: 6] Reserved
220 * [24:12] PCI I/O Base i
221 * This field defines the start of PCI I/O region n
222 * [31:25] Reserved
223 */
224 PCI_ADDR(0, 0x18, 1, 0xC0), 0xFE000FCC, 0x00000003,
225 PCI_ADDR(0, 0x18, 1, 0xC8), 0xFE000FCC, 0x00000000,
226 PCI_ADDR(0, 0x18, 1, 0xD0), 0xFE000FCC, 0x00000000,
227 PCI_ADDR(0, 0x18, 1, 0xD8), 0xFE000FCC, 0x00000000,
228
229 /* Config Base and Limit i Registers
230 * F1:0xE0 i = 0
231 * F1:0xE4 i = 1
232 * F1:0xE8 i = 2
233 * F1:0xEC i = 3
234 * [ 0: 0] Read Enable
235 * 0 = Reads Disabled
236 * 1 = Reads Enabled
237 * [ 1: 1] Write Enable
238 * 0 = Writes Disabled
239 * 1 = Writes Enabled
240 * [ 2: 2] Device Number Compare Enable
241 * 0 = The ranges are based on bus number
242 * 1 = The ranges are ranges of devices on bus 0
243 * [ 3: 3] Reserved
244 * [ 6: 4] Destination Node
245 * 000 = Node 0
246 * 001 = Node 1
247 * 010 = Node 2
248 * 011 = Node 3
249 * 100 = Node 4
250 * 101 = Node 5
251 * 110 = Node 6
252 * 111 = Node 7
253 * [ 7: 7] Reserved
254 * [ 9: 8] Destination Link
255 * 00 = Link 0
256 * 01 = Link 1
257 * 10 = Link 2
258 * 11 - Reserved
259 * [15:10] Reserved
260 * [23:16] Bus Number Base i
261 * This field defines the lowest bus number in configuration region i
262 * [31:24] Bus Number Limit i
263 * This field defines the highest bus number in configuration regin i
264 */
265 PCI_ADDR(0, 0x18, 1, 0xE0), 0x0000FC88, 0x08000003,
266 PCI_ADDR(0, 0x18, 1, 0xE4), 0x0000FC88, 0x00000000,
267 PCI_ADDR(0, 0x18, 1, 0xE8), 0x0000FC88, 0x00000000,
268 PCI_ADDR(0, 0x18, 1, 0xEC), 0x0000FC88, 0x00000000,
269 };
270
271 int max;
272 max = ARRAY_SIZE(register_values);
273 setup_resource_map(register_values, max);
274}