- Factoring of auto.c
[coreboot.git] / src / northbridge / amd / amdk8 / coherent_ht.c
1 static void setup_coherent_ht_domain(void)
2 {
3         static const unsigned int register_values[] = {
4         /* Routing Table Node i 
5          * F0:0x40 i = 0, 
6          * F0:0x44 i = 1,
7          * F0:0x48 i = 2, 
8          * F0:0x4c i = 3,
9          * F0:0x50 i = 4, 
10          * F0:0x54 i = 5,
11          * F0:0x58 i = 6, 
12          * F0:0x5c i = 7
13          * [ 0: 3] Request Route
14          *     [0] Route to this node
15          *     [1] Route to Link 0
16          *     [2] Route to Link 1
17          *     [3] Route to Link 2
18          * [11: 8] Response Route
19          *     [0] Route to this node
20          *     [1] Route to Link 0
21          *     [2] Route to Link 1
22          *     [3] Route to Link 2
23          * [19:16] Broadcast route
24          *     [0] Route to this node
25          *     [1] Route to Link 0
26          *     [2] Route to Link 1
27          *     [3] Route to Link 2
28          */
29         PCI_ADDR(0, 0x18, 0, 0x40), 0xfff0f0f0, 0x00010101,
30         PCI_ADDR(0, 0x18, 0, 0x44), 0xfff0f0f0, 0x00010101,
31         PCI_ADDR(0, 0x18, 0, 0x48), 0xfff0f0f0, 0x00010101,
32         PCI_ADDR(0, 0x18, 0, 0x4c), 0xfff0f0f0, 0x00010101,
33         PCI_ADDR(0, 0x18, 0, 0x50), 0xfff0f0f0, 0x00010101,
34         PCI_ADDR(0, 0x18, 0, 0x54), 0xfff0f0f0, 0x00010101,
35         PCI_ADDR(0, 0x18, 0, 0x58), 0xfff0f0f0, 0x00010101,
36         PCI_ADDR(0, 0x18, 0, 0x5c), 0xfff0f0f0, 0x00010101,
37
38         /* Hypetransport Transaction Control Register 
39          * F0:0x68
40          * [ 0: 0] Disable read byte probe
41          *         0 = Probes issues
42          *         1 = Probes not issued
43          * [ 1: 1] Disable Read Doubleword probe
44          *         0 = Probes issued
45          *         1 = Probes not issued
46          * [ 2: 2] Disable write byte probes
47          *         0 = Probes issued
48          *         1 = Probes not issued
49          * [ 3: 3] Disable Write Doubleword Probes
50          *         0 = Probes issued
51          *         1 = Probes not issued.
52          * [ 4: 4] Disable Memroy Controller Target Start
53          *         0 = TgtStart packets are generated
54          *         1 = TgtStart packets are not generated.
55          * [ 5: 5] CPU1 Enable
56          *         0 = Second CPU disabled or not present
57          *         1 = Second CPU enabled.
58          * [ 6: 6] CPU Request PassPW
59          *         0 = CPU requests do not pass posted writes
60          *         1 = CPU requests pass posted writes.
61          * [ 7: 7] CPU read Respons PassPW
62          *         0 = CPU Responses do not pass posted writes
63          *         1 = CPU responses pass posted writes.
64          * [ 8: 8] Disable Probe Memory Cancel
65          *         0 = Probes may generate MemCancels
66          *         1 = Probes may not generate MemCancels
67          * [ 9: 9] Disable Remote Probe Memory Cancel.
68          *         0 = Probes hitting dirty blocks generate memory cancel packets
69          *         1 = Only probed caches on the same node as the memory controller
70          *              generate cancel packets.
71          * [10:10] Disable Fill Probe
72          *         0 = Probes issued for cache fills
73          *         1 = Probes not issued for cache fills.
74          * [11:11] Response PassPw
75          *         0 = Downstream response PassPW based on original request
76          *         1 = Downstream response PassPW set to 1
77          * [12:12] Change ISOC to Ordered
78          *         0 = Bit 1 of coherent HT RdSz/WrSz command used for iosynchronous prioritization
79          *         1 = Bit 1 of coherent HT RdSz/WrSz command used for ordering.
80          * [14:13] Buffer Release Priority select 
81          *         00 = 64
82          *         01 = 16
83          *         10 = 8
84          *         11 = 2
85          * [15:15] Limit Coherent HT Configuration Space Range
86          *         0 = No coherent HT configuration space restrictions
87          *         1 = Limit coherent HT configuration space based on node count
88          * [16:16] Local Interrupt Conversion Enable.
89          *         0 = ExtInt/NMI interrups unaffected.
90          *         1 = ExtInt/NMI broadcat interrupts converted to LINT0/1
91          * [17:17] APIC Extended Broadcast Enable.
92          *         0 = APIC broadcast is 0F
93          *         1 = APIC broadcast is FF
94          * [18:18] APIC Extended ID Enable
95          *         0 = APIC ID is 4 bits.
96          *         1 = APIC ID is 8 bits.
97          * [19:19] APIC Extended Spurious Vector Enable
98          *         0 = Lower 4 bits of spurious vector are read-only 1111
99          *         1 = Lower 4 bits of spurious vecotr are writeable.
100          * [20:20] Sequence ID Source Node Enable
101          *         0 = Normal operation
102          *         1 = Keep SeqID on routed packets for debugging.
103          * [22:21] Downstream non-posted request limit
104          *         00 = No limit
105          *         01 = Limited to 1
106          *         10 = Limited to 4
107          *         11 = Limited to 8
108          * [23:23] RESERVED
109          * [25:24] Medium-Priority Bypass Count
110          *         - Maximum # of times a medium priority access can pass a low
111          *           priority access before Medium-Priority mode is disabled for one access.
112          * [27:26] High-Priority Bypass Count
113          *         - Maximum # of times a high prioirty access can pass a medium or low
114          *           priority access before High-prioirty mode is disabled for one access.
115          * [28:28] Enable High Priority CPU Reads
116          *         0 = Cpu reads are medium prioirty
117          *         1 = Cpu reads are high prioirty
118          * [29:29] Disable Low Priority Writes
119          *         0 = Non-isochronous writes are low priority
120          *         1 = Non-isochronous writes are medium prioirty
121          * [30:30] Disable High Priority Isochronous writes
122          *         0 = Isochronous writes are high priority
123          *         1 = Isochronous writes are medium priority
124          * [31:31] Disable Medium Priority Isochronous writes
125          *         0 = Isochronous writes are medium are high
126          *         1 = With bit 30 set makes Isochrouns writes low priority.
127          */
128         PCI_ADDR(0, 0x18, 0, 0x68), 0x00800000, 0x0f00840f,
129         /* HT Initialization Control Register
130          * F0:0x6C
131          * [ 0: 0] Routing Table Disable
132          *         0 = Packets are routed according to routing tables
133          *         1 = Packets are routed according to the default link field
134          * [ 1: 1] Request Disable (BSP should clear this)
135          *         0 = Request packets may be generated
136          *         1 = Request packets may not be generated.
137          * [ 3: 2] Default Link (Read-only)
138          *         00 = LDT0
139          *         01 = LDT1
140          *         10 = LDT2
141          *         11 = CPU on same node
142          * [ 4: 4] Cold Reset
143          *         - Scratch bit cleared by a cold reset
144          * [ 5: 5] BIOS Reset Detect
145          *         - Scratch bit cleared by a cold reset
146          * [ 6: 6] INIT Detect
147          *         - Scratch bit cleared by a warm or cold reset not by an INIT
148          *
149          */
150         PCI_ADDR(0, 0x18, 0, 0x6C), 0xffffff8c, 0x00000000 | (1 << 6) |(1 << 5)| (1 << 4),
151         /* LDTi Capabilities Registers
152          * F0:0x80 i = 0,
153          * F0:0xA0 i = 1,
154          * F0:0xC0 i = 2,
155          */
156         /* LDTi Link Control Registrs
157          * F0:0x84 i = 0,
158          * F0:0xA4 i = 1,
159          * F0:0xC4 i = 2,
160          * [ 1: 1] CRC Flood Enable
161          *         0 = Do not generate sync packets on CRC error
162          *         1 = Generate sync packets on CRC error
163          * [ 2: 2] CRC Start Test (Read-Only)
164          * [ 3: 3] CRC Force Frame Error
165          *         0 = Do not generate bad CRC
166          *         1 = Generate bad CRC
167          * [ 4: 4] Link Failure
168          *         0 = No link failure detected
169          *         1 = Link failure detected
170          * [ 5: 5] Initialization Complete
171          *         0 = Initialization not complete
172          *         1 = Initialization complete
173          * [ 6: 6] Receiver off
174          *         0 = Recevier on
175          *         1 = Receiver off
176          * [ 7: 7] Transmitter Off
177          *         0 = Transmitter on
178          *         1 = Transmitter off
179          * [ 9: 8] CRC_Error
180          *         00 = No error
181          *         [0] = 1 Error on byte lane 0
182          *         [1] = 1 Error on byte lane 1
183          * [12:12] Isochrnous Enable  (Read-Only)
184          * [13:13] HT Stop Tristate Enable
185          *         0 = Driven during an LDTSTOP_L
186          *         1 = Tristated during and LDTSTOP_L
187          * [14:14] Extended CTL Time 
188          *         0 = CTL is asserted for 16 bit times during link initialization
189          *         1 = CTL is asserted for 50us during link initialization
190          * [18:16] Max Link Width In (Read-Only?)
191          *         000 = 8 bit link
192          *         001 = 16bit link
193          * [19:19] Doubleword Flow Control in (Read-Only)
194          *         0 = This link does not support doubleword flow control
195          *         1 = This link supports doubleword flow control
196          * [22:20] Max Link Width Out (Read-Only?)
197          *         000 = 8 bit link
198          *         001 = 16bit link
199          * [23:23] Doubleworld Flow Control out (Read-Only)
200          *         0 = This link does not support doubleword flow control
201          *         1 = This link supports doubleworkd flow control
202          * [26:24] Link Width In
203          *         000 = Use 8 bits
204          *         001 = Use 16 bits
205          *         010 = reserved
206          *         011 = Use 32 bits
207          *         100 = Use 2 bits
208          *         101 = Use 4 bits
209          *         110 = reserved
210          *         111 = Link physically not connected
211          * [27:27] Doubleword Flow Control In Enable
212          *         0 = Doubleword flow control disabled
213          *         1 = Doubleword flow control enabled (Not currently supported)
214          * [30:28] Link Width Out
215          *         000 = Use 8 bits
216          *         001 = Use 16 bits
217          *         010 = reserved
218          *         011 = Use 32 bits
219          *         100 = Use 2 bits
220          *         101 = Use 4 bits
221          *         110 = reserved
222          *         111 = Link physically not connected
223          * [31:31] Doubleworld Flow Control Out Enable
224          *         0 = Doubleworld flow control disabled
225          *         1 = Doubleword flow control enabled (Not currently supported)
226          */
227         PCI_ADDR(0, 0x18, 0, 0x84), 0x00009c05, 0x11110020,
228         /* LDTi Frequency/Revision Registers
229          * F0:0x88 i = 0,
230          * F0:0xA8 i = 1,
231          * F0:0xC8 i = 2,
232          * [ 4: 0] Minor Revision
233          *         Contains the HT Minor revision
234          * [ 7: 5] Major Revision
235          *         Contains the HT Major revision
236          * [11: 8] Link Frequency  (Takes effect the next time the link is reconnected)
237          *         0000 = 200Mhz
238          *         0001 = reserved
239          *         0010 = 400Mhz
240          *         0011 = reserved
241          *         0100 = 600Mhz
242          *         0101 = 800Mhz
243          *         0110 = 1000Mhz
244          *         0111 = reserved
245          *         1000 = reserved
246          *         1001 = reserved
247          *         1010 = reserved
248          *         1011 = reserved
249          *         1100 = reserved
250          *         1101 = reserved
251          *         1110 = reserved
252          *         1111 = 100 Mhz
253          * [15:12] Error (Not currently Implemented)
254          * [31:16] Indicates the frequency capabilities of the link
255          *         [16] = 1 encoding 0000 of freq supported
256          *         [17] = 1 encoding 0001 of freq supported
257          *         [18] = 1 encoding 0010 of freq supported
258          *         [19] = 1 encoding 0011 of freq supported
259          *         [20] = 1 encoding 0100 of freq supported
260          *         [21] = 1 encoding 0101 of freq supported
261          *         [22] = 1 encoding 0110 of freq supported
262          *         [23] = 1 encoding 0111 of freq supported
263          *         [24] = 1 encoding 1000 of freq supported
264          *         [25] = 1 encoding 1001 of freq supported
265          *         [26] = 1 encoding 1010 of freq supported
266          *         [27] = 1 encoding 1011 of freq supported
267          *         [28] = 1 encoding 1100 of freq supported
268          *         [29] = 1 encoding 1101 of freq supported
269          *         [30] = 1 encoding 1110 of freq supported
270          *         [31] = 1 encoding 1111 of freq supported
271          */
272         PCI_ADDR(0, 0x18, 0, 0x88), 0xfffff0ff, 0x00000200,
273         /* LDTi Feature Capability
274          * F0:0x8C i = 0,
275          * F0:0xAC i = 1,
276          * F0:0xCC i = 2,
277          */
278         /* LDTi Buffer Count Registers
279          * F0:0x90 i = 0,
280          * F0:0xB0 i = 1,
281          * F0:0xD0 i = 2,
282          */
283         /* LDTi Bus Number Registers
284          * F0:0x94 i = 0,
285          * F0:0xB4 i = 1,
286          * F0:0xD4 i = 2,
287          * For NonCoherent HT specifies the bus number downstream (behind the host bridge)
288          * [ 0: 7] Primary Bus Number
289          * [15: 8] Secondary Bus Number
290          * [23:15] Subordiante Bus Number
291          * [31:24] reserved
292          */
293         PCI_ADDR(0, 0x18, 0, 0x94), 0xff000000, 0x00ff0000,
294         /* LDTi Type Registers
295          * F0:0x98 i = 0,
296          * F0:0xB8 i = 1,
297          * F0:0xD8 i = 2,
298          */
299         /* Careful set limit registers before base registers which contain the enables */
300         /* DRAM Limit i Registers
301          * F1:0x44 i = 0
302          * F1:0x4C i = 1
303          * F1:0x54 i = 2
304          * F1:0x5C i = 3
305          * F1:0x64 i = 4
306          * F1:0x6C i = 5
307          * F1:0x74 i = 6
308          * F1:0x7C i = 7
309          * [ 2: 0] Destination Node ID
310          *         000 = Node 0
311          *         001 = Node 1
312          *         010 = Node 2
313          *         011 = Node 3
314          *         100 = Node 4
315          *         101 = Node 5
316          *         110 = Node 6
317          *         111 = Node 7
318          * [ 7: 3] Reserved
319          * [10: 8] Interleave select
320          *         specifies the values of A[14:12] to use with interleave enable.
321          * [15:11] Reserved
322          * [31:16] DRAM Limit Address i Bits 39-24
323          *         This field defines the upper address bits of a 40 bit  address
324          *         that define the end of the DRAM region.
325          */
326 #if MEMORY_1024MB
327         PCI_ADDR(0, 0x18, 1, 0x44), 0x0000f8f8, 0x003f0000,
328 #endif
329 #if MEMORY_512MB
330         PCI_ADDR(0, 0x18, 1, 0x44), 0x0000f8f8, 0x001f0000,
331 #endif
332         PCI_ADDR(0, 0x18, 1, 0x4C), 0x0000f8f8, 0x00000001,
333         PCI_ADDR(0, 0x18, 1, 0x54), 0x0000f8f8, 0x00000002,
334         PCI_ADDR(0, 0x18, 1, 0x5C), 0x0000f8f8, 0x00000003,
335         PCI_ADDR(0, 0x18, 1, 0x64), 0x0000f8f8, 0x00000004,
336         PCI_ADDR(0, 0x18, 1, 0x6C), 0x0000f8f8, 0x00000005,
337         PCI_ADDR(0, 0x18, 1, 0x74), 0x0000f8f8, 0x00000006,
338         PCI_ADDR(0, 0x18, 1, 0x7C), 0x0000f8f8, 0x00000007,
339         /* DRAM Base i Registers
340          * F1:0x40 i = 0
341          * F1:0x48 i = 1
342          * F1:0x50 i = 2
343          * F1:0x58 i = 3
344          * F1:0x60 i = 4
345          * F1:0x68 i = 5
346          * F1:0x70 i = 6
347          * F1:0x78 i = 7
348          * [ 0: 0] Read Enable
349          *         0 = Reads Disabled
350          *         1 = Reads Enabled
351          * [ 1: 1] Write Enable
352          *         0 = Writes Disabled
353          *         1 = Writes Enabled
354          * [ 7: 2] Reserved
355          * [10: 8] Interleave Enable
356          *         000 = No interleave
357          *         001 = Interleave on A[12] (2 nodes)
358          *         010 = reserved
359          *         011 = Interleave on A[12] and A[14] (4 nodes)
360          *         100 = reserved
361          *         101 = reserved
362          *         110 = reserved
363          *         111 = Interleve on A[12] and A[13] and A[14] (8 nodes)
364          * [15:11] Reserved
365          * [13:16] DRAM Base Address i Bits 39-24
366          *         This field defines the upper address bits of a 40-bit address
367          *         that define the start of the DRAM region.
368          */
369         PCI_ADDR(0, 0x18, 1, 0x40), 0x0000f8fc, 0x00000003,
370 #if MEMORY_1024MB
371         PCI_ADDR(0, 0x18, 1, 0x48), 0x0000f8fc, 0x00400000,
372         PCI_ADDR(0, 0x18, 1, 0x50), 0x0000f8fc, 0x00400000,
373         PCI_ADDR(0, 0x18, 1, 0x58), 0x0000f8fc, 0x00400000,
374         PCI_ADDR(0, 0x18, 1, 0x60), 0x0000f8fc, 0x00400000,
375         PCI_ADDR(0, 0x18, 1, 0x68), 0x0000f8fc, 0x00400000,
376         PCI_ADDR(0, 0x18, 1, 0x70), 0x0000f8fc, 0x00400000,
377         PCI_ADDR(0, 0x18, 1, 0x78), 0x0000f8fc, 0x00400000,
378 #endif
379 #if MEMORY_512MB
380         PCI_ADDR(0, 0x18, 1, 0x48), 0x0000f8fc, 0x00200000,
381         PCI_ADDR(0, 0x18, 1, 0x50), 0x0000f8fc, 0x00200000,
382         PCI_ADDR(0, 0x18, 1, 0x58), 0x0000f8fc, 0x00200000,
383         PCI_ADDR(0, 0x18, 1, 0x60), 0x0000f8fc, 0x00200000,
384         PCI_ADDR(0, 0x18, 1, 0x68), 0x0000f8fc, 0x00200000,
385         PCI_ADDR(0, 0x18, 1, 0x70), 0x0000f8fc, 0x00200000,
386         PCI_ADDR(0, 0x18, 1, 0x78), 0x0000f8fc, 0x00200000,
387 #endif
388
389         /* Memory-Mapped I/O Limit i Registers
390          * F1:0x84 i = 0
391          * F1:0x8C i = 1
392          * F1:0x94 i = 2
393          * F1:0x9C i = 3
394          * F1:0xA4 i = 4
395          * F1:0xAC i = 5
396          * F1:0xB4 i = 6
397          * F1:0xBC i = 7
398          * [ 2: 0] Destination Node ID
399          *         000 = Node 0
400          *         001 = Node 1
401          *         010 = Node 2
402          *         011 = Node 3
403          *         100 = Node 4
404          *         101 = Node 5
405          *         110 = Node 6
406          *         111 = Node 7
407          * [ 3: 3] Reserved
408          * [ 5: 4] Destination Link ID
409          *         00 = Link 0
410          *         01 = Link 1
411          *         10 = Link 2
412          *         11 = Reserved
413          * [ 6: 6] Reserved
414          * [ 7: 7] Non-Posted
415          *         0 = CPU writes may be posted
416          *         1 = CPU writes must be non-posted
417          * [31: 8] Memory-Mapped I/O Limit Address i (39-16)
418          *         This field defines the upp adddress bits of a 40-bit address that
419          *         defines the end of a memory-mapped I/O region n
420          */
421         PCI_ADDR(0, 0x18, 1, 0x84), 0x00000048, 0x00e1ff00,
422         PCI_ADDR(0, 0x18, 1, 0x8C), 0x00000048, 0x00dfff00,
423         PCI_ADDR(0, 0x18, 1, 0x94), 0x00000048, 0x00e3ff00,
424         PCI_ADDR(0, 0x18, 1, 0x9C), 0x00000048, 0x00000000,
425         PCI_ADDR(0, 0x18, 1, 0xA4), 0x00000048, 0x00000000,
426         PCI_ADDR(0, 0x18, 1, 0xAC), 0x00000048, 0x00000000,
427         PCI_ADDR(0, 0x18, 1, 0xB4), 0x00000048, 0x00000b00,
428         PCI_ADDR(0, 0x18, 1, 0xBC), 0x00000048, 0x00fe0b00,
429
430         /* Memory-Mapped I/O Base i Registers
431          * F1:0x80 i = 0
432          * F1:0x88 i = 1
433          * F1:0x90 i = 2
434          * F1:0x98 i = 3
435          * F1:0xA0 i = 4
436          * F1:0xA8 i = 5
437          * F1:0xB0 i = 6
438          * F1:0xB8 i = 7
439          * [ 0: 0] Read Enable
440          *         0 = Reads disabled
441          *         1 = Reads Enabled
442          * [ 1: 1] Write Enable
443          *         0 = Writes disabled
444          *         1 = Writes Enabled
445          * [ 2: 2] Cpu Disable
446          *         0 = Cpu can use this I/O range
447          *         1 = Cpu requests do not use this I/O range
448          * [ 3: 3] Lock
449          *         0 = base/limit registers i are read/write
450          *         1 = base/limit registers i are read-only
451          * [ 7: 4] Reserved
452          * [31: 8] Memory-Mapped I/O Base Address i (39-16)
453          *         This field defines the upper address bits of a 40bit address 
454          *         that defines the start of memory-mapped I/O region i
455          */
456         PCI_ADDR(0, 0x18, 1, 0x80), 0x000000f0, 0x00e00003,
457         PCI_ADDR(0, 0x18, 1, 0x88), 0x000000f0, 0x00d80003,
458         PCI_ADDR(0, 0x18, 1, 0x90), 0x000000f0, 0x00e20003,
459         PCI_ADDR(0, 0x18, 1, 0x98), 0x000000f0, 0x00000000,
460         PCI_ADDR(0, 0x18, 1, 0xA0), 0x000000f0, 0x00000000,
461         PCI_ADDR(0, 0x18, 1, 0xA8), 0x000000f0, 0x00000000,
462         PCI_ADDR(0, 0x18, 1, 0xB0), 0x000000f0, 0x00000a03,
463 #if MEMORY_1024MB
464         PCI_ADDR(0, 0x18, 1, 0xB8), 0x000000f0, 0x00400003,
465 #endif
466 #if MEMORY_512MB
467         PCI_ADDR(0, 0x18, 1, 0xB8), 0x000000f0, 0x00200003,
468 #endif
469
470         /* PCI I/O Limit i Registers
471          * F1:0xC4 i = 0
472          * F1:0xCC i = 1
473          * F1:0xD4 i = 2
474          * F1:0xDC i = 3
475          * [ 2: 0] Destination Node ID
476          *         000 = Node 0
477          *         001 = Node 1
478          *         010 = Node 2
479          *         011 = Node 3
480          *         100 = Node 4
481          *         101 = Node 5
482          *         110 = Node 6
483          *         111 = Node 7
484          * [ 3: 3] Reserved
485          * [ 5: 4] Destination Link ID
486          *         00 = Link 0
487          *         01 = Link 1
488          *         10 = Link 2
489          *         11 = reserved
490          * [11: 6] Reserved
491          * [24:12] PCI I/O Limit Address i
492          *         This field defines the end of PCI I/O region n
493          * [31:25] Reserved
494          */
495         PCI_ADDR(0, 0x18, 1, 0xC4), 0xFE000FC8, 0x0000d000,
496         PCI_ADDR(0, 0x18, 1, 0xCC), 0xFE000FC8, 0x000ff000,
497         PCI_ADDR(0, 0x18, 1, 0xD4), 0xFE000FC8, 0x00000000,
498         PCI_ADDR(0, 0x18, 1, 0xDC), 0xFE000FC8, 0x00000000,
499
500         /* PCI I/O Base i Registers
501          * F1:0xC0 i = 0
502          * F1:0xC8 i = 1
503          * F1:0xD0 i = 2
504          * F1:0xD8 i = 3
505          * [ 0: 0] Read Enable
506          *         0 = Reads Disabled
507          *         1 = Reads Enabled
508          * [ 1: 1] Write Enable
509          *         0 = Writes Disabled
510          *         1 = Writes Enabled
511          * [ 3: 2] Reserved
512          * [ 4: 4] VGA Enable
513          *         0 = VGA matches Disabled
514          *         1 = matches all address < 64K and where A[9:0] is in the 
515          *             range 3B0-3BB or 3C0-3DF independen of the base & limit registers
516          * [ 5: 5] ISA Enable
517          *         0 = ISA matches Disabled
518          *         1 = Blocks address < 64K and in the last 768 bytes of eack 1K block
519          *             from matching agains this base/limit pair
520          * [11: 6] Reserved
521          * [24:12] PCI I/O Base i
522          *         This field defines the start of PCI I/O region n 
523          * [31:25] Reserved
524          */
525         PCI_ADDR(0, 0x18, 1, 0xC0), 0xFE000FCC, 0x0000d003,
526         PCI_ADDR(0, 0x18, 1, 0xC8), 0xFE000FCC, 0x00001013,
527         PCI_ADDR(0, 0x18, 1, 0xD0), 0xFE000FCC, 0x00000000,
528         PCI_ADDR(0, 0x18, 1, 0xD8), 0xFE000FCC, 0x00000000,
529
530         /* Config Base and Limit i Registers
531          * F1:0xE0 i = 0
532          * F1:0xE4 i = 1
533          * F1:0xE8 i = 2
534          * F1:0xEC i = 3
535          * [ 0: 0] Read Enable
536          *         0 = Reads Disabled
537          *         1 = Reads Enabled
538          * [ 1: 1] Write Enable
539          *         0 = Writes Disabled
540          *         1 = Writes Enabled
541          * [ 2: 2] Device Number Compare Enable
542          *         0 = The ranges are based on bus number
543          *         1 = The ranges are ranges of devices on bus 0
544          * [ 3: 3] Reserved
545          * [ 6: 4] Destination Node
546          *         000 = Node 0
547          *         001 = Node 1
548          *         010 = Node 2
549          *         011 = Node 3
550          *         100 = Node 4
551          *         101 = Node 5
552          *         110 = Node 6
553          *         111 = Node 7
554          * [ 7: 7] Reserved
555          * [ 9: 8] Destination Link
556          *         00 = Link 0
557          *         01 = Link 1
558          *         10 = Link 2
559          *         11 - Reserved
560          * [15:10] Reserved
561          * [23:16] Bus Number Base i
562          *         This field defines the lowest bus number in configuration region i
563          * [31:24] Bus Number Limit i
564          *         This field defines the highest bus number in configuration regin i
565          */
566         PCI_ADDR(0, 0x18, 1, 0xE0), 0x0000FC88, 0xff000003,
567         PCI_ADDR(0, 0x18, 1, 0xE4), 0x0000FC88, 0x00000000,
568         PCI_ADDR(0, 0x18, 1, 0xE8), 0x0000FC88, 0x00000000,
569         PCI_ADDR(0, 0x18, 1, 0xEC), 0x0000FC88, 0x00000000,
570
571         };
572         int i;
573         int max;
574         print_debug("setting up coherent ht domain....\r\n");
575         max = sizeof(register_values)/sizeof(register_values[0]);
576         for(i = 0; i < max; i += 3) {
577                 unsigned long reg;
578 #if 0
579                 print_debug_hex32(register_values[i]);
580                 print_debug(" <-");
581                 print_debug_hex32(register_values[i+2]);
582                 print_debug("\r\n");
583 #endif
584                 reg = pci_read_config32(register_values[i]);
585                 reg &= register_values[i+1];
586                 reg |= register_values[i+2] & ~register_values[i+1];
587                 pci_write_config32(register_values[i], reg);
588         }
589         print_debug("done.\r\n");
590 }
591