Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Jul 2000 14:59:21 -0400 (EDT)
From:      Andrew Gallatin <gallatin@cs.duke.edu>
To:        "Koster, K.J." <K.J.Koster@kpn.com>
Cc:        "'David Greenman'" <dg@root.com>, "'FreeBSD Alpha mailing list'" <freebsd-alpha@FreeBSD.ORG>
Subject:   RE: fxp0 hangs my AXPpci33
Message-ID:  <14717.58007.367265.507976@grasshopper.cs.duke.edu>
In-Reply-To: <59063B5B4D98D311BC0D0001FA7E4522026D7716@l04.research.kpn.com>
References:  <59063B5B4D98D311BC0D0001FA7E4522026D7716@l04.research.kpn.com>

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

Koster, K.J. writes:
 > > 
 > > I think the problem you're having is that the host is
 > > unable to talk to the card properly..
 > >
 > The generic PCI setup seems to be fine, from what I see in dmesg. The
 > addresses are sane if you compare them to the NCR SCSI adapter. It's just
 > having a hard time picking out its MAC address.
 > 
 > This would support David's suspicion of the SEEPROM. Is there any way to dig
 > around for the MAC address? I can use the x86 PC to figure out what it
 > should look for.

I think that the SEEPROM reading might be very timing
dependant... David?  I'm worried that whatever the path in the chipset
is that generates the byte enables might be too slow.  By trying I/O
space, I'm just trying to take a different path through the chipset.

 > Shouldn't the card show up in the SRM console too? I looked, but I don't
 > think it's there. How do I tell my system it's there?

Get a newer revision of the firmware, which you cannot do on a box as
old as yours :-(

 > > 
 > > I'll see if I can cook up a patch for you to try. 
 > >
 > I'd really appreciate that. Thanks.

Try the appended patch & see if it helps.  If it does and if David
approves, I could clean it up & make it get a mask of devices via a
getenv like the Qlogic driver does.

Cheers,

Drew

Index: if_fxp.c
===================================================================
RCS file: /home/ncvs/src/sys/pci/if_fxp.c,v
retrieving revision 1.77.2.6
diff -u -r1.77.2.6 if_fxp.c
--- if_fxp.c	2000/07/19 14:36:36	1.77.2.6
+++ if_fxp.c	2000/07/25 18:53:08
@@ -515,6 +515,8 @@
 	return ENXIO;
 }
 
+#define FXP_PREFER_IOSPACE
+
 static int
 fxp_attach(device_t dev)
 {
@@ -533,12 +535,31 @@
 	 * Enable bus mastering.
 	 */
 	val = pci_read_config(dev, PCIR_COMMAND, 2);
+#ifdef FXP_PREFER_IOSPACE	 /*XXX*/
+	val |= (PCIM_CMD_PORTEN|PCIM_CMD_BUSMASTEREN);
+#else
 	val |= (PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN);
+#endif
 	pci_write_config(dev, PCIR_COMMAND, val, 2);
 
 	/*
 	 * Map control/status registers.
 	 */
+#ifdef FXP_PREFER_IOSPACE	 /*XXX*/
+	device_printf(dev, "using i/o space access\n");
+	rid = FXP_PCI_IOBA;
+	sc->io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid,
+				     0, ~0, 1, RF_ACTIVE);
+	if (!sc->io) {
+		device_printf(dev, "could not map memory\n");
+		error = ENXIO;
+		goto fail;
+        }
+
+	sc->sc_st = rman_get_bustag(sc->io);
+	sc->sc_sh = rman_get_bushandle(sc->io);
+
+#else
 	rid = FXP_PCI_MMBA;
 	sc->mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid,
 				     0, ~0, 1, RF_ACTIVE);
@@ -550,7 +571,7 @@
 
 	sc->sc_st = rman_get_bustag(sc->mem);
 	sc->sc_sh = rman_get_bushandle(sc->mem);
-
+#endif
 	/*
 	 * Allocate our interrupt.
 	 */
@@ -575,7 +596,11 @@
 		/* Failed! */
 		bus_teardown_intr(dev, sc->irq, sc->ih);
 		bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq);
+#ifdef FXP_PREFER_IOSPACE /* XXX */
 		bus_release_resource(dev, SYS_RES_MEMORY, FXP_PCI_MMBA, sc->mem);
+#else
+		bus_release_resource(dev, SYS_RES_IOPORT, FXP_PCI_IOBA, sc->io);
+#endif
 		error = ENXIO;
 		goto fail;
 	}
@@ -639,8 +664,11 @@
 	 */
 	bus_teardown_intr(dev, sc->irq, sc->ih);
 	bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq);
+#ifdef FXP_PREFER_IOSPACE /* XXX */
+	bus_release_resource(dev, SYS_RES_IOPORT, FXP_PCI_IOBA, sc->io);
+#else
 	bus_release_resource(dev, SYS_RES_MEMORY, FXP_PCI_MMBA, sc->mem);
-
+#endif
 	/*
 	 * Free all the receive buffers.
 	 */
Index: if_fxpvar.h
===================================================================
RCS file: /home/ncvs/src/sys/pci/if_fxpvar.h,v
retrieving revision 1.9.2.1
diff -u -r1.9.2.1 if_fxpvar.h
--- if_fxpvar.h	2000/03/29 02:02:39	1.9.2.1
+++ if_fxpvar.h	2000/07/25 18:28:23
@@ -46,6 +46,7 @@
 #else
 	struct arpcom arpcom;		/* per-interface network data */
 	struct resource *mem;		/* resource descriptor for registers */
+	struct resource *io;		/* resource descriptor for registers */
 	struct resource *irq;		/* resource descriptor for interrupt */
 	void *ih;			/* interrupt handler cookie */
 #endif /* __NetBSD__ */


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




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