66 * 5000/240 (KN03), 5000/260 (KN05) and DECsystem 5900 (KN03),
77 * 5900/260 (KN05) systems.
88 *
9- * Copyright (c) 2003 Maciej W. Rozycki
9+ * Copyright (c) 2003, 2005 Maciej W. Rozycki
1010 *
1111 * This program is free software; you can redistribute it and/or
1212 * modify it under the terms of the GNU General Public License
1515 */
1616
1717#include <linux/init.h>
18+ #include <linux/interrupt.h>
1819#include <linux/kernel.h>
1920#include <linux/sched.h>
2021#include <linux/spinlock.h>
@@ -57,7 +58,7 @@ static int dec_ecc_be_backend(struct pt_regs *regs, int is_fixup, int invoker)
5758
5859 const char * kind , * agent , * cycle , * event ;
5960 const char * status = "" , * xbit = "" , * fmt = "" ;
60- dma_addr_t address ;
61+ unsigned long address ;
6162 u16 syn = 0 , sngl ;
6263
6364 int i = 0 ;
@@ -66,15 +67,15 @@ static int dec_ecc_be_backend(struct pt_regs *regs, int is_fixup, int invoker)
6667 u32 chksyn = * kn0x_chksyn ;
6768 int action = MIPS_BE_FATAL ;
6869
69- /* For non-ECC ack ASAP, so any subsequent errors get caught. */
70+ /* For non-ECC ack ASAP, so that any subsequent errors get caught. */
7071 if ((erraddr & (KN0X_EAR_VALID | KN0X_EAR_ECCERR )) == KN0X_EAR_VALID )
7172 dec_ecc_be_ack ();
7273
7374 kind = invoker ? intstr : excstr ;
7475
7576 if (!(erraddr & KN0X_EAR_VALID )) {
7677 /* No idea what happened. */
77- printk (KERN_ALERT "Unidentified bus error %s. \n" , kind );
78+ printk (KERN_ALERT "Unidentified bus error %s\n" , kind );
7879 return action ;
7980 }
8081
@@ -126,7 +127,7 @@ static int dec_ecc_be_backend(struct pt_regs *regs, int is_fixup, int invoker)
126127 /* Ack now, no rewrite will happen. */
127128 dec_ecc_be_ack ();
128129
129- fmt = KERN_ALERT "%s" "invalid. \n" ;
130+ fmt = KERN_ALERT "%s" "invalid\n" ;
130131 } else {
131132 sngl = syn & KN0X_ESR_SNGLO ;
132133 syn &= KN0X_ESR_SYNLO ;
@@ -161,12 +162,12 @@ static int dec_ecc_be_backend(struct pt_regs *regs, int is_fixup, int invoker)
161162 if (syn == 0x01 ) {
162163 fmt = KERN_ALERT "%s"
163164 "%#04x -- %s bit error "
164- "at check bit C%s. \n" ;
165+ "at check bit C%s\n" ;
165166 xbit = "X" ;
166167 } else {
167168 fmt = KERN_ALERT "%s"
168169 "%#04x -- %s bit error "
169- "at check bit C%s%u. \n" ;
170+ "at check bit C%s%u\n" ;
170171 }
171172 i = syn >> 2 ;
172173 } else {
@@ -176,16 +177,16 @@ static int dec_ecc_be_backend(struct pt_regs *regs, int is_fixup, int invoker)
176177 if (i < 32 )
177178 fmt = KERN_ALERT "%s"
178179 "%#04x -- %s bit error "
179- "at data bit D%s%u. \n" ;
180+ "at data bit D%s%u\n" ;
180181 else
181182 fmt = KERN_ALERT "%s"
182- "%#04x -- %s bit error. \n" ;
183+ "%#04x -- %s bit error\n" ;
183184 }
184185 }
185186 }
186187
187188 if (action != MIPS_BE_FIXUP )
188- printk (KERN_ALERT "Bus error %s: %s %s %s at %#010lx. \n" ,
189+ printk (KERN_ALERT "Bus error %s: %s %s %s at %#010lx\n" ,
189190 kind , agent , cycle , event , address );
190191
191192 if (action != MIPS_BE_FIXUP && erraddr & KN0X_EAR_ECCERR )
@@ -207,8 +208,8 @@ irqreturn_t dec_ecc_be_interrupt(int irq, void *dev_id, struct pt_regs *regs)
207208 return IRQ_HANDLED ;
208209
209210 /*
210- * FIXME: Find affected processes and kill them, otherwise we
211- * must die.
211+ * FIXME: Find the affected processes and kill them, otherwise
212+ * we must die.
212213 *
213214 * The interrupt is asynchronously delivered thus EPC and RA
214215 * may be irrelevant, but are printed for a reference.
@@ -235,7 +236,7 @@ static inline void dec_kn02_be_init(void)
235236 spin_lock_irqsave (& kn02_lock , flags );
236237
237238 /* Preset write-only bits of the Control Register cache. */
238- cached_kn02_csr = * csr | KN03_CSR_LEDS ;
239+ cached_kn02_csr = * csr | KN02_CSR_LEDS ;
239240
240241 /* Set normal ECC detection and generation. */
241242 cached_kn02_csr &= ~(KN02_CSR_DIAGCHK | KN02_CSR_DIAGGEN );
@@ -250,7 +251,7 @@ static inline void dec_kn02_be_init(void)
250251static inline void dec_kn03_be_init (void )
251252{
252253 volatile u32 * mcr = (void * )(KN03_SLOT_BASE + IOASIC_MCR );
253- volatile u32 * mbcs = (void * )(KN03_SLOT_BASE + KN05_MB_CSR );
254+ volatile u32 * mbcs = (void * )(KN4K_SLOT_BASE + KN4K_MB_CSR );
254255
255256 kn0x_erraddr = (void * )(KN03_SLOT_BASE + IOASIC_ERRADDR );
256257 kn0x_chksyn = (void * )(KN03_SLOT_BASE + IOASIC_CHKSYN );
@@ -265,7 +266,7 @@ static inline void dec_kn03_be_init(void)
265266 * mcr = (* mcr & ~(KN03_MCR_DIAGCHK | KN03_MCR_DIAGGEN )) |
266267 KN03_MCR_CORRECT ;
267268 if (current_cpu_data .cputype == CPU_R4400SC )
268- * mbcs |= KN05_MB_CSR_EE ;
269+ * mbcs |= KN4K_MB_CSR_EE ;
269270 fast_iob ();
270271}
271272
0 commit comments