On Mon, 2 Apr 2001, Bernd Walter wrote:
> Copyright (c) 1992-2001 The FreeBSD Project.
> Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
>         The Regents of the University of California. All rights reserved.
> FreeBSD 5.0-CURRENT #0: Mon Apr  2 19:33:20 CEST 2001
>     [EMAIL PROTECTED]:/var/d8/src-2001-03-28/src/sys/compile/CICELY10
> DEC AXPpci
> Alpha PC AXPpci33, 166MHz

Yes, I fixed this and posted a patch for review to freebsd-alpha.

Please find it attached and test it for me.  I'll commit it if I can 1
other person to say that it works properly.

Thanks.

-- 
| Matthew N. Dodd  | '78 Datsun 280Z | '75 Volvo 164E | FreeBSD/NetBSD  |
| [EMAIL PROTECTED] |       2 x '84 Volvo 245DL        | ix86,sparc,pmax |
| http://www.jurai.net/~winter |  For Great Justice!  | ISO8802.5 4ever |
Index: alpha/dec_axppci_33.c
===================================================================
RCS file: /cvs/src/sys/alpha/alpha/dec_axppci_33.c,v
retrieving revision 1.11
diff -u -r1.11 dec_axppci_33.c
--- alpha/dec_axppci_33.c       2001/02/01 21:59:00     1.11
+++ alpha/dec_axppci_33.c       2001/03/17 19:50:12
@@ -56,6 +56,7 @@
 void dec_axppci_33_init __P((void));
 static void dec_axppci_33_cons_init __P((void));
 static int dec_axppci_33_intr_route  __P((device_t, device_t, int));
+int dec_axppci_33_intr_map(u_int, int);
 
 extern int siocnattach __P((int, int));
 extern int siogdbattach __P((int, int));
@@ -91,7 +92,7 @@
                        platform.model = alpha_unknown_sysname();
        }
 
-       platform.iobus = "lca";
+       platform.iobus = "axppci33_lca";
        platform.cons_init = dec_axppci_33_cons_init;
        platform.pci_intr_route = dec_axppci_33_intr_route;
 
@@ -120,9 +121,11 @@
 
        lca_init();
 
+#if 0
 #ifdef DDB
        siogdbattach(0x2f8, 9600);
 #endif
+#endif
        ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off);
 
        switch (ctb->ctb_term_type) {
@@ -166,10 +169,15 @@
 }
 
 #define        SIO_PCIREG_PIRQ_RTCTRL  0x60    /* PIRQ0 Route Control */
-
 static int
 dec_axppci_33_intr_route(device_t pcib, device_t dev, int pin)
 {
+       return (dec_axppci_33_intr_map(pci_get_slot(dev), pin));
+}
+
+int
+dec_axppci_33_intr_map(u_int s, int pin)
+{
        int pirq;
        u_int32_t pirqreg;
        u_int8_t pirqline;
@@ -182,7 +190,7 @@
         * Slot->interrupt translation.  Taken from NetBSD.
         */
 
-       switch (pci_get_slot(dev)) {
+       switch (s) {
        case 6:                                 /* NCR SCSI */
                pirq = 3;
                break;
@@ -234,7 +242,7 @@
 
        default:
                printf("dec_axppci_33_intr_map: weird slot number %d\n",
-                      pci_get_slot(dev));
+                      s);
                return(255);
        }
 
Index: pci/lca.c
===================================================================
RCS file: /cvs/src/sys/alpha/pci/lca.c,v
retrieving revision 1.14
diff -u -r1.14 lca.c
--- pci/lca.c   2000/08/28 21:48:03     1.14
+++ pci/lca.c   2001/03/17 08:26:36
@@ -142,6 +142,12 @@
        sizeof(struct lca_softc),
 };
 
+static driver_t axppci33_lca_driver = {
+       "axppci33_lca",
+       lca_methods,
+       sizeof(struct lca_softc),
+};
+
 #define LCA_SGMAP_BASE         (8*1024*1024)
 #define LCA_SGMAP_SIZE         (8*1024*1024)
 
@@ -285,4 +291,4 @@
 }
 
 DRIVER_MODULE(lca, root, lca_driver, lca_devclass, 0, 0);
