11 #define __EXTERN_INLINE inline
14 #undef __EXTERN_INLINE
16 #include <linux/types.h>
17 #include <linux/pci.h>
19 #include <linux/tty.h>
21 #include <asm/ptrace.h>
22 #include <asm/irq_regs.h>
37 #define MCHK_K_TPERR 0x0080
38 #define MCHK_K_TCPERR 0x0082
39 #define MCHK_K_HERR 0x0084
40 #define MCHK_K_ECC_C 0x0086
41 #define MCHK_K_ECC_NC 0x0088
42 #define MCHK_K_UNKNOWN 0x008A
43 #define MCHK_K_CACKSOFT 0x008C
44 #define MCHK_K_BUGCHECK 0x008E
45 #define MCHK_K_OS_BUGCHECK 0x0090
46 #define MCHK_K_DCPERR 0x0092
47 #define MCHK_K_ICPERR 0x0094
53 #define MCHK_K_SIO_SERR 0x204
54 #define MCHK_K_SIO_IOCHK 0x206
55 #define MCHK_K_DCSR 0x208
101 mk_conf_addr(
struct pci_bus *pbus,
unsigned int device_fn,
int where,
108 int device = device_fn >> 3;
109 int func = device_fn & 0x7;
118 addr = (1 << (11 + device)) | (func << 8) | where;
122 addr = (bus << 16) | (device_fn << 8) | where;
150 printk(
"lca.c:conf_read: got stat0=%lx\n", stat0);
167 conf_write(
unsigned long addr,
unsigned int value)
183 if (stat0 & LCA_IOC_STAT0_ERR) {
187 printk(
"lca.c:conf_write: got stat0=%lx\n", stat0);
208 if (mk_conf_addr(bus, devfn, where, &pci_addr))
211 shift = (where & 3) * 8;
212 mask = (size - 1) * 8;
213 addr = (pci_addr << 5) + mask +
LCA_CONF;
219 lca_write_config(
struct pci_bus *bus,
unsigned int devfn,
int where,
int size,
225 if (mk_conf_addr(bus, devfn, where, &pci_addr))
228 mask = (size - 1) * 8;
229 addr = (pci_addr << 5) + mask +
LCA_CONF;
236 .read = lca_read_config,
237 .write = lca_write_config,
264 hose->sparse_io_base =
LCA_IO - IDENT_ADDR;
265 hose->dense_io_base = 0;
317 #define ESR_EAV (1UL<< 0)
318 #define ESR_CEE (1UL<< 1)
319 #define ESR_UEE (1UL<< 2)
320 #define ESR_WRE (1UL<< 3)
321 #define ESR_SOR (1UL<< 4)
322 #define ESR_CTE (1UL<< 7)
323 #define ESR_MSE (1UL<< 9)
324 #define ESR_MHE (1UL<<10)
325 #define ESR_NXM (1UL<<12)
327 #define IOC_ERR ( 1<<4)
328 #define IOC_CMD_SHIFT 0
329 #define IOC_CMD (0xf<<IOC_CMD_SHIFT)
330 #define IOC_CODE_SHIFT 8
331 #define IOC_CODE (0xf<<IOC_CODE_SHIFT)
332 #define IOC_LOST ( 1<<5)
333 #define IOC_P_NBR ((__u32) ~((1<<13) - 1))
336 mem_error(
unsigned long esr,
unsigned long ear)
338 printk(
" %s %s error to %s occurred at address %x\n",
339 ((esr &
ESR_CEE) ?
"Correctable" :
340 (esr &
ESR_UEE) ?
"Uncorrectable" :
"A"),
341 (esr &
ESR_WRE) ?
"write" :
"read",
342 (esr &
ESR_SOR) ?
"memory" :
"b-cache",
343 (
unsigned) (ear & 0x1ffffff8));
345 printk(
" A b-cache tag parity error was detected.\n");
348 printk(
" Several other correctable errors occurred.\n");
351 printk(
" Several other uncorrectable errors occurred.\n");
354 printk(
" Attempted to access non-existent memory.\n");
361 static const char *
const pci_cmd[] = {
362 "Interrupt Acknowledge",
"Special",
"I/O Read",
"I/O Write",
363 "Rsvd 1",
"Rsvd 2",
"Memory Read",
"Memory Write",
"Rsvd3",
364 "Rsvd4",
"Configuration Read",
"Configuration Write",
365 "Memory Read Multiple",
"Dual Address",
"Memory Read Line",
366 "Memory Write and Invalidate"
368 static const char *
const err_name[] = {
369 "exceeded retry limit",
"no device",
"bad data parity",
370 "target abort",
"bad address parity",
"page table read error",
371 "invalid page",
"data error"
376 printk(
" %s initiated PCI %s cycle to address %x"
377 " failed due to %s.\n",
378 code > 3 ?
"PCI" :
"CPU", pci_cmd[cmd], stat1, err_name[code]);
380 if (code == 5 || code == 6) {
381 printk(
" (Error occurred at PCI memory address %x.)\n",
385 printk(
" Other PCI errors occurred simultaneously.\n");
409 switch ((
unsigned int) el.
c->code) {
411 case MCHK_K_TCPERR: reason =
"tag control parity error";
break;
412 case MCHK_K_HERR: reason =
"access to non-existent memory";
break;
413 case MCHK_K_ECC_C: reason =
"correctable ECC error";
break;
414 case MCHK_K_ECC_NC: reason =
"non-correctable ECC error";
break;
424 default: reason =
"unknown";
break;
427 switch (el.
c->size) {
430 " Reason: %s (short frame%s, dc_stat=%#lx):\n",
431 reason, el.c->
retry ? ", retryable" : "",
434 mem_error(el.
s->esr, el.
s->ear);
437 ioc_error(el.
s->ioc_stat0, el.
s->ioc_stat1);
442 printk(KERN_CRIT " Reason: %s (long frame%s):\n",
443 reason, el.c->
retry ? ", retryable" : "");
445 " reason: %#lx exc_addr: %#lx dc_stat: %#lx\n",
447 printk(KERN_CRIT " car: %#lx\n", el.l->
car);
449 mem_error(el.
l->esr, el.
l->ear);
452 ioc_error(el.
l->ioc_stat0, el.
l->ioc_stat1);
461 #ifdef CONFIG_VERBOSE_MCHECK
462 if (alpha_verbose_mcheck > 1) {
463 unsigned long *
ptr = (
unsigned long *) la_ptr;
465 for (i = 0; i < el.
c->size /
sizeof(
long); i += 2) {
467 i*
sizeof(
long), ptr[i], ptr[i+1]);
485 printk(
"Status of clock control:\n");
488 printk(
"\tInterrupt override is %s\n",
490 printk(
"\tDMA override is %s\n",