cpu.c revision 1.1 1 1.1 eeh /* $NetBSD: cpu.c,v 1.1 2002/03/13 00:38:17 eeh Exp $ */
2 1.1 eeh
3 1.1 eeh /*
4 1.1 eeh * Copyright 2001 Wasabi Systems, Inc.
5 1.1 eeh * All rights reserved.
6 1.1 eeh *
7 1.1 eeh * Written by Eduardo Horvath and Simon Burge for Wasabi Systems, Inc.
8 1.1 eeh *
9 1.1 eeh * Redistribution and use in source and binary forms, with or without
10 1.1 eeh * modification, are permitted provided that the following conditions
11 1.1 eeh * are met:
12 1.1 eeh * 1. Redistributions of source code must retain the above copyright
13 1.1 eeh * notice, this list of conditions and the following disclaimer.
14 1.1 eeh * 2. Redistributions in binary form must reproduce the above copyright
15 1.1 eeh * notice, this list of conditions and the following disclaimer in the
16 1.1 eeh * documentation and/or other materials provided with the distribution.
17 1.1 eeh * 3. All advertising materials mentioning features or use of this software
18 1.1 eeh * must display the following acknowledgement:
19 1.1 eeh * This product includes software developed for the NetBSD Project by
20 1.1 eeh * Wasabi Systems, Inc.
21 1.1 eeh * 4. The name of Wasabi Systems, Inc. may not be used to endorse
22 1.1 eeh * or promote products derived from this software without specific prior
23 1.1 eeh * written permission.
24 1.1 eeh *
25 1.1 eeh * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
26 1.1 eeh * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27 1.1 eeh * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 1.1 eeh * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
29 1.1 eeh * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 1.1 eeh * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 1.1 eeh * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 1.1 eeh * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 1.1 eeh * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 1.1 eeh * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 1.1 eeh * POSSIBILITY OF SUCH DAMAGE.
36 1.1 eeh */
37 1.1 eeh
38 1.1 eeh #include <sys/param.h>
39 1.1 eeh #include <sys/systm.h>
40 1.1 eeh #include <sys/device.h>
41 1.1 eeh
42 1.1 eeh #include <machine/autoconf.h>
43 1.1 eeh #include <machine/dcr.h>
44 1.1 eeh
45 1.1 eeh struct cputab {
46 1.1 eeh int version;
47 1.1 eeh char *name;
48 1.1 eeh };
49 1.1 eeh static struct cputab models[] = {
50 1.1 eeh { PVR_401A1 >> 16, "401A1" },
51 1.1 eeh { PVR_401B2 >> 16, "401B21" },
52 1.1 eeh { PVR_401C2 >> 16, "401C2" },
53 1.1 eeh { PVR_401D2 >> 16, "401D2" },
54 1.1 eeh { PVR_401E2 >> 16, "401E2" },
55 1.1 eeh { PVR_401F2 >> 16, "401F2" },
56 1.1 eeh { PVR_401G2 >> 16, "401G2" },
57 1.1 eeh { PVR_403 >> 16, "403" },
58 1.1 eeh { PVR_405GP >> 16, "405GP" },
59 1.1 eeh { 0, NULL }
60 1.1 eeh };
61 1.1 eeh
62 1.1 eeh static int cpumatch(struct device *, struct cfdata *, void *);
63 1.1 eeh static void cpuattach(struct device *, struct device *, void *);
64 1.1 eeh
65 1.1 eeh /*
66 1.1 eeh * Arguably the ECC stuff belongs somewhere else....
67 1.1 eeh */
68 1.1 eeh int intr_ecc(void *);
69 1.1 eeh
70 1.1 eeh u_quad_t intr_ecc_tb;
71 1.1 eeh u_quad_t intr_ecc_iv; /* Interval */
72 1.1 eeh u_int32_t intr_ecc_cnt;
73 1.1 eeh
74 1.1 eeh struct cfattach cpu_ca = {
75 1.1 eeh sizeof(struct device), cpumatch, cpuattach
76 1.1 eeh };
77 1.1 eeh
78 1.1 eeh int ncpus;
79 1.1 eeh
80 1.1 eeh struct cpu_info cpu_info_store;
81 1.1 eeh
82 1.1 eeh int cpufound = 0;
83 1.1 eeh
84 1.1 eeh static int
85 1.1 eeh cpumatch(struct device *parent, struct cfdata *cf, void *aux)
86 1.1 eeh {
87 1.1 eeh struct mainbus_attach_args *maa = aux;
88 1.1 eeh
89 1.1 eeh /* make sure that we're looking for a CPU */
90 1.1 eeh if (strcmp(maa->mb_name, cf->cf_driver->cd_name) != 0)
91 1.1 eeh return (0);
92 1.1 eeh
93 1.1 eeh return !cpufound;
94 1.1 eeh }
95 1.1 eeh
96 1.1 eeh static void
97 1.1 eeh cpuattach(struct device *parent, struct device *self, void *aux)
98 1.1 eeh {
99 1.1 eeh int pvr, cpu;
100 1.1 eeh int own, pcf, cas, pcl, aid;
101 1.1 eeh struct cputab *cp = models;
102 1.1 eeh
103 1.1 eeh cpufound++;
104 1.1 eeh ncpus++;
105 1.1 eeh
106 1.1 eeh asm ("mfpvr %0" : "=r"(pvr));
107 1.1 eeh cpu = pvr >> 16;
108 1.1 eeh
109 1.1 eeh /* Break PVR up into separate fields and print them out. */
110 1.1 eeh own = (pvr >> 20) & 0xfff;
111 1.1 eeh pcf = (pvr >> 16) & 0xf;
112 1.1 eeh cas = (pvr >> 10) & 0x3f;
113 1.1 eeh pcl = (pvr >> 6) & 0xf;
114 1.1 eeh aid = pvr & 0x3f;
115 1.1 eeh
116 1.1 eeh while (cp->name) {
117 1.1 eeh if (cp->version == cpu)
118 1.1 eeh break;
119 1.1 eeh cp++;
120 1.1 eeh }
121 1.1 eeh if (cp->name)
122 1.1 eeh strcpy(cpu_model, cp->name);
123 1.1 eeh else
124 1.1 eeh sprintf(cpu_model, "Version 0x%x", cpu);
125 1.1 eeh sprintf(cpu_model + strlen(cpu_model), " (Revision %d.%d)",
126 1.1 eeh (pvr >> 8) & 0xff, pvr & 0xff);
127 1.1 eeh
128 1.1 eeh #if 1
129 1.1 eeh printf(": %dMHz %s\n", board_data.processor_speed / 1000 / 1000,
130 1.1 eeh cpu_model);
131 1.1 eeh #endif
132 1.1 eeh
133 1.1 eeh cpu_probe_cache();
134 1.1 eeh
135 1.1 eeh printf("Instruction cache size %d line size %d\n",
136 1.1 eeh curcpu()->ci_ci.icache_size, curcpu()->ci_ci.icache_line_size);
137 1.1 eeh printf("Data cache size %d line size %d\n",
138 1.1 eeh curcpu()->ci_ci.dcache_size, curcpu()->ci_ci.dcache_line_size);
139 1.1 eeh
140 1.1 eeh #ifdef DEBUG
141 1.1 eeh /* It sux that the cache info here is useless. */
142 1.1 eeh printf("PVR: owner %x core family %x cache %x version %x asic %x\n",
143 1.1 eeh own, pcf, cas, pcl, aid);
144 1.1 eeh #endif
145 1.1 eeh
146 1.1 eeh /* Initialize ECC error-logging handler. This is always enabled,
147 1.1 eeh * but it will never be called on systems that do not have ECC
148 1.1 eeh * enabled by POST code in the bootloader.
149 1.1 eeh */
150 1.1 eeh
151 1.1 eeh printf("Enabling ecc handler\n");
152 1.1 eeh intr_ecc_tb = 0;
153 1.1 eeh intr_ecc_iv = board_data.processor_speed; /* Set interval */
154 1.1 eeh intr_ecc_cnt = 0;
155 1.1 eeh
156 1.1 eeh intr_establish(16, IST_LEVEL, IPL_SERIAL, intr_ecc, NULL);
157 1.1 eeh }
158 1.1 eeh
159 1.1 eeh /*
160 1.1 eeh * This routine must be explicitly called to initialize the
161 1.1 eeh * CPU cache information so cache flushe and memcpy operation
162 1.1 eeh * work.
163 1.1 eeh */
164 1.1 eeh void
165 1.1 eeh cpu_probe_cache()
166 1.1 eeh {
167 1.1 eeh int version;
168 1.1 eeh
169 1.1 eeh /*
170 1.1 eeh * First we need to identify the cpu and determine the
171 1.1 eeh * cache line size, or things like memset/memcpy may lose
172 1.1 eeh * badly.
173 1.1 eeh */
174 1.1 eeh __asm __volatile("mfpvr %0" : "=r" (version));
175 1.1 eeh switch (version & 0xffff0000) {
176 1.1 eeh case PVR_401A1:
177 1.1 eeh curcpu()->ci_ci.dcache_size = 1024;
178 1.1 eeh curcpu()->ci_ci.dcache_line_size = 16;
179 1.1 eeh curcpu()->ci_ci.icache_size = 2848;
180 1.1 eeh curcpu()->ci_ci.icache_line_size = 16;
181 1.1 eeh break;
182 1.1 eeh case PVR_401B2:
183 1.1 eeh curcpu()->ci_ci.dcache_size = 8192;
184 1.1 eeh curcpu()->ci_ci.dcache_line_size = 16;
185 1.1 eeh curcpu()->ci_ci.icache_size = 16384;
186 1.1 eeh curcpu()->ci_ci.icache_line_size = 16;
187 1.1 eeh break;
188 1.1 eeh case PVR_401C2:
189 1.1 eeh curcpu()->ci_ci.dcache_size = 8192;
190 1.1 eeh curcpu()->ci_ci.dcache_line_size = 16;
191 1.1 eeh curcpu()->ci_ci.icache_size = 0;
192 1.1 eeh curcpu()->ci_ci.icache_line_size = 16;
193 1.1 eeh break;
194 1.1 eeh case PVR_401D2:
195 1.1 eeh curcpu()->ci_ci.dcache_size = 2848;
196 1.1 eeh curcpu()->ci_ci.dcache_line_size = 16;
197 1.1 eeh curcpu()->ci_ci.icache_size = 4096;
198 1.1 eeh curcpu()->ci_ci.icache_line_size = 16;
199 1.1 eeh break;
200 1.1 eeh case PVR_401E2:
201 1.1 eeh curcpu()->ci_ci.dcache_size = 0;
202 1.1 eeh curcpu()->ci_ci.dcache_line_size = 16;
203 1.1 eeh curcpu()->ci_ci.icache_size = 0;
204 1.1 eeh curcpu()->ci_ci.icache_line_size = 16;
205 1.1 eeh break;
206 1.1 eeh case PVR_401F2:
207 1.1 eeh curcpu()->ci_ci.dcache_size = 2048;
208 1.1 eeh curcpu()->ci_ci.dcache_line_size = 16;
209 1.1 eeh curcpu()->ci_ci.icache_size = 2848;
210 1.1 eeh curcpu()->ci_ci.icache_line_size = 16;
211 1.1 eeh break;
212 1.1 eeh case PVR_401G2:
213 1.1 eeh curcpu()->ci_ci.dcache_size = 2848;
214 1.1 eeh curcpu()->ci_ci.dcache_line_size = 16;
215 1.1 eeh curcpu()->ci_ci.icache_size = 8192;
216 1.1 eeh curcpu()->ci_ci.icache_line_size = 16;
217 1.1 eeh break;
218 1.1 eeh case PVR_403:
219 1.1 eeh curcpu()->ci_ci.dcache_line_size = 16;
220 1.1 eeh curcpu()->ci_ci.icache_line_size = 16;
221 1.1 eeh break;
222 1.1 eeh case PVR_405GP:
223 1.1 eeh curcpu()->ci_ci.dcache_size = 8192;
224 1.1 eeh curcpu()->ci_ci.dcache_line_size = 32;
225 1.1 eeh curcpu()->ci_ci.icache_size = 8192;
226 1.1 eeh curcpu()->ci_ci.icache_line_size = 32;
227 1.1 eeh break;
228 1.1 eeh default:
229 1.1 eeh /*
230 1.1 eeh * Unknown CPU type. For safety we'll specify a
231 1.1 eeh * cache with a 4-byte line size. That way cache
232 1.1 eeh * flush routines won't miss any lines.
233 1.1 eeh */
234 1.1 eeh curcpu()->ci_ci.dcache_line_size = 4;
235 1.1 eeh curcpu()->ci_ci.icache_line_size = 4;
236 1.1 eeh break;
237 1.1 eeh }
238 1.1 eeh
239 1.1 eeh }
240 1.1 eeh
241 1.1 eeh /*
242 1.1 eeh * These small routines may have to be replaced,
243 1.1 eeh * if/when we support processors other that the 604.
244 1.1 eeh */
245 1.1 eeh
246 1.1 eeh void
247 1.1 eeh dcache_flush_page(vaddr_t va)
248 1.1 eeh {
249 1.1 eeh int i;
250 1.1 eeh
251 1.1 eeh if (curcpu()->ci_ci.dcache_line_size)
252 1.1 eeh for (i = 0; i < NBPG; i += curcpu()->ci_ci.dcache_line_size)
253 1.1 eeh asm volatile("dcbf %0,%1" : : "r" (va), "r" (i));
254 1.1 eeh asm volatile("sync;isync" : : );
255 1.1 eeh }
256 1.1 eeh
257 1.1 eeh void
258 1.1 eeh icache_flush_page(vaddr_t va)
259 1.1 eeh {
260 1.1 eeh int i;
261 1.1 eeh
262 1.1 eeh if (curcpu()->ci_ci.icache_line_size)
263 1.1 eeh for (i = 0; i < NBPG; i += curcpu()->ci_ci.icache_line_size)
264 1.1 eeh asm volatile("icbi %0,%1" : : "r" (va), "r" (i));
265 1.1 eeh asm volatile("sync;isync" : : );
266 1.1 eeh }
267 1.1 eeh
268 1.1 eeh void
269 1.1 eeh dcache_flush(vaddr_t va, vsize_t len)
270 1.1 eeh {
271 1.1 eeh int i;
272 1.1 eeh
273 1.1 eeh if (len == 0)
274 1.1 eeh return;
275 1.1 eeh
276 1.1 eeh /* Make sure we flush all cache lines */
277 1.1 eeh len += va & (curcpu()->ci_ci.dcache_line_size-1);
278 1.1 eeh if (curcpu()->ci_ci.dcache_line_size)
279 1.1 eeh for (i = 0; i < len; i += curcpu()->ci_ci.dcache_line_size)
280 1.1 eeh asm volatile("dcbf %0,%1" : : "r" (va), "r" (i));
281 1.1 eeh asm volatile("sync;isync" : : );
282 1.1 eeh }
283 1.1 eeh
284 1.1 eeh void
285 1.1 eeh icache_flush(vaddr_t va, vsize_t len)
286 1.1 eeh {
287 1.1 eeh int i;
288 1.1 eeh
289 1.1 eeh if (len == 0)
290 1.1 eeh return;
291 1.1 eeh
292 1.1 eeh /* Make sure we flush all cache lines */
293 1.1 eeh len += va & (curcpu()->ci_ci.icache_line_size-1);
294 1.1 eeh if (curcpu()->ci_ci.icache_line_size)
295 1.1 eeh for (i = 0; i < len; i += curcpu()->ci_ci.icache_line_size)
296 1.1 eeh asm volatile("icbi %0,%1" : : "r" (va), "r" (i));
297 1.1 eeh asm volatile("sync;isync" : : );
298 1.1 eeh }
299 1.1 eeh
300 1.1 eeh /*
301 1.1 eeh * ECC fault handler.
302 1.1 eeh */
303 1.1 eeh int
304 1.1 eeh intr_ecc(void * arg)
305 1.1 eeh {
306 1.1 eeh u_int32_t esr, ear;
307 1.1 eeh int ce, ue;
308 1.1 eeh u_quad_t tb;
309 1.1 eeh u_long tmp, msr, dat;
310 1.1 eeh
311 1.1 eeh /* This code needs to be improved to handle double-bit errors */
312 1.1 eeh /* in some intelligent fashion. */
313 1.1 eeh
314 1.1 eeh mtdcr(DCR_SDRAM0_CFGADDR, DCR_SDRAM0_ECCESR);
315 1.1 eeh esr = mfdcr(DCR_SDRAM0_CFGDATA);
316 1.1 eeh
317 1.1 eeh mtdcr(DCR_SDRAM0_CFGADDR, DCR_SDRAM0_BEAR);
318 1.1 eeh ear = mfdcr(DCR_SDRAM0_CFGDATA);
319 1.1 eeh
320 1.1 eeh /* Always clear the error to stop the intr ASAP. */
321 1.1 eeh
322 1.1 eeh mtdcr(DCR_SDRAM0_CFGADDR, DCR_SDRAM0_ECCESR);
323 1.1 eeh mtdcr(DCR_SDRAM0_CFGDATA, 0xffffffff);
324 1.1 eeh
325 1.1 eeh if (esr == 0x00) {
326 1.1 eeh /* No current error. Could happen due to intr. nesting */
327 1.1 eeh return(1);
328 1.1 eeh };
329 1.1 eeh
330 1.1 eeh /* Only report errors every once per second max. Do this using the TB, */
331 1.1 eeh /* because the system time (via microtime) may be adjusted when the date is set */
332 1.1 eeh /* and can't reliably be used to measure intervals. */
333 1.1 eeh
334 1.1 eeh asm ("1: mftbu %0; mftb %0+1; mftbu %1; cmpw %0,%1; bne 1b"
335 1.1 eeh : "=r"(tb), "=r"(tmp));
336 1.1 eeh intr_ecc_cnt++;
337 1.1 eeh
338 1.1 eeh if ((tb - intr_ecc_tb) < intr_ecc_iv) {
339 1.1 eeh return(1);
340 1.1 eeh };
341 1.1 eeh
342 1.1 eeh ce = (esr & SDRAM0_ECCESR_CE) != 0x00;
343 1.1 eeh ue = (esr & SDRAM0_ECCESR_UE) != 0x00;
344 1.1 eeh
345 1.1 eeh printf("ECC: Error CNT=%d ESR=%x EAR=%x %s BKNE=%d%d%d%d "
346 1.1 eeh "BLCE=%d%d%d%d CBE=%d%d.\n",
347 1.1 eeh intr_ecc_cnt, esr, ear,
348 1.1 eeh (ue) ? "Uncorrectable" : "Correctable",
349 1.1 eeh ((esr & SDRAM0_ECCESR_BKEN(0)) != 0x00),
350 1.1 eeh ((esr & SDRAM0_ECCESR_BKEN(1)) != 0x00),
351 1.1 eeh ((esr & SDRAM0_ECCESR_BKEN(2)) != 0x00),
352 1.1 eeh ((esr & SDRAM0_ECCESR_BKEN(3)) != 0x00),
353 1.1 eeh ((esr & SDRAM0_ECCESR_BLCEN(0)) != 0x00),
354 1.1 eeh ((esr & SDRAM0_ECCESR_BLCEN(1)) != 0x00),
355 1.1 eeh ((esr & SDRAM0_ECCESR_BLCEN(2)) != 0x00),
356 1.1 eeh ((esr & SDRAM0_ECCESR_BLCEN(3)) != 0x00),
357 1.1 eeh ((esr & SDRAM0_ECCESR_CBEN(0)) != 0x00),
358 1.1 eeh ((esr & SDRAM0_ECCESR_CBEN(1)) != 0x00));
359 1.1 eeh
360 1.1 eeh /* Should check for uncorrectable errors and panic... */
361 1.1 eeh
362 1.1 eeh if (intr_ecc_cnt > 1000) {
363 1.1 eeh printf("ECC: Too many errors, recycling entire "
364 1.1 eeh "SDRAM (size = %d).\n", board_data.mem_size);
365 1.1 eeh
366 1.1 eeh /* Can this code be changed to run without disabling data MMU and disabling intrs? */
367 1.1 eeh /* Does kernel always map all of physical RAM VA=PA? If so, just loop over lowmem. */
368 1.1 eeh
369 1.1 eeh asm volatile(
370 1.1 eeh "mfmsr %0;"
371 1.1 eeh "li %1, 0x00;"
372 1.1 eeh "ori %1, %1, 0x8010;"
373 1.1 eeh "andc %1, %0, %1;"
374 1.1 eeh "mtmsr %1;"
375 1.1 eeh "sync;isync;"
376 1.1 eeh "li %1, 0x00;"
377 1.1 eeh "1:"
378 1.1 eeh "dcbt 0, %1;"
379 1.1 eeh "sync;isync;"
380 1.1 eeh "lwz %2, 0(%1);"
381 1.1 eeh "stw %2, 0(%1);"
382 1.1 eeh "sync;isync;"
383 1.1 eeh "dcbf 0, %1;"
384 1.1 eeh "sync;isync;"
385 1.1 eeh "addi %1, %1, 0x20;"
386 1.1 eeh "addic. %3, %3, -0x20;"
387 1.1 eeh "bge 1b;"
388 1.1 eeh "mtmsr %0;"
389 1.1 eeh "sync;isync;"
390 1.1 eeh : "=&r" (msr), "=&r" (tmp), "=&r" (dat)
391 1.1 eeh : "r" (board_data.mem_size) : "0" );
392 1.1 eeh
393 1.1 eeh mtdcr(DCR_SDRAM0_CFGADDR, DCR_SDRAM0_ECCESR);
394 1.1 eeh esr = mfdcr(DCR_SDRAM0_CFGDATA);
395 1.1 eeh
396 1.1 eeh mtdcr(DCR_SDRAM0_CFGADDR, DCR_SDRAM0_ECCESR);
397 1.1 eeh mtdcr(DCR_SDRAM0_CFGDATA, 0xffffffff);
398 1.1 eeh
399 1.1 eeh /* Correctable errors here are OK, mem should be clean now. */
400 1.1 eeh /* Should check for uncorrectable errors and panic... */
401 1.1 eeh printf("ECC: Recycling complete, ESR=%x. "
402 1.1 eeh "Checking for persistent errors.\n", esr);
403 1.1 eeh
404 1.1 eeh asm volatile(
405 1.1 eeh "mfmsr %0;"
406 1.1 eeh "li %1, 0x00;"
407 1.1 eeh "ori %1, %1, 0x8010;"
408 1.1 eeh "andc %1, %0, %1;"
409 1.1 eeh "mtmsr %1;"
410 1.1 eeh "sync;isync;"
411 1.1 eeh "li %1, 0x00;"
412 1.1 eeh "1:"
413 1.1 eeh "dcbt 0, %1;"
414 1.1 eeh "sync;isync;"
415 1.1 eeh "lwz %2, 0(%1);"
416 1.1 eeh "stw %2, 0(%1);"
417 1.1 eeh "sync;isync;"
418 1.1 eeh "dcbf 0, %1;"
419 1.1 eeh "sync;isync;"
420 1.1 eeh "addi %1, %1, 0x20;"
421 1.1 eeh "addic. %3, %3, -0x20;"
422 1.1 eeh "bge 1b;"
423 1.1 eeh "mtmsr %0;"
424 1.1 eeh "sync;isync;"
425 1.1 eeh : "=&r" (msr), "=&r" (tmp), "=&r" (dat)
426 1.1 eeh : "r" (board_data.mem_size) : "0" );
427 1.1 eeh
428 1.1 eeh mtdcr(DCR_SDRAM0_CFGADDR, DCR_SDRAM0_ECCESR);
429 1.1 eeh esr = mfdcr(DCR_SDRAM0_CFGDATA);
430 1.1 eeh
431 1.1 eeh /* If esr is non zero here, we're screwed. Should check this and panic. */
432 1.1 eeh printf("ECC: Persistent error check complete, "
433 1.1 eeh "final ESR=%x.\n", esr);
434 1.1 eeh };
435 1.1 eeh
436 1.1 eeh intr_ecc_tb = tb;
437 1.1 eeh intr_ecc_cnt = 0;
438 1.1 eeh
439 1.1 eeh return(1);
440 1.1 eeh };
441