blob: 53b470a5e4b9696b835e9eebd8622eb59891f794 [file] [log] [blame]
Bingxun Shifb1fddb2007-02-09 00:26:10 +00001/*
Stefan Reinauer7e61e452008-01-18 10:35:56 +00002 * This file is part of the coreboot project.
Bingxun Shifb1fddb2007-02-09 00:26:10 +00003 *
4 * Copyright (C) 2003 Stefan Reinauer <stepan@coresystems.de>
5 *
6 * Copyright (C) 2006 AMD
7 * Written by Yinghai Lu <yinghailu@gmail.com> for AMD.
8 *
9 * Copyright (C) 2006 MSI
10 * Written by Bingxun Shi <bingxunshi@gmail.com> for MSI.
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
Bingxun Shifb1fddb2007-02-09 00:26:10 +000021 */
22
23/*
24 * MSI ms9282 needs a different resource map
25 *
26 */
27
28static void setup_ms9282_resource_map(void)
29{
Elyes HAOUASd36905c2014-07-23 09:23:29 +020030 static const unsigned int register_values[] = {
Bingxun Shifb1fddb2007-02-09 00:26:10 +000031#if 1
Elyes HAOUASd36905c2014-07-23 09:23:29 +020032 /* Careful set limit registers before base registers which contain the enables */
33 /* DRAM Limit i Registers
34 * F1:0x44 i = 0
35 * F1:0x4C i = 1
36 * F1:0x54 i = 2
37 * F1:0x5C i = 3
38 * F1:0x64 i = 4
39 * F1:0x6C i = 5
40 * F1:0x74 i = 6
41 * F1:0x7C i = 7
42 * [ 2: 0] Destination Node ID
43 * 000 = Node 0
44 * 001 = Node 1
45 * 010 = Node 2
46 * 011 = Node 3
47 * 100 = Node 4
48 * 101 = Node 5
49 * 110 = Node 6
50 * 111 = Node 7
51 * [ 7: 3] Reserved
52 * [10: 8] Interleave select
53 * specifies the values of A[14:12] to use with interleave enable.
54 * [15:11] Reserved
55 * [31:16] DRAM Limit Address i Bits 39-24
56 * This field defines the upper address bits of a 40 bit address
57 * that define the end of the DRAM region.
58 */
59 PCI_ADDR(0, 0x18, 1, 0x44), 0x0000f8f8, 0x00000000,
60 PCI_ADDR(0, 0x18, 1, 0x4C), 0x0000f8f8, 0x00000001,
61 PCI_ADDR(0, 0x18, 1, 0x54), 0x0000f8f8, 0x00000002,
62 PCI_ADDR(0, 0x18, 1, 0x5C), 0x0000f8f8, 0x00000003,
63 PCI_ADDR(0, 0x18, 1, 0x64), 0x0000f8f8, 0x00000004,
64 PCI_ADDR(0, 0x18, 1, 0x6C), 0x0000f8f8, 0x00000005,
65 PCI_ADDR(0, 0x18, 1, 0x74), 0x0000f8f8, 0x00000006,
66 PCI_ADDR(0, 0x18, 1, 0x7C), 0x0000f8f8, 0x00000007,
67 /* DRAM Base i Registers
68 * F1:0x40 i = 0
69 * F1:0x48 i = 1
70 * F1:0x50 i = 2
71 * F1:0x58 i = 3
72 * F1:0x60 i = 4
73 * F1:0x68 i = 5
74 * F1:0x70 i = 6
75 * F1:0x78 i = 7
76 * [ 0: 0] Read Enable
77 * 0 = Reads Disabled
78 * 1 = Reads Enabled
79 * [ 1: 1] Write Enable
80 * 0 = Writes Disabled
81 * 1 = Writes Enabled
82 * [ 7: 2] Reserved
83 * [10: 8] Interleave Enable
84 * 000 = No interleave
85 * 001 = Interleave on A[12] (2 nodes)
86 * 010 = reserved
87 * 011 = Interleave on A[12] and A[14] (4 nodes)
88 * 100 = reserved
89 * 101 = reserved
90 * 110 = reserved
91 * 111 = Interleve on A[12] and A[13] and A[14] (8 nodes)
92 * [15:11] Reserved
93 * [13:16] DRAM Base Address i Bits 39-24
94 * This field defines the upper address bits of a 40-bit address
95 * that define the start of the DRAM region.
96 */
97 PCI_ADDR(0, 0x18, 1, 0x40), 0x0000f8fc, 0x00000000,
98 PCI_ADDR(0, 0x18, 1, 0x48), 0x0000f8fc, 0x00000000,
99 PCI_ADDR(0, 0x18, 1, 0x50), 0x0000f8fc, 0x00000000,
100 PCI_ADDR(0, 0x18, 1, 0x58), 0x0000f8fc, 0x00000000,
101 PCI_ADDR(0, 0x18, 1, 0x60), 0x0000f8fc, 0x00000000,
102 PCI_ADDR(0, 0x18, 1, 0x68), 0x0000f8fc, 0x00000000,
103 PCI_ADDR(0, 0x18, 1, 0x70), 0x0000f8fc, 0x00000000,
104 PCI_ADDR(0, 0x18, 1, 0x78), 0x0000f8fc, 0x00000000,
Bingxun Shifb1fddb2007-02-09 00:26:10 +0000105#endif
106#if 1
107
Elyes HAOUASd36905c2014-07-23 09:23:29 +0200108 /* Memory-Mapped I/O Limit i Registers
109 * F1:0x84 i = 0
110 * F1:0x8C i = 1
111 * F1:0x94 i = 2
112 * F1:0x9C i = 3
113 * F1:0xA4 i = 4
114 * F1:0xAC i = 5
115 * F1:0xB4 i = 6
116 * F1:0xBC i = 7
117 * [ 2: 0] Destination Node ID
118 * 000 = Node 0
119 * 001 = Node 1
120 * 010 = Node 2
121 * 011 = Node 3
122 * 100 = Node 4
123 * 101 = Node 5
124 * 110 = Node 6
125 * 111 = Node 7
126 * [ 3: 3] Reserved
127 * [ 5: 4] Destination Link ID
128 * 00 = Link 0
129 * 01 = Link 1
130 * 10 = Link 2
131 * 11 = Reserved
132 * [ 6: 6] Reserved
133 * [ 7: 7] Non-Posted
134 * 0 = CPU writes may be posted
135 * 1 = CPU writes must be non-posted
136 * [31: 8] Memory-Mapped I/O Limit Address i (39-16)
137 * This field defines the upp adddress bits of a 40-bit address that
138 * defines the end of a memory-mapped I/O region n
139 */
140 PCI_ADDR(0, 0x18, 1, 0x84), 0x00000048, 0x00000000,
141 PCI_ADDR(0, 0x18, 1, 0x8C), 0x00000048, 0x00000000,
142 PCI_ADDR(0, 0x18, 1, 0x94), 0x00000048, 0x00000000,
143 PCI_ADDR(0, 0x18, 1, 0x9C), 0x00000048, 0x00000000,
144 PCI_ADDR(0, 0x18, 1, 0xA4), 0x00000048, 0x00000000,
145 PCI_ADDR(0, 0x18, 1, 0xAC), 0x00000048, 0x00000000,
146 PCI_ADDR(0, 0x18, 1, 0xB4), 0x00000048, 0x00000000,
147// PCI_ADDR(0, 0x18, 1, 0xBC), 0x00000048, 0x00ffff00,
Bingxun Shifb1fddb2007-02-09 00:26:10 +0000148
Elyes HAOUASd36905c2014-07-23 09:23:29 +0200149 /* Memory-Mapped I/O Base i Registers
150 * F1:0x80 i = 0
151 * F1:0x88 i = 1
152 * F1:0x90 i = 2
153 * F1:0x98 i = 3
154 * F1:0xA0 i = 4
155 * F1:0xA8 i = 5
156 * F1:0xB0 i = 6
157 * F1:0xB8 i = 7
158 * [ 0: 0] Read Enable
159 * 0 = Reads disabled
160 * 1 = Reads Enabled
161 * [ 1: 1] Write Enable
162 * 0 = Writes disabled
163 * 1 = Writes Enabled
164 * [ 2: 2] Cpu Disable
165 * 0 = Cpu can use this I/O range
166 * 1 = Cpu requests do not use this I/O range
167 * [ 3: 3] Lock
168 * 0 = base/limit registers i are read/write
169 * 1 = base/limit registers i are read-only
170 * [ 7: 4] Reserved
171 * [31: 8] Memory-Mapped I/O Base Address i (39-16)
172 * This field defines the upper address bits of a 40bit address
173 * that defines the start of memory-mapped I/O region i
174 */
175 PCI_ADDR(0, 0x18, 1, 0x80), 0x000000f0, 0x00000000,
176 PCI_ADDR(0, 0x18, 1, 0x88), 0x000000f0, 0x00000000,
177 PCI_ADDR(0, 0x18, 1, 0x90), 0x000000f0, 0x00000000,
178 PCI_ADDR(0, 0x18, 1, 0x98), 0x000000f0, 0x00000000,
179 PCI_ADDR(0, 0x18, 1, 0xA0), 0x000000f0, 0x00000000,
180 PCI_ADDR(0, 0x18, 1, 0xA8), 0x000000f0, 0x00000000,
181 PCI_ADDR(0, 0x18, 1, 0xB0), 0x000000f0, 0x00000000,
182// PCI_ADDR(0, 0x18, 1, 0xB8), 0x000000f0, 0x00fc0003,
Bingxun Shifb1fddb2007-02-09 00:26:10 +0000183#endif
184#if 1
185
Elyes HAOUASd36905c2014-07-23 09:23:29 +0200186 /* PCI I/O Limit i Registers
187 * F1:0xC4 i = 0
188 * F1:0xCC i = 1
189 * F1:0xD4 i = 2
190 * F1:0xDC i = 3
191 * [ 2: 0] Destination Node ID
192 * 000 = Node 0
193 * 001 = Node 1
194 * 010 = Node 2
195 * 011 = Node 3
196 * 100 = Node 4
197 * 101 = Node 5
198 * 110 = Node 6
199 * 111 = Node 7
200 * [ 3: 3] Reserved
201 * [ 5: 4] Destination Link ID
202 * 00 = Link 0
203 * 01 = Link 1
204 * 10 = Link 2
205 * 11 = reserved
206 * [11: 6] Reserved
207 * [24:12] PCI I/O Limit Address i
208 * This field defines the end of PCI I/O region n
209 * [31:25] Reserved
210 */
211 PCI_ADDR(0, 0x18, 1, 0xC4), 0xFE000FC8, 0x01fff000,
212 PCI_ADDR(0, 0x18, 1, 0xCC), 0xFE000FC8, 0x00000000,
213 PCI_ADDR(0, 0x18, 1, 0xD4), 0xFE000FC8, 0x00000000,
214 PCI_ADDR(0, 0x18, 1, 0xDC), 0xFE000FC8, 0x00000000,
Bingxun Shifb1fddb2007-02-09 00:26:10 +0000215
Elyes HAOUASd36905c2014-07-23 09:23:29 +0200216 /* PCI I/O Base i Registers
217 * F1:0xC0 i = 0
218 * F1:0xC8 i = 1
219 * F1:0xD0 i = 2
220 * F1:0xD8 i = 3
221 * [ 0: 0] Read Enable
222 * 0 = Reads Disabled
223 * 1 = Reads Enabled
224 * [ 1: 1] Write Enable
225 * 0 = Writes Disabled
226 * 1 = Writes Enabled
227 * [ 3: 2] Reserved
228 * [ 4: 4] VGA Enable
229 * 0 = VGA matches Disabled
230 * 1 = matches all address < 64K and where A[9:0] is in the
231 * range 3B0-3BB or 3C0-3DF independen of the base & limit registers
232 * [ 5: 5] ISA Enable
233 * 0 = ISA matches Disabled
234 * 1 = Blocks address < 64K and in the last 768 bytes of eack 1K block
235 * from matching agains this base/limit pair
236 * [11: 6] Reserved
237 * [24:12] PCI I/O Base i
238 * This field defines the start of PCI I/O region n
239 * [31:25] Reserved
240 */
241 PCI_ADDR(0, 0x18, 1, 0xC0), 0xFE000FCC, 0x00000033,
242 PCI_ADDR(0, 0x18, 1, 0xC8), 0xFE000FCC, 0x00000000,
243 PCI_ADDR(0, 0x18, 1, 0xD0), 0xFE000FCC, 0x00000000,
244 PCI_ADDR(0, 0x18, 1, 0xD8), 0xFE000FCC, 0x00000000,
Bingxun Shifb1fddb2007-02-09 00:26:10 +0000245#endif
Elyes HAOUASd36905c2014-07-23 09:23:29 +0200246 /* Config Base and Limit i Registers
247 * F1:0xE0 i = 0
248 * F1:0xE4 i = 1
249 * F1:0xE8 i = 2
250 * F1:0xEC i = 3
251 * [ 0: 0] Read Enable
252 * 0 = Reads Disabled
253 * 1 = Reads Enabled
254 * [ 1: 1] Write Enable
255 * 0 = Writes Disabled
256 * 1 = Writes Enabled
257 * [ 2: 2] Device Number Compare Enable
258 * 0 = The ranges are based on bus number
259 * 1 = The ranges are ranges of devices on bus 0
260 * [ 3: 3] Reserved
261 * [ 6: 4] Destination Node
262 * 000 = Node 0
263 * 001 = Node 1
264 * 010 = Node 2
265 * 011 = Node 3
266 * 100 = Node 4
267 * 101 = Node 5
268 * 110 = Node 6
269 * 111 = Node 7
270 * [ 7: 7] Reserved
271 * [ 9: 8] Destination Link
272 * 00 = Link 0
273 * 01 = Link 1
274 * 10 = Link 2
275 * 11 - Reserved
276 * [15:10] Reserved
277 * [23:16] Bus Number Base i
278 * This field defines the lowest bus number in configuration region i
279 * [31:24] Bus Number Limit i
280 * This field defines the highest bus number in configuration region i
281 */
Bingxun Shifb1fddb2007-02-09 00:26:10 +0000282#if 1
Elyes HAOUASd36905c2014-07-23 09:23:29 +0200283// PCI_ADDR(0, 0x18, 1, 0xE0), 0x0000FC88, 0x07000003,
284// PCI_ADDR(0, 0x18, 1, 0xE4), 0x0000FC88, 0x7f080203,
285 PCI_ADDR(0, 0x18, 1, 0xE8), 0x0000FC88, 0x00000000,
286 PCI_ADDR(0, 0x18, 1, 0xEC), 0x0000FC88, 0x00000000,
Bingxun Shifb1fddb2007-02-09 00:26:10 +0000287#endif
288
Elyes HAOUASd36905c2014-07-23 09:23:29 +0200289 };
Bingxun Shifb1fddb2007-02-09 00:26:10 +0000290
Elyes HAOUASd36905c2014-07-23 09:23:29 +0200291 int max;
292 max = ARRAY_SIZE(register_values);
293 setup_resource_map(register_values, max);
Bingxun Shifb1fddb2007-02-09 00:26:10 +0000294}