1 static void setup_coherent_ht_domain(void)
3 static const unsigned int register_values[] = {
4 /* Routing Table Node i
13 * [ 0: 3] Request Route
14 * [0] Route to this node
18 * [11: 8] Response Route
19 * [0] Route to this node
23 * [19:16] Broadcast route
24 * [0] Route to this node
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,
38 /* Hypetransport Transaction Control Register
40 * [ 0: 0] Disable read byte probe
42 * 1 = Probes not issued
43 * [ 1: 1] Disable Read Doubleword probe
45 * 1 = Probes not issued
46 * [ 2: 2] Disable write byte probes
48 * 1 = Probes not issued
49 * [ 3: 3] Disable Write Doubleword Probes
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.
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
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
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.
128 PCI_ADDR(0, 0x18, 0, 0x68), 0x00800000, 0x0f00840f,
129 /* HT Initialization Control Register
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)
141 * 11 = CPU on same node
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
150 PCI_ADDR(0, 0x18, 0, 0x6C), 0xffffff8c, 0x00000000 | (1 << 6) |(1 << 5)| (1 << 4),
151 /* LDTi Capabilities Registers
156 /* LDTi Link Control Registrs
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
176 * [ 7: 7] Transmitter Off
178 * 1 = Transmitter off
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?)
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?)
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
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
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)
227 PCI_ADDR(0, 0x18, 0, 0x84), 0x00009c05, 0x11110020,
228 /* LDTi Frequency/Revision Registers
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)
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
272 PCI_ADDR(0, 0x18, 0, 0x88), 0xfffff0ff, 0x00000200,
273 /* LDTi Feature Capability
278 /* LDTi Buffer Count Registers
283 /* LDTi Bus Number Registers
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
293 PCI_ADDR(0, 0x18, 0, 0x94), 0xff000000, 0x00ff0000,
294 /* LDTi Type Registers
302 print_debug("setting up coherent ht domain....\r\n");
303 max = sizeof(register_values)/sizeof(register_values[0]);
304 for(i = 0; i < max; i += 3) {
309 print_debug_hex32(register_values[i]);
311 print_debug_hex32(register_values[i+2]);
314 dev = register_values[i] & ~0xff;
315 where = register_values[i] & 0xff;
316 reg = pci_read_config32(dev, where);
317 reg &= register_values[i+1];
318 reg |= register_values[i+2];
319 pci_write_config32(dev, where, reg);
321 reg = pci_read_config32(register_values[i]);
322 reg &= register_values[i+1];
323 reg |= register_values[i+2] & ~register_values[i+1];
324 pci_write_config32(register_values[i], reg);
327 print_debug("done.\r\n");