1 #define COHERENT_AMD_SOLO 1 /* AMD Solo motherboard */
2 #define COHERENT_ARIMA_HDAMA 2 /* Arima HDAMA motherboard */
4 #ifndef COHERENT_CONFIG
5 #define COHERENT_CONFIG COHERENT_AMD_SOLO
9 static void setup_coherent_ht_domain(void)
11 static const unsigned int register_values[] = {
12 /* Routing Table Node i
21 * [ 0: 3] Request Route
22 * [0] Route to this node
26 * [11: 8] Response Route
27 * [0] Route to this node
31 * [19:16] Broadcast route
32 * [0] Route to this node
37 PCI_ADDR(0, 0x18, 0, 0x40), 0xfff0f0f0, 0x00010101,
38 PCI_ADDR(0, 0x18, 0, 0x44), 0xfff0f0f0, 0x00010101,
39 PCI_ADDR(0, 0x18, 0, 0x48), 0xfff0f0f0, 0x00010101,
40 PCI_ADDR(0, 0x18, 0, 0x4c), 0xfff0f0f0, 0x00010101,
41 PCI_ADDR(0, 0x18, 0, 0x50), 0xfff0f0f0, 0x00010101,
42 PCI_ADDR(0, 0x18, 0, 0x54), 0xfff0f0f0, 0x00010101,
43 PCI_ADDR(0, 0x18, 0, 0x58), 0xfff0f0f0, 0x00010101,
44 PCI_ADDR(0, 0x18, 0, 0x5c), 0xfff0f0f0, 0x00010101,
46 /* Hypetransport Transaction Control Register
48 * [ 0: 0] Disable read byte probe
50 * 1 = Probes not issued
51 * [ 1: 1] Disable Read Doubleword probe
53 * 1 = Probes not issued
54 * [ 2: 2] Disable write byte probes
56 * 1 = Probes not issued
57 * [ 3: 3] Disable Write Doubleword Probes
59 * 1 = Probes not issued.
60 * [ 4: 4] Disable Memroy Controller Target Start
61 * 0 = TgtStart packets are generated
62 * 1 = TgtStart packets are not generated.
64 * 0 = Second CPU disabled or not present
65 * 1 = Second CPU enabled.
66 * [ 6: 6] CPU Request PassPW
67 * 0 = CPU requests do not pass posted writes
68 * 1 = CPU requests pass posted writes.
69 * [ 7: 7] CPU read Respons PassPW
70 * 0 = CPU Responses do not pass posted writes
71 * 1 = CPU responses pass posted writes.
72 * [ 8: 8] Disable Probe Memory Cancel
73 * 0 = Probes may generate MemCancels
74 * 1 = Probes may not generate MemCancels
75 * [ 9: 9] Disable Remote Probe Memory Cancel.
76 * 0 = Probes hitting dirty blocks generate memory cancel packets
77 * 1 = Only probed caches on the same node as the memory controller
78 * generate cancel packets.
79 * [10:10] Disable Fill Probe
80 * 0 = Probes issued for cache fills
81 * 1 = Probes not issued for cache fills.
82 * [11:11] Response PassPw
83 * 0 = Downstream response PassPW based on original request
84 * 1 = Downstream response PassPW set to 1
85 * [12:12] Change ISOC to Ordered
86 * 0 = Bit 1 of coherent HT RdSz/WrSz command used for iosynchronous prioritization
87 * 1 = Bit 1 of coherent HT RdSz/WrSz command used for ordering.
88 * [14:13] Buffer Release Priority select
93 * [15:15] Limit Coherent HT Configuration Space Range
94 * 0 = No coherent HT configuration space restrictions
95 * 1 = Limit coherent HT configuration space based on node count
96 * [16:16] Local Interrupt Conversion Enable.
97 * 0 = ExtInt/NMI interrups unaffected.
98 * 1 = ExtInt/NMI broadcat interrupts converted to LINT0/1
99 * [17:17] APIC Extended Broadcast Enable.
100 * 0 = APIC broadcast is 0F
101 * 1 = APIC broadcast is FF
102 * [18:18] APIC Extended ID Enable
103 * 0 = APIC ID is 4 bits.
104 * 1 = APIC ID is 8 bits.
105 * [19:19] APIC Extended Spurious Vector Enable
106 * 0 = Lower 4 bits of spurious vector are read-only 1111
107 * 1 = Lower 4 bits of spurious vecotr are writeable.
108 * [20:20] Sequence ID Source Node Enable
109 * 0 = Normal operation
110 * 1 = Keep SeqID on routed packets for debugging.
111 * [22:21] Downstream non-posted request limit
117 * [25:24] Medium-Priority Bypass Count
118 * - Maximum # of times a medium priority access can pass a low
119 * priority access before Medium-Priority mode is disabled for one access.
120 * [27:26] High-Priority Bypass Count
121 * - Maximum # of times a high prioirty access can pass a medium or low
122 * priority access before High-prioirty mode is disabled for one access.
123 * [28:28] Enable High Priority CPU Reads
124 * 0 = Cpu reads are medium prioirty
125 * 1 = Cpu reads are high prioirty
126 * [29:29] Disable Low Priority Writes
127 * 0 = Non-isochronous writes are low priority
128 * 1 = Non-isochronous writes are medium prioirty
129 * [30:30] Disable High Priority Isochronous writes
130 * 0 = Isochronous writes are high priority
131 * 1 = Isochronous writes are medium priority
132 * [31:31] Disable Medium Priority Isochronous writes
133 * 0 = Isochronous writes are medium are high
134 * 1 = With bit 30 set makes Isochrouns writes low priority.
136 PCI_ADDR(0, 0x18, 0, 0x68), 0x00800000, 0x0f00840f,
137 /* HT Initialization Control Register
139 * [ 0: 0] Routing Table Disable
140 * 0 = Packets are routed according to routing tables
141 * 1 = Packets are routed according to the default link field
142 * [ 1: 1] Request Disable (BSP should clear this)
143 * 0 = Request packets may be generated
144 * 1 = Request packets may not be generated.
145 * [ 3: 2] Default Link (Read-only)
149 * 11 = CPU on same node
151 * - Scratch bit cleared by a cold reset
152 * [ 5: 5] BIOS Reset Detect
153 * - Scratch bit cleared by a cold reset
154 * [ 6: 6] INIT Detect
155 * - Scratch bit cleared by a warm or cold reset not by an INIT
158 PCI_ADDR(0, 0x18, 0, 0x6C), 0xffffff8c, 0x00000000 | (1 << 6) |(1 << 5)| (1 << 4),
159 /* LDTi Capabilities Registers
164 /* LDTi Link Control Registrs
168 * [ 1: 1] CRC Flood Enable
169 * 0 = Do not generate sync packets on CRC error
170 * 1 = Generate sync packets on CRC error
171 * [ 2: 2] CRC Start Test (Read-Only)
172 * [ 3: 3] CRC Force Frame Error
173 * 0 = Do not generate bad CRC
174 * 1 = Generate bad CRC
175 * [ 4: 4] Link Failure
176 * 0 = No link failure detected
177 * 1 = Link failure detected
178 * [ 5: 5] Initialization Complete
179 * 0 = Initialization not complete
180 * 1 = Initialization complete
181 * [ 6: 6] Receiver off
184 * [ 7: 7] Transmitter Off
186 * 1 = Transmitter off
189 * [0] = 1 Error on byte lane 0
190 * [1] = 1 Error on byte lane 1
191 * [12:12] Isochrnous Enable (Read-Only)
192 * [13:13] HT Stop Tristate Enable
193 * 0 = Driven during an LDTSTOP_L
194 * 1 = Tristated during and LDTSTOP_L
195 * [14:14] Extended CTL Time
196 * 0 = CTL is asserted for 16 bit times during link initialization
197 * 1 = CTL is asserted for 50us during link initialization
198 * [18:16] Max Link Width In (Read-Only?)
201 * [19:19] Doubleword Flow Control in (Read-Only)
202 * 0 = This link does not support doubleword flow control
203 * 1 = This link supports doubleword flow control
204 * [22:20] Max Link Width Out (Read-Only?)
207 * [23:23] Doubleworld Flow Control out (Read-Only)
208 * 0 = This link does not support doubleword flow control
209 * 1 = This link supports doubleworkd flow control
210 * [26:24] Link Width In
218 * 111 = Link physically not connected
219 * [27:27] Doubleword Flow Control In Enable
220 * 0 = Doubleword flow control disabled
221 * 1 = Doubleword flow control enabled (Not currently supported)
222 * [30:28] Link Width Out
230 * 111 = Link physically not connected
231 * [31:31] Doubleworld Flow Control Out Enable
232 * 0 = Doubleworld flow control disabled
233 * 1 = Doubleword flow control enabled (Not currently supported)
235 PCI_ADDR(0, 0x18, 0, 0x84), 0x00009c05, 0x11110020,
236 /* LDTi Frequency/Revision Registers
240 * [ 4: 0] Minor Revision
241 * Contains the HT Minor revision
242 * [ 7: 5] Major Revision
243 * Contains the HT Major revision
244 * [11: 8] Link Frequency (Takes effect the next time the link is reconnected)
261 * [15:12] Error (Not currently Implemented)
262 * [31:16] Indicates the frequency capabilities of the link
263 * [16] = 1 encoding 0000 of freq supported
264 * [17] = 1 encoding 0001 of freq supported
265 * [18] = 1 encoding 0010 of freq supported
266 * [19] = 1 encoding 0011 of freq supported
267 * [20] = 1 encoding 0100 of freq supported
268 * [21] = 1 encoding 0101 of freq supported
269 * [22] = 1 encoding 0110 of freq supported
270 * [23] = 1 encoding 0111 of freq supported
271 * [24] = 1 encoding 1000 of freq supported
272 * [25] = 1 encoding 1001 of freq supported
273 * [26] = 1 encoding 1010 of freq supported
274 * [27] = 1 encoding 1011 of freq supported
275 * [28] = 1 encoding 1100 of freq supported
276 * [29] = 1 encoding 1101 of freq supported
277 * [30] = 1 encoding 1110 of freq supported
278 * [31] = 1 encoding 1111 of freq supported
280 PCI_ADDR(0, 0x18, 0, 0x88), 0xfffff0ff, 0x00000200,
281 /* LDTi Feature Capability
286 /* LDTi Buffer Count Registers
291 /* LDTi Bus Number Registers
295 * For NonCoherent HT specifies the bus number downstream (behind the host bridge)
296 * [ 0: 7] Primary Bus Number
297 * [15: 8] Secondary Bus Number
298 * [23:15] Subordiante Bus Number
301 PCI_ADDR(0, 0x18, 0, 0x94), 0xff000000, 0x00ff0000,
302 /* LDTi Type Registers
310 print_debug("setting up coherent ht domain....\r\n");
311 max = sizeof(register_values)/sizeof(register_values[0]);
312 for(i = 0; i < max; i += 3) {
317 print_debug_hex32(register_values[i]);
319 print_debug_hex32(register_values[i+2]);
322 dev = register_values[i] & ~0xff;
323 where = register_values[i] & 0xff;
324 reg = pci_read_config32(dev, where);
325 reg &= register_values[i+1];
326 reg |= register_values[i+2];
327 pci_write_config32(dev, where, reg);
329 reg = pci_read_config32(register_values[i]);
330 reg &= register_values[i+1];
331 reg |= register_values[i+2] & ~register_values[i+1];
332 pci_write_config32(register_values[i], reg);
335 print_debug("done.\r\n");