Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch Install the ECC error interrupt handler at the leve...



details:   https://anonhg.NetBSD.org/src/rev/1a0c409d9aff
branches:  trunk
changeset: 535608:1a0c409d9aff
user:      scw <scw%NetBSD.org@localhost>
date:      Fri Aug 23 12:46:49 2002 +0000

description:
Install the ECC error interrupt handler at the level specified by
a "4xx-ecc-irq" property.
If the property isn't defined, assume the hardware has no ECC support.
This should, ideally, be a config file option.

diffstat:

 sys/arch/powerpc/ibm4xx/cpu.c    |  15 +++++++++++++--
 sys/arch/walnut/walnut/machdep.c |  13 +++++++++++--
 2 files changed, 24 insertions(+), 4 deletions(-)

diffs (77 lines):

diff -r 1d003b0d5626 -r 1a0c409d9aff sys/arch/powerpc/ibm4xx/cpu.c
--- a/sys/arch/powerpc/ibm4xx/cpu.c     Fri Aug 23 12:18:46 2002 +0000
+++ b/sys/arch/powerpc/ibm4xx/cpu.c     Fri Aug 23 12:46:49 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.4 2002/08/12 02:06:18 simonb Exp $   */
+/*     $NetBSD: cpu.c,v 1.5 2002/08/23 12:46:49 scw Exp $      */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -102,6 +102,7 @@
        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,6 +151,16 @@
                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.
@@ -160,7 +171,7 @@
        intr_ecc_iv = processor_freq; /* Set interval */
        intr_ecc_cnt = 0;
 
-       intr_establish(16, IST_LEVEL, IPL_SERIAL, intr_ecc, NULL);
+       intr_establish(eccirq, IST_LEVEL, IPL_SERIAL, intr_ecc, NULL);
 }
 
 /*
diff -r 1d003b0d5626 -r 1a0c409d9aff sys/arch/walnut/walnut/machdep.c
--- a/sys/arch/walnut/walnut/machdep.c  Fri Aug 23 12:18:46 2002 +0000
+++ b/sys/arch/walnut/walnut/machdep.c  Fri Aug 23 12:46:49 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.10 2002/08/23 11:42:14 scw Exp $ */
+/*     $NetBSD: machdep.c,v 1.11 2002/08/23 12:46:49 scw Exp $ */
 
 /*
  * Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -366,7 +366,7 @@
 void
 cpu_startup(void)
 {
-       int sz, i;
+       int sz, i, eccirq;
        caddr_t v;
        vaddr_t minaddr, maxaddr;
        int base, residual;
@@ -495,6 +495,15 @@
        if (board_info_set("processor-frequency", &board_data.processor_speed, 
                sizeof(&board_data.processor_speed), PROP_CONST, 0))
                panic("setting processor-frequency");
+
+       /*
+        * Walnut supports ECC error reporting on irq 16
+        */
+       eccirq = 16;
+       if (board_info_set("4xx-ecc-irq", &eccirq, sizeof(&eccirq),
+           PROP_CONST, 0))
+               panic("setting ECC interrupt");
+
 #if NCOM > 0
        {
                unsigned int comfreq = COM_FREQ * 6;



Home | Main Index | Thread Index | Old Index