17 #include <linux/kernel.h>
18 #include <linux/sched.h>
19 #include <linux/types.h>
21 #include <asm/addrspace.h>
22 #include <asm/bootinfo.h>
24 #include <asm/irq_regs.h>
25 #include <asm/processor.h>
26 #include <asm/ptrace.h>
27 #include <asm/traps.h>
34 static volatile u32 *kn0x_erraddr;
35 static volatile u32 *kn0x_chksyn;
37 static inline void dec_ecc_be_ack(
void)
43 static int dec_ecc_be_backend(
struct pt_regs *
regs,
int is_fixup,
int invoker)
45 static const char excstr[] =
"exception";
46 static const char intstr[] =
"interrupt";
47 static const char cpustr[] =
"CPU";
48 static const char dmastr[] =
"DMA";
49 static const char readstr[] =
"read";
50 static const char mreadstr[] =
"memory read";
51 static const char writestr[] =
"write";
52 static const char mwritstr[] =
"partial memory write";
53 static const char timestr[] =
"timeout";
54 static const char overstr[] =
"overrun";
55 static const char eccstr[] =
"ECC error";
58 const char *
status =
"", *xbit =
"", *
fmt =
"";
64 u32 erraddr = *kn0x_erraddr;
65 u32 chksyn = *kn0x_chksyn;
72 kind = invoker ? intstr : excstr;
94 if ((erraddr & (
KN0X_EAR_WRITE | KN0X_EAR_ECCERR)) == KN0X_EAR_ECCERR)
95 address = (address & ~0xfff
LL) | ((address - 5) & 0xfff
LL);
102 if (erraddr & KN0X_EAR_ECCERR) {
103 static const u8 data_sbit[32] = {
104 0x4f, 0x4a, 0x52, 0x54, 0x57, 0x58, 0x5b, 0x5d,
105 0x23, 0x25, 0x26, 0x29, 0x2a, 0x2c, 0x31, 0x34,
106 0x0e, 0x0b, 0x13, 0x15, 0x16, 0x19, 0x1a, 0x1c,
107 0x62, 0x64, 0x67, 0x68, 0x6b, 0x6d, 0x70, 0x75,
109 static const u8 data_mbit[25] = {
111 0x2f, 0x32, 0x37, 0x38, 0x3b, 0x3d, 0x3e,
112 0x43, 0x45, 0x46, 0x49, 0x4c, 0x51, 0x5e,
113 0x61, 0x6e, 0x73, 0x76, 0x79, 0x7a, 0x7c, 0x7f,
115 static const char sbestr[] =
"corrected single";
116 static const char dbestr[] =
"uncorrectable double";
117 static const char mbestr[] =
"uncorrectable multiple";
119 if (!(address & 0x4))
137 for (i = 0; i < 25; i++)
138 if (syn == data_mbit[i])
159 if (syn && syn == (syn & -syn)) {
162 "%#04x -- %s bit error "
163 "at check bit C%s\n";
167 "%#04x -- %s bit error "
168 "at check bit C%s%u\n";
172 for (i = 0; i < 32; i++)
173 if (syn == data_sbit[i])
177 "%#04x -- %s bit error "
178 "at data bit D%s%u\n";
181 "%#04x -- %s bit error\n";
188 kind, agent, cycle, event, address);
191 printk(
fmt,
" ECC syndrome ", syn, status, xbit, i);
198 return dec_ecc_be_backend(regs, is_fixup, 0);
205 int action = dec_ecc_be_backend(regs, 0, 1);
219 die(
"Unrecoverable bus error", regs);
228 static inline void dec_kn02_be_init(
void)
246 static inline void dec_kn03_be_init(
void)