Add "ecc at plb" device.
Add an "irq" locator to the plb device. This gets rid of the original hack where ecc support was wedged into the cpu driver.
This commit is contained in:
parent
3502025a54
commit
5b79fdfaf7
@ -1,11 +1,11 @@
|
||||
# $NetBSD: files.ibm4xx,v 1.1 2002/08/13 05:29:25 simonb Exp $
|
||||
# $NetBSD: files.ibm4xx,v 1.2 2002/08/23 15:01:07 scw Exp $
|
||||
#
|
||||
# IBM 4xx specific configuration info
|
||||
|
||||
include "arch/powerpc/fpu/files.fpu"
|
||||
|
||||
# Processor Local Bus
|
||||
define plb {}
|
||||
define plb { [irq=-1] }
|
||||
device plb : plb
|
||||
attach plb at root
|
||||
file arch/powerpc/ibm4xx/dev/plb.c plb
|
||||
@ -20,6 +20,10 @@ device cpu {}
|
||||
attach cpu at plb
|
||||
file arch/powerpc/ibm4xx/cpu.c
|
||||
|
||||
device ecc
|
||||
attach ecc at plb with ecc_plb
|
||||
file arch/powerpc/ibm4xx/dev/ecc_plb.c ecc_plb
|
||||
|
||||
# On-chip com device(s)
|
||||
attach com at opb with com_opb
|
||||
file arch/powerpc/ibm4xx/dev/com_opb.c com_opb
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cpu.c,v 1.6 2002/08/23 13:43:18 simonb Exp $ */
|
||||
/* $NetBSD: cpu.c,v 1.7 2002/08/23 15:01:08 scw Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2001 Wasabi Systems, Inc.
|
||||
@ -40,7 +40,6 @@
|
||||
#include <sys/device.h>
|
||||
#include <sys/properties.h>
|
||||
|
||||
#include <machine/dcr.h>
|
||||
#include <machine/cpu.h>
|
||||
#include <powerpc/ibm4xx/dev/plbvar.h>
|
||||
|
||||
@ -64,15 +63,6 @@ static struct cputab models[] = {
|
||||
static int cpumatch(struct device *, struct cfdata *, void *);
|
||||
static void cpuattach(struct device *, struct device *, void *);
|
||||
|
||||
/*
|
||||
* Arguably the ECC stuff belongs somewhere else....
|
||||
*/
|
||||
int intr_ecc(void *);
|
||||
|
||||
u_quad_t intr_ecc_tb;
|
||||
u_quad_t intr_ecc_iv; /* Interval */
|
||||
u_int32_t intr_ecc_cnt;
|
||||
|
||||
struct cfattach cpu_ca = {
|
||||
sizeof(struct device), cpumatch, cpuattach
|
||||
};
|
||||
@ -102,7 +92,6 @@ cpuattach(struct device *parent, struct device *self, void *aux)
|
||||
int own, pcf, cas, pcl, aid;
|
||||
struct cputab *cp = models;
|
||||
unsigned int processor_freq;
|
||||
int eccirq;
|
||||
|
||||
if (board_info_get("processor-frequency",
|
||||
&processor_freq, sizeof(processor_freq)) == -1)
|
||||
@ -150,28 +139,6 @@ cpuattach(struct device *parent, struct device *self, void *aux)
|
||||
printf("PVR: owner %x core family %x cache %x version %x asic %x\n",
|
||||
own, pcf, cas, pcl, aid);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If there is no ECC irq property, assume the hardware
|
||||
* doesn't support it.
|
||||
*
|
||||
* XXX: ECC handling needs to be pulled out of here so it
|
||||
* doesn't add unnecessary code to ports which don't need it.
|
||||
*/
|
||||
if (board_info_get("4xx-ecc-irq", &eccirq, sizeof(eccirq)) == -1)
|
||||
return;
|
||||
|
||||
/* Initialize ECC error-logging handler. This is always enabled,
|
||||
* but it will never be called on systems that do not have ECC
|
||||
* enabled by POST code in the bootloader.
|
||||
*/
|
||||
|
||||
printf("Enabling ecc handler at irq %d\n", eccirq);
|
||||
intr_ecc_tb = 0;
|
||||
intr_ecc_iv = processor_freq; /* Set interval */
|
||||
intr_ecc_cnt = 0;
|
||||
|
||||
intr_establish(eccirq, IST_LEVEL, IPL_SERIAL, intr_ecc, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -314,149 +281,3 @@ icache_flush(vaddr_t va, vsize_t len)
|
||||
asm volatile("icbi %0,%1" : : "r" (va), "r" (i));
|
||||
asm volatile("sync;isync" : : );
|
||||
}
|
||||
|
||||
/*
|
||||
* ECC fault handler.
|
||||
*/
|
||||
int
|
||||
intr_ecc(void * arg)
|
||||
{
|
||||
u_int32_t esr, ear;
|
||||
int ce, ue;
|
||||
u_quad_t tb;
|
||||
u_long tmp, msr, dat;
|
||||
unsigned int memsiz;
|
||||
|
||||
if (board_info_get("mem-size", &memsiz, sizeof(memsiz)) == -1)
|
||||
panic("no mem-size");
|
||||
|
||||
/* This code needs to be improved to handle double-bit errors */
|
||||
/* in some intelligent fashion. */
|
||||
|
||||
mtdcr(DCR_SDRAM0_CFGADDR, DCR_SDRAM0_ECCESR);
|
||||
esr = mfdcr(DCR_SDRAM0_CFGDATA);
|
||||
|
||||
mtdcr(DCR_SDRAM0_CFGADDR, DCR_SDRAM0_BEAR);
|
||||
ear = mfdcr(DCR_SDRAM0_CFGDATA);
|
||||
|
||||
/* Always clear the error to stop the intr ASAP. */
|
||||
|
||||
mtdcr(DCR_SDRAM0_CFGADDR, DCR_SDRAM0_ECCESR);
|
||||
mtdcr(DCR_SDRAM0_CFGDATA, 0xffffffff);
|
||||
|
||||
if (esr == 0x00) {
|
||||
/* No current error. Could happen due to intr. nesting */
|
||||
return(1);
|
||||
};
|
||||
|
||||
/* Only report errors every once per second max. Do this using the TB, */
|
||||
/* because the system time (via microtime) may be adjusted when the date is set */
|
||||
/* and can't reliably be used to measure intervals. */
|
||||
|
||||
asm ("1: mftbu %0; mftb %0+1; mftbu %1; cmpw %0,%1; bne 1b"
|
||||
: "=r"(tb), "=r"(tmp));
|
||||
intr_ecc_cnt++;
|
||||
|
||||
if ((tb - intr_ecc_tb) < intr_ecc_iv) {
|
||||
return(1);
|
||||
};
|
||||
|
||||
ce = (esr & SDRAM0_ECCESR_CE) != 0x00;
|
||||
ue = (esr & SDRAM0_ECCESR_UE) != 0x00;
|
||||
|
||||
printf("ECC: Error CNT=%d ESR=%x EAR=%x %s BKNE=%d%d%d%d "
|
||||
"BLCE=%d%d%d%d CBE=%d%d.\n",
|
||||
intr_ecc_cnt, esr, ear,
|
||||
(ue) ? "Uncorrectable" : "Correctable",
|
||||
((esr & SDRAM0_ECCESR_BKEN(0)) != 0x00),
|
||||
((esr & SDRAM0_ECCESR_BKEN(1)) != 0x00),
|
||||
((esr & SDRAM0_ECCESR_BKEN(2)) != 0x00),
|
||||
((esr & SDRAM0_ECCESR_BKEN(3)) != 0x00),
|
||||
((esr & SDRAM0_ECCESR_BLCEN(0)) != 0x00),
|
||||
((esr & SDRAM0_ECCESR_BLCEN(1)) != 0x00),
|
||||
((esr & SDRAM0_ECCESR_BLCEN(2)) != 0x00),
|
||||
((esr & SDRAM0_ECCESR_BLCEN(3)) != 0x00),
|
||||
((esr & SDRAM0_ECCESR_CBEN(0)) != 0x00),
|
||||
((esr & SDRAM0_ECCESR_CBEN(1)) != 0x00));
|
||||
|
||||
/* Should check for uncorrectable errors and panic... */
|
||||
|
||||
if (intr_ecc_cnt > 1000) {
|
||||
printf("ECC: Too many errors, recycling entire "
|
||||
"SDRAM (size = %d).\n", memsiz);
|
||||
|
||||
/* Can this code be changed to run without disabling data MMU and disabling intrs? */
|
||||
/* Does kernel always map all of physical RAM VA=PA? If so, just loop over lowmem. */
|
||||
|
||||
asm volatile(
|
||||
"mfmsr %0;"
|
||||
"li %1, 0x00;"
|
||||
"ori %1, %1, 0x8010;"
|
||||
"andc %1, %0, %1;"
|
||||
"mtmsr %1;"
|
||||
"sync;isync;"
|
||||
"li %1, 0x00;"
|
||||
"1:"
|
||||
"dcbt 0, %1;"
|
||||
"sync;isync;"
|
||||
"lwz %2, 0(%1);"
|
||||
"stw %2, 0(%1);"
|
||||
"sync;isync;"
|
||||
"dcbf 0, %1;"
|
||||
"sync;isync;"
|
||||
"addi %1, %1, 0x20;"
|
||||
"addic. %3, %3, -0x20;"
|
||||
"bge 1b;"
|
||||
"mtmsr %0;"
|
||||
"sync;isync;"
|
||||
: "=&r" (msr), "=&r" (tmp), "=&r" (dat)
|
||||
: "r" (memsiz) : "0" );
|
||||
|
||||
mtdcr(DCR_SDRAM0_CFGADDR, DCR_SDRAM0_ECCESR);
|
||||
esr = mfdcr(DCR_SDRAM0_CFGDATA);
|
||||
|
||||
mtdcr(DCR_SDRAM0_CFGADDR, DCR_SDRAM0_ECCESR);
|
||||
mtdcr(DCR_SDRAM0_CFGDATA, 0xffffffff);
|
||||
|
||||
/* Correctable errors here are OK, mem should be clean now. */
|
||||
/* Should check for uncorrectable errors and panic... */
|
||||
printf("ECC: Recycling complete, ESR=%x. "
|
||||
"Checking for persistent errors.\n", esr);
|
||||
|
||||
asm volatile(
|
||||
"mfmsr %0;"
|
||||
"li %1, 0x00;"
|
||||
"ori %1, %1, 0x8010;"
|
||||
"andc %1, %0, %1;"
|
||||
"mtmsr %1;"
|
||||
"sync;isync;"
|
||||
"li %1, 0x00;"
|
||||
"1:"
|
||||
"dcbt 0, %1;"
|
||||
"sync;isync;"
|
||||
"lwz %2, 0(%1);"
|
||||
"stw %2, 0(%1);"
|
||||
"sync;isync;"
|
||||
"dcbf 0, %1;"
|
||||
"sync;isync;"
|
||||
"addi %1, %1, 0x20;"
|
||||
"addic. %3, %3, -0x20;"
|
||||
"bge 1b;"
|
||||
"mtmsr %0;"
|
||||
"sync;isync;"
|
||||
: "=&r" (msr), "=&r" (tmp), "=&r" (dat)
|
||||
: "r" (memsiz) : "0" );
|
||||
|
||||
mtdcr(DCR_SDRAM0_CFGADDR, DCR_SDRAM0_ECCESR);
|
||||
esr = mfdcr(DCR_SDRAM0_CFGDATA);
|
||||
|
||||
/* If esr is non zero here, we're screwed. Should check this and panic. */
|
||||
printf("ECC: Persistent error check complete, "
|
||||
"final ESR=%x.\n", esr);
|
||||
};
|
||||
|
||||
intr_ecc_tb = tb;
|
||||
intr_ecc_cnt = 0;
|
||||
|
||||
return(1);
|
||||
};
|
||||
|
277
sys/arch/powerpc/ibm4xx/dev/ecc_plb.c
Normal file
277
sys/arch/powerpc/ibm4xx/dev/ecc_plb.c
Normal file
@ -0,0 +1,277 @@
|
||||
/* $NetBSD: ecc_plb.c,v 1.1 2002/08/23 15:01:08 scw Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2001 Wasabi Systems, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Written by Eduardo Horvath and Simon Burge for Wasabi Systems, Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed for the NetBSD Project by
|
||||
* Wasabi Systems, Inc.
|
||||
* 4. The name of Wasabi Systems, Inc. may not be used to endorse
|
||||
* or promote products derived from this software without specific prior
|
||||
* written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "locators.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/device.h>
|
||||
#include <sys/properties.h>
|
||||
|
||||
#include <machine/dcr.h>
|
||||
#include <machine/cpu.h>
|
||||
#include <powerpc/ibm4xx/dev/plbvar.h>
|
||||
|
||||
|
||||
struct ecc_plb_softc {
|
||||
struct device sc_dev;
|
||||
u_quad_t sc_ecc_tb;
|
||||
u_quad_t sc_ecc_iv; /* Interval */
|
||||
u_int32_t sc_ecc_cnt;
|
||||
u_int sc_memsize;
|
||||
int sc_irq;
|
||||
};
|
||||
|
||||
static int ecc_plbmatch(struct device *, struct cfdata *, void *);
|
||||
static void ecc_plbattach(struct device *, struct device *, void *);
|
||||
static void ecc_plb_deferred(struct device *);
|
||||
static int ecc_plb_intr(void *);
|
||||
|
||||
struct cfattach ecc_plb_ca = {
|
||||
sizeof(struct ecc_plb_softc), ecc_plbmatch, ecc_plbattach
|
||||
};
|
||||
|
||||
static int ecc_plb_found;
|
||||
|
||||
static int
|
||||
ecc_plbmatch(struct device *parent, struct cfdata *cf, void *aux)
|
||||
{
|
||||
struct plb_attach_args *paa = aux;
|
||||
|
||||
if (strcmp(paa->plb_name, cf->cf_driver->cd_name) != 0)
|
||||
return (0);
|
||||
|
||||
if (cf->cf_loc[PLBCF_IRQ] == PLBCF_IRQ_DEFAULT)
|
||||
panic("ecc_plbmatch: wildcard IRQ not allowed\n");
|
||||
|
||||
paa->plb_irq = cf->cf_loc[PLBCF_IRQ];
|
||||
|
||||
return (!ecc_plb_found);
|
||||
}
|
||||
|
||||
static void
|
||||
ecc_plbattach(struct device *parent, struct device *self, void *aux)
|
||||
{
|
||||
struct ecc_plb_softc *sc = (struct ecc_plb_softc *)self;
|
||||
struct plb_attach_args *paa = aux;
|
||||
unsigned int processor_freq;
|
||||
unsigned int memsiz;
|
||||
|
||||
ecc_plb_found++;
|
||||
|
||||
if (board_info_get("processor-frequency",
|
||||
&processor_freq, sizeof(processor_freq)) == -1)
|
||||
panic("no processor-frequency");
|
||||
|
||||
if (board_info_get("mem-size", &memsiz, sizeof(memsiz)) == -1)
|
||||
panic("no mem-size");
|
||||
|
||||
printf(": ECC controller\n");
|
||||
|
||||
sc->sc_ecc_tb = 0;
|
||||
sc->sc_ecc_cnt = 0;
|
||||
sc->sc_ecc_iv = processor_freq; /* Set interval */
|
||||
sc->sc_memsize = memsiz;
|
||||
sc->sc_irq = paa->plb_irq;
|
||||
|
||||
/*
|
||||
* Defer hooking the interrupt until all PLB devices have attached
|
||||
* since the interrupt controller may well be one of those devices...
|
||||
*/
|
||||
config_defer(self, ecc_plb_deferred);
|
||||
}
|
||||
|
||||
static void
|
||||
ecc_plb_deferred(struct device *self)
|
||||
{
|
||||
struct ecc_plb_softc *sc = (struct ecc_plb_softc *)self;
|
||||
|
||||
intr_establish(sc->sc_irq, IST_LEVEL, IPL_SERIAL, ecc_plb_intr, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* ECC fault handler.
|
||||
*/
|
||||
static int
|
||||
ecc_plb_intr(void *arg)
|
||||
{
|
||||
struct ecc_plb_softc *sc = arg;
|
||||
u_int32_t esr, ear;
|
||||
int ce, ue;
|
||||
u_quad_t tb;
|
||||
u_long tmp, msr, dat;
|
||||
|
||||
/* This code needs to be improved to handle double-bit errors */
|
||||
/* in some intelligent fashion. */
|
||||
|
||||
mtdcr(DCR_SDRAM0_CFGADDR, DCR_SDRAM0_ECCESR);
|
||||
esr = mfdcr(DCR_SDRAM0_CFGDATA);
|
||||
|
||||
mtdcr(DCR_SDRAM0_CFGADDR, DCR_SDRAM0_BEAR);
|
||||
ear = mfdcr(DCR_SDRAM0_CFGDATA);
|
||||
|
||||
/* Always clear the error to stop the intr ASAP. */
|
||||
|
||||
mtdcr(DCR_SDRAM0_CFGADDR, DCR_SDRAM0_ECCESR);
|
||||
mtdcr(DCR_SDRAM0_CFGDATA, 0xffffffff);
|
||||
|
||||
if (esr == 0x00) {
|
||||
/* No current error. Could happen due to intr. nesting */
|
||||
return(1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Only report errors every once per second max. Do this using the TB,
|
||||
* because the system time (via microtime) may be adjusted when the
|
||||
* date is set and can't reliably be used to measure intervals.
|
||||
*/
|
||||
|
||||
asm ("1: mftbu %0; mftb %0+1; mftbu %1; cmpw %0,%1; bne 1b"
|
||||
: "=r"(tb), "=r"(tmp));
|
||||
sc->sc_ecc_cnt++;
|
||||
|
||||
if ((tb - sc->sc_ecc_tb) < sc->sc_ecc_iv)
|
||||
return(1);
|
||||
|
||||
ce = (esr & SDRAM0_ECCESR_CE) != 0x00;
|
||||
ue = (esr & SDRAM0_ECCESR_UE) != 0x00;
|
||||
|
||||
printf("ECC: Error CNT=%d ESR=%x EAR=%x %s BKNE=%d%d%d%d "
|
||||
"BLCE=%d%d%d%d CBE=%d%d.\n",
|
||||
sc->sc_ecc_cnt, esr, ear,
|
||||
(ue) ? "Uncorrectable" : "Correctable",
|
||||
((esr & SDRAM0_ECCESR_BKEN(0)) != 0x00),
|
||||
((esr & SDRAM0_ECCESR_BKEN(1)) != 0x00),
|
||||
((esr & SDRAM0_ECCESR_BKEN(2)) != 0x00),
|
||||
((esr & SDRAM0_ECCESR_BKEN(3)) != 0x00),
|
||||
((esr & SDRAM0_ECCESR_BLCEN(0)) != 0x00),
|
||||
((esr & SDRAM0_ECCESR_BLCEN(1)) != 0x00),
|
||||
((esr & SDRAM0_ECCESR_BLCEN(2)) != 0x00),
|
||||
((esr & SDRAM0_ECCESR_BLCEN(3)) != 0x00),
|
||||
((esr & SDRAM0_ECCESR_CBEN(0)) != 0x00),
|
||||
((esr & SDRAM0_ECCESR_CBEN(1)) != 0x00));
|
||||
|
||||
/* Should check for uncorrectable errors and panic... */
|
||||
|
||||
if (sc->sc_ecc_cnt > 1000) {
|
||||
printf("ECC: Too many errors, recycling entire "
|
||||
"SDRAM (size = %d).\n", sc->sc_memsize);
|
||||
|
||||
/*
|
||||
* Can this code be changed to run without disabling data MMU
|
||||
* and disabling intrs?
|
||||
* Does kernel always map all of physical RAM VA=PA? If so,
|
||||
* just loop over lowmem.
|
||||
*/
|
||||
asm volatile(
|
||||
"mfmsr %0;"
|
||||
"li %1, 0x00;"
|
||||
"ori %1, %1, 0x8010;"
|
||||
"andc %1, %0, %1;"
|
||||
"mtmsr %1;"
|
||||
"sync;isync;"
|
||||
"li %1, 0x00;"
|
||||
"1:"
|
||||
"dcbt 0, %1;"
|
||||
"sync;isync;"
|
||||
"lwz %2, 0(%1);"
|
||||
"stw %2, 0(%1);"
|
||||
"sync;isync;"
|
||||
"dcbf 0, %1;"
|
||||
"sync;isync;"
|
||||
"addi %1, %1, 0x20;"
|
||||
"addic. %3, %3, -0x20;"
|
||||
"bge 1b;"
|
||||
"mtmsr %0;"
|
||||
"sync;isync;"
|
||||
: "=&r" (msr), "=&r" (tmp), "=&r" (dat)
|
||||
: "r" (sc->sc_memsize) : "0" );
|
||||
|
||||
mtdcr(DCR_SDRAM0_CFGADDR, DCR_SDRAM0_ECCESR);
|
||||
esr = mfdcr(DCR_SDRAM0_CFGDATA);
|
||||
|
||||
mtdcr(DCR_SDRAM0_CFGADDR, DCR_SDRAM0_ECCESR);
|
||||
mtdcr(DCR_SDRAM0_CFGDATA, 0xffffffff);
|
||||
|
||||
/*
|
||||
* Correctable errors here are OK, mem should be clean now.
|
||||
*
|
||||
* Should check for uncorrectable errors and panic...
|
||||
*/
|
||||
printf("ECC: Recycling complete, ESR=%x. "
|
||||
"Checking for persistent errors.\n", esr);
|
||||
|
||||
asm volatile(
|
||||
"mfmsr %0;"
|
||||
"li %1, 0x00;"
|
||||
"ori %1, %1, 0x8010;"
|
||||
"andc %1, %0, %1;"
|
||||
"mtmsr %1;"
|
||||
"sync;isync;"
|
||||
"li %1, 0x00;"
|
||||
"1:"
|
||||
"dcbt 0, %1;"
|
||||
"sync;isync;"
|
||||
"lwz %2, 0(%1);"
|
||||
"stw %2, 0(%1);"
|
||||
"sync;isync;"
|
||||
"dcbf 0, %1;"
|
||||
"sync;isync;"
|
||||
"addi %1, %1, 0x20;"
|
||||
"addic. %3, %3, -0x20;"
|
||||
"bge 1b;"
|
||||
"mtmsr %0;"
|
||||
"sync;isync;"
|
||||
: "=&r" (msr), "=&r" (tmp), "=&r" (dat)
|
||||
: "r" (sc->sc_memsize) : "0" );
|
||||
|
||||
mtdcr(DCR_SDRAM0_CFGADDR, DCR_SDRAM0_ECCESR);
|
||||
esr = mfdcr(DCR_SDRAM0_CFGDATA);
|
||||
|
||||
/*
|
||||
* If esr is non zero here, we're screwed.
|
||||
* Should check this and panic.
|
||||
*/
|
||||
printf("ECC: Persistent error check complete, "
|
||||
"final ESR=%x.\n", esr);
|
||||
}
|
||||
|
||||
sc->sc_ecc_tb = tb;
|
||||
sc->sc_ecc_cnt = 0;
|
||||
|
||||
return(1);
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: plb.c,v 1.2 2002/08/13 05:43:25 simonb Exp $ */
|
||||
/* $NetBSD: plb.c,v 1.3 2002/08/23 15:01:08 scw Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2001 Wasabi Systems, Inc.
|
||||
@ -82,6 +82,7 @@
|
||||
*/
|
||||
const struct plb_dev plb_devs [] = {
|
||||
{ "cpu", },
|
||||
{ "ecc", },
|
||||
{ "opb", },
|
||||
{ "pchb", },
|
||||
{ NULL }
|
||||
@ -130,6 +131,7 @@ plb_attach(struct device *parent, struct device *self, void *aux)
|
||||
paa.plb_name = plb_devs[i].plb_name;
|
||||
paa.plb_bt = ibm4xx_make_bus_space_tag(0, 0);
|
||||
paa.plb_dmat = &ibm4xx_default_bus_dma_tag;
|
||||
paa.plb_irq = PLBCF_IRQ_DEFAULT;
|
||||
|
||||
(void) config_found_sm(self, &paa, plb_print, plb_submatch);
|
||||
}
|
||||
@ -138,6 +140,7 @@ plb_attach(struct device *parent, struct device *self, void *aux)
|
||||
paa.plb_name = local_plb_devs->plb_name;
|
||||
paa.plb_bt = ibm4xx_make_bus_space_tag(0, 0);
|
||||
paa.plb_dmat = &ibm4xx_default_bus_dma_tag;
|
||||
paa.plb_irq = PLBCF_IRQ_DEFAULT;
|
||||
|
||||
(void) config_found_sm(self, &paa, plb_print, plb_submatch);
|
||||
local_plb_devs++;
|
||||
@ -151,6 +154,8 @@ plb_print(void *aux, const char *pnp)
|
||||
|
||||
if (pnp)
|
||||
printf("%s at %s", paa->plb_name, pnp);
|
||||
if (paa->plb_irq != PLBCF_IRQ_DEFAULT)
|
||||
printf(" irq %d", paa->plb_irq);
|
||||
|
||||
return (UNCONF);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: plbvar.h,v 1.1 2002/08/12 02:06:21 simonb Exp $ */
|
||||
/* $NetBSD: plbvar.h,v 1.2 2002/08/23 15:01:08 scw Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2002 Wasabi Systems, Inc.
|
||||
@ -45,4 +45,5 @@ struct plb_attach_args {
|
||||
const char *plb_name;
|
||||
bus_space_tag_t plb_bt; /* Bus space tag */
|
||||
bus_dma_tag_t plb_dmat; /* DMA tag */
|
||||
int plb_irq;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user