-
+DRIVER_MODULE(axppci33_lca, root, axppci33_lca_driver, lca_devclass, 0, 0);
Index: pci/lca_pci.c
===================================================================
RCS file: /cvs/src/sys/alpha/pci/lca_pci.c,v
retrieving revision 1.9
diff -u -r1.9 lca_pci.c
--- pci/lca_pci.c       2000/12/08 22:11:23     1.9
+++ pci/lca_pci.c       2001/03/18 03:42:12
@@ -33,9 +33,11 @@
 #include <sys/bus.h>
 #include <machine/bus.h>
 #include <sys/rman.h>
-#include <pci/pcivar.h>
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
 #include <machine/swiz.h>
 #include <machine/md_var.h>
+#include <machine/cpuconf.h>
 
 #include <alpha/pci/lcareg.h>
 #include <alpha/pci/lcavar.h>
@@ -130,7 +132,34 @@
        return;                                                           \
 } while (0)
 
+/* XXX should move to a header file somewhere? */
+int dec_axppci_33_intr_map(u_int, int);
+
 u_int32_t
+axppci33_lca_pcib_read_config(device_t dev, u_int b, u_int s, u_int f,
+                    u_int reg, int width)
+{
+       if ((reg == PCIR_INTLINE) && (width == 1)) {
+               switch (s) {
+               case 6:         /* NCR SCSI */
+               case 8:         /* Slot 3 */
+               case 11:        /* Slot 1 */
+               case 12:        /* Slot 2 */
+               {
+                       int pin;
+                       pin = lca_pcib_read_config(dev, b, s, f, PCIR_INTPIN, 1);
+                       return (dec_axppci_33_intr_map(s, pin));
+               }
+               break;
+               default:
+                       break;
+               }
+       }
+
+       return (lca_pcib_read_config(dev, b, s, f, reg, width));
+}
+
+u_int32_t
 lca_pcib_read_config(device_t dev, u_int b, u_int s, u_int f,
                     u_int reg, int width)
 {
@@ -162,6 +191,41 @@
                CFGWRITE(b, s, f, reg, val, LONG, u_int32_t);
        }
 }
+
+static device_method_t axppci33_lca_pcib_methods[] = {
+       /* Device interface */
+       DEVMETHOD(device_probe,         lca_pcib_probe),
+       DEVMETHOD(device_attach,        bus_generic_attach),
+
+       /* Bus interface */
+       DEVMETHOD(bus_print_child,      bus_generic_print_child),
+       DEVMETHOD(bus_read_ivar,        lca_pcib_read_ivar),
+       DEVMETHOD(bus_alloc_resource,   bus_generic_alloc_resource),
+       DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+       DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+       DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+       DEVMETHOD(bus_setup_intr,       bus_generic_setup_intr),
+       DEVMETHOD(bus_teardown_intr,    bus_generic_teardown_intr),
+
+       /* alphapci interface */
+       DEVMETHOD(alphapci_cvt_dense,   lca_pcib_cvt_dense),
+
+       /* pcib interface */
+       DEVMETHOD(pcib_maxslots,        lca_pcib_maxslots),
+       DEVMETHOD(pcib_read_config,     axppci33_lca_pcib_read_config),
+       DEVMETHOD(pcib_write_config,    lca_pcib_write_config),
+       DEVMETHOD(pcib_route_interrupt, alpha_pci_route_interrupt),
+
+       { 0, 0 }
+};
+
+static driver_t axppci33_lca_pcib_driver = {
+       "pcib",
+       axppci33_lca_pcib_methods,
+       1,
+};
+
+DRIVER_MODULE(pcib, axppci33_lca, axppci33_lca_pcib_driver, pcib_devclass, 0, 0);
 
 static device_method_t lca_pcib_methods[] = {
        /* Device interface */
Index: pci/lcavar.h
===================================================================
RCS file: /cvs/src/sys/alpha/pci/lcavar.h,v
retrieving revision 1.4
diff -u -r1.4 lcavar.h
--- pci/lcavar.h        2000/12/01 15:27:48     1.4
+++ pci/lcavar.h        2001/03/17 05:59:11
@@ -31,3 +31,5 @@
 extern void lca_init(void);
 u_int32_t lca_pcib_read_config(struct device *dev, u_int b, u_int s, u_int f,
                               u_int reg, int width);
+u_int32_t axppci33_lca_pcib_read_config(struct device *dev, u_int b, u_int s,
+                                       u_int f, u_int reg, int width);

Reply via email to