Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sandpoint/pci Map winbond interrupts.



details:   https://anonhg.NetBSD.org/src/rev/584e0049e719
branches:  trunk
changeset: 525473:584e0049e719
user:      briggs <briggs%NetBSD.org@localhost>
date:      Fri Apr 12 02:55:03 2002 +0000

description:
Map winbond interrupts.

diffstat:

 sys/arch/sandpoint/pci/pci_machdep.c |  52 +++++++++++++++++++++++++----------
 1 files changed, 37 insertions(+), 15 deletions(-)

diffs (83 lines):

diff -r 78ba91d8e615 -r 584e0049e719 sys/arch/sandpoint/pci/pci_machdep.c
--- a/sys/arch/sandpoint/pci/pci_machdep.c      Fri Apr 12 02:34:21 2002 +0000
+++ b/sys/arch/sandpoint/pci/pci_machdep.c      Fri Apr 12 02:55:03 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_machdep.c,v 1.7 2001/10/29 23:37:37 thorpej Exp $  */
+/*     $NetBSD: pci_machdep.c,v 1.8 2002/04/12 02:55:03 briggs Exp $   */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -59,6 +59,7 @@
 #include <machine/bus.h>
 #include <machine/pio.h>
 #include <machine/intr.h>
+#include <machine/openpicreg.h>
 
 #include <dev/isa/isavar.h>
 #include <dev/pci/pcivar.h>
@@ -206,6 +207,27 @@
        if (line == 255) {
                printf("pci_intr_map: no mapping for pin %c\n", '@' + pin);
                goto bad;
+       }
+       if (line == 11) {
+               switch (pin) {
+               case PCI_INTERRUPT_PIN_A:
+                       *ihp = SANDPOINT_INTR_WINBOND_A;
+                       break;
+               case PCI_INTERRUPT_PIN_B:
+                       *ihp = SANDPOINT_INTR_WINBOND_B;
+                       break;
+               case PCI_INTERRUPT_PIN_C:
+                       *ihp = SANDPOINT_INTR_WINBOND_C;
+                       break;
+               case PCI_INTERRUPT_PIN_D:
+                       *ihp = SANDPOINT_INTR_WINBOND_D;
+                       break;
+               default:
+                       printf("pci_intr_map: bad interrupt line %d,%c\n",
+                               line, pin + '@');
+                       goto bad;
+                       break;
+               }
        } else {
                /*
                 * Sandpoint has 4 PCI slots.
@@ -219,23 +241,23 @@
                 * based numbering scheme where Motorola's is usually 1-based.
                 */
                if (line < 13 || line > 16) {
-                       printf("pci_intr_map: bad interrupt line %d\n", line);
+                       printf("pci_intr_map: bad interrupt line %d,%c\n",
+                               line, pin + '@');
                        goto bad;
                }
+
+               /*
+                * In the PCI configuration code, we simply assign the dev
+                * number to the interrupt line.  We extract it here for the
+                * interrupt, but subtract off the lowest dev (13) to get
+                * the IRQ.
+                */
+#if defined(OPENPIC_SERIAL_MODE)
+               *ihp = line - 11;
+#else
+               *ihp = line - 13;
+#endif
        }
-       /*
-        * In the PCI configuration code, we simply assign the dev
-        * number to the interrupt line.  We extract it here for the
-        * interrupt, but subtract off the lowest dev (13) to get
-        * the IRQ.
-        */
-#if defined(OPENPIC_SERIAL_MODE)
-       line -= 11;
-#else
-       line -= 13;
-#endif
-       
-       *ihp = line;
        return 0;
 
 bad:



Home | Main Index | Thread Index | Old Index