From owner-freebsd-alpha Tue Jul 25 11:59:39 2000 Delivered-To: freebsd-alpha@freebsd.org Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by hub.freebsd.org (Postfix) with ESMTP id 65C9B37B873 for ; Tue, 25 Jul 2000 11:59:25 -0700 (PDT) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.9.3/8.9.3) with ESMTP id OAA13036; Tue, 25 Jul 2000 14:59:21 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.9.3/8.9.1) id OAA65684; Tue, 25 Jul 2000 14:59:21 -0400 (EDT) (envelope-from gallatin@cs.duke.edu) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 25 Jul 2000 14:59:21 -0400 (EDT) To: "Koster, K.J." Cc: "'David Greenman'" , "'FreeBSD Alpha mailing list'" Subject: RE: fxp0 hangs my AXPpci33 In-Reply-To: <59063B5B4D98D311BC0D0001FA7E4522026D7716@l04.research.kpn.com> References: <59063B5B4D98D311BC0D0001FA7E4522026D7716@l04.research.kpn.com> X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs Lucid Message-ID: <14717.58007.367265.507976@grasshopper.cs.duke.edu> Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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