Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/alpha/pci Put back the INITIALLY_{ENABLED, LEVEL_TRI...



details:   https://anonhg.NetBSD.org/src/rev/193f33d34ea6
branches:  trunk
changeset: 500813:193f33d34ea6
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon Dec 18 21:49:08 2000 +0000

description:
Put back the INITIALLY_{ENABLED,LEVEL_TRIGGERED}() PROM brain-damage
work-around.  It's required in order for the DEC Multia (a very
brain-damaged little machine) to work properly.

Submitted by Juergen Weiss <weiss%uni-mainz.de@localhost>, addresses
port-alpha/11202.

diffstat:

 sys/arch/alpha/pci/sio_pic.c |  28 +++++++++++++++++++++-------
 1 files changed, 21 insertions(+), 7 deletions(-)

diffs (75 lines):

diff -r d908b4024bc5 -r 193f33d34ea6 sys/arch/alpha/pci/sio_pic.c
--- a/sys/arch/alpha/pci/sio_pic.c      Mon Dec 18 21:31:32 2000 +0000
+++ b/sys/arch/alpha/pci/sio_pic.c      Mon Dec 18 21:49:08 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sio_pic.c,v 1.28 2000/06/06 03:10:13 thorpej Exp $ */
+/* $NetBSD: sio_pic.c,v 1.29 2000/12/18 21:49:08 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: sio_pic.c,v 1.28 2000/06/06 03:10:13 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sio_pic.c,v 1.29 2000/12/18 21:49:08 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -121,8 +121,15 @@
  * If prom console is broken, must remember the initial interrupt
  * settings and enforce them.  WHEE!
  */
+#define        INITIALLY_ENABLED(irq)                                          \
+       ((initial_ocw1[(irq) / 8] & (1 << ((irq) % 8))) == 0)
+#define        INITIALLY_LEVEL_TRIGGERED(irq)                                  \
+       ((initial_elcr[(irq) / 8] & (1 << ((irq) % 8))) != 0)
 u_int8_t initial_ocw1[2];
 u_int8_t initial_elcr[2];
+#else
+#define        INITIALLY_ENABLED(irq)          ((irq) == 2 ? 1 : 0)
+#define        INITIALLY_LEVEL_TRIGGERED(irq)  0
 #endif
 
 void           sio_setirqstat __P((int, int, int));
@@ -384,7 +391,10 @@
                         * IRQs 0, 1, 8, and 13 must always be
                         * edge-triggered.
                         */
-                       sio_setirqstat(i, 0, IST_EDGE);
+                       if (INITIALLY_LEVEL_TRIGGERED(i))
+                               printf("sio_intr_setup: %d level-triggered\n",
+                                   i);
+                       sio_setirqstat(i, INITIALLY_ENABLED(i), IST_EDGE);
                        alpha_shared_intr_set_dfltsharetype(sio_intr, i,
                            IST_EDGE);
                        specific_eoi(i);
@@ -405,9 +415,12 @@
                         * Otherwise, disable the IRQ and set its
                         * type to (effectively) "unknown."
                         */
-                       sio_setirqstat(i, 0, IST_NONE);
+                       sio_setirqstat(i, INITIALLY_ENABLED(i),
+                           INITIALLY_LEVEL_TRIGGERED(i) ?
+                           IST_LEVEL : IST_NONE);
                        alpha_shared_intr_set_dfltsharetype(sio_intr, i,
-                           IST_NONE);
+                           INITIALLY_LEVEL_TRIGGERED(i) ?
+                           IST_LEVEL : IST_NONE);
                        specific_eoi(i);
                        break;
                }
@@ -516,10 +529,11 @@
                        break;
 
                default:
-                       ist = IST_NONE;
+                       ist = INITIALLY_LEVEL_TRIGGERED(irq) ?
+                           IST_LEVEL : IST_NONE;
                        break;
                }
-               sio_setirqstat(irq, 0, ist);
+               sio_setirqstat(irq, INITIALLY_ENABLED(irq), ist);
                alpha_shared_intr_set_dfltsharetype(sio_intr, irq, ist);
        }
 



Home | Main Index | Thread Index | Old Index