1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
|
/*++
Copyright (c) 1990 Microsoft Corporation
Copyright (c) 1994 MOTOROLA, INC. All Rights Reserved. This file
contains copyrighted material. Use of this file is restricted
by the provisions of a Motorola Software License Agreement.
Copyright (c) 1994, 95, 96 International Buisness Machines Corporation.
Module Name:
pxmemctl.c
Abstract:
The module initializes any planar registers.
This module also implements machince check parity error handling.
Author:
Jim Wooldridge (jimw@austin.vnet.ibm.com)
Revision History:
Chris Karamatas (ckaramatas@vnet.ibm.com) - added HalpHandleMemoryError
--*/
#include "halp.h"
#include <pxmemctl.h>
#include "pxidaho.h"
#include "pci.h"
#include "pcip.h"
BOOLEAN
HalpInitPlanar (
VOID
)
{
return TRUE;
}
BOOLEAN
HalpMapPlanarSpace (
VOID
)
/*++
Routine Description:
This routine maps the interrupt acknowledge and error address
spaces for a PowerPC system.
Arguments:
None.
Return Value:
If the initialization is successfully completed, than a value of TRUE
is returned. Otherwise, a value of FALSE is returned.
--*/
{
PHYSICAL_ADDRESS physicalAddress;
//
// Map interrupt control space.
//
physicalAddress.HighPart = 0;
physicalAddress.LowPart = INTERRUPT_PHYSICAL_BASE;
HalpInterruptBase = MmMapIoSpace(physicalAddress,
PAGE_SIZE,
FALSE);
return TRUE;
}
BOOLEAN
HalpMapBusConfigSpace (
VOID
)
/*++
Routine Description:
This routine maps the HAL PCI config
spaces for a PowerPC system.
Arguments:
None.
Return Value:
If the initialization is successfully completed, than a value of TRUE
is returned. Otherwise, a value of FALSE is returned.
--*/
{
HalpPciConfigBase = (PVOID) IO_CONTROL_PHYSICAL_BASE;
return TRUE;
}
BOOLEAN
HalpPhase0MapBusConfigSpace (
VOID
)
/*++
Routine Description:
This routine maps the HAL PCI config
spaces for a PowerPC system.
Arguments:
None.
Return Value:
If the initialization is successfully completed, than a value of TRUE
is returned. Otherwise, a value of FALSE is returned.
--*/
{
HalpPciConfigBase = (PVOID) IO_CONTROL_PHYSICAL_BASE;
if (HalpIoControlBase == NULL) {
HalpIoControlBase = (PUCHAR)KePhase0MapIo(IO_CONTROL_PHYSICAL_BASE, 0x400000);
}
if (HalpIoControlBase == NULL)
return FALSE;
else
return TRUE;
}
VOID
HalpPhase0UnMapBusConfigSpace (
VOID
)
/*++
Routine Description:
This routine maps the HAL PCI config
spaces for a PowerPC system.
Arguments:
None.
Return Value:
If the initialization is successfully completed, than a value of TRUE
is returned. Otherwise, a value of FALSE is returned.
--*/
{
}
VOID
HalpDisplayRegister(
PUCHAR RegHex,
int Bytes
)
/*++
Routine Description:
Displays (via HalDisplayString) a new-line terminated
string of hex digits representing the input value. The
input value is pointed to by the first argument is
from 1 to 4 bytes in length.
Arguments:
RegHex Pointer to the value to be displayed.
Bytes Length of input value in bytes (1-4).
Return Value:
None.
--*/
{
#define DISP_MAX 4
UCHAR RegString[(DISP_MAX * 2) + 2];
UCHAR Num, High, Low;
PUCHAR Byte = &RegString[(DISP_MAX * 2) + 1];
*Byte = '\0';
*--Byte = '\n';
if ( (unsigned)Bytes > DISP_MAX ) {
Bytes = DISP_MAX;
}
while (Bytes--) {
Num = *RegHex++;
High = (Num >> 4) + '0';
Low = (Num & 0xf) + '0';
if ( High > '9' ) {
High += ('A' - '0' - 0xA);
}
if ( Low > '9' ) {
Low += ('A' - '0' - 0xA);
}
*--Byte = Low;
*--Byte = High;
}
HalDisplayString(Byte);
}
VOID
HalpHandleMemoryError(
VOID
)
{
int byte;
IDAHO_CONFIG PCI_Config_Space;
UCHAR BusAddress[4];
//
// Make sure Options Reg.1 (0xBA) and Enable Detection Reg. (0xC0)
// are programed. Reset Error Det Reg when done ?
//
HalGetBusData(PCIConfiguration,
0,
0,
&PCI_Config_Space,
sizeof(IDAHO_CONFIG));
//
// Dump Error Detection Reg, Bus Address, Status Error,
//
HalDisplayString ("TEA/MCP: System Error.\n");
HalDisplayString ("Error Detection Register 1: ");
HalpDisplayRegister (&PCI_Config_Space.ErrorDetection1,1);
//
// The error may have been detected during xfers on: cpu (local),
// memory, or pci bus.
//
// Idaho will NOT generate/check Local Bus Parity
//
if (PCI_Config_Space.ErrorDetection1 & 0x03) {
//
// idaho <-> 603 :Local bus Cycle
//
HalDisplayString ("Unsupported Local Bus Cycle\n");
for (byte = 0; byte < 4; byte++) {
//
// Correct endianess if address is local
//
BusAddress[byte] = PCI_Config_Space.ErrorAddress[3-byte];
}
HalDisplayString ("Local Bus Error Address: ");
HalpDisplayRegister(BusAddress,4);
HalDisplayString ("CPU Bus Error Status - TT(0:4);TSIZ(0:2): ");
HalpDisplayRegister(&PCI_Config_Space.CpuBusErrorStatus,1);
} else if (PCI_Config_Space.ErrorDetection1 & 0x08) {
//
// PCI Cycle
//
HalDisplayString ("PCI Cycle\n");
for (byte=0; byte<4; byte++) {
BusAddress[byte] = PCI_Config_Space.ErrorAddress[byte];
}
HalDisplayString ("PCI Bus Address: ");
HalpDisplayRegister(BusAddress,4);
HalDisplayString ("PCI Bus Error Status: ");
HalpDisplayRegister(&PCI_Config_Space.PciBusErrorStatus,1);
HalDisplayString ("PCI Device Status Register D(15:8): ");
HalpDisplayRegister(&PCI_Config_Space.DeviceStatus[1],1);
}
}
|