Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Jun 2001 15:11:54 -0400 (EDT)
From:      "Matthew N. Dodd" <winter@jurai.net>
To:        Martijn Pronk <martijn@smartie.xs4all.nl>
Cc:        freebsd-alpha@FreeBSD.ORG
Subject:   Re: de network card not working on -current
Message-ID:  <Pine.BSF.4.21.0106091508580.26121-200000@sasami.jurai.net>
In-Reply-To: <20010608201722.A31138@obelix.smartie.xs4all.nl>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Fri, 8 Jun 2001, Martijn Pronk wrote:
> So, does anybody have a clue what I can do about it?

Try the attached patch.

-- 
| Matthew N. Dodd  | '78 Datsun 280Z | '75 Volvo 164E | FreeBSD/NetBSD  |
| winter@jurai.net |       2 x '84 Volvo 245DL        | ix86,sparc,pmax |
| http://www.jurai.net/~winter |  For Great Justice!  | ISO8802.5 4ever |


[-- Attachment #2 --]
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;
 
@@ -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);

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0106091508580.26121-200000>