From owner-freebsd-hackers Thu Sep 3 12:51:19 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA08210 for freebsd-hackers-outgoing; Thu, 3 Sep 1998 12:51:19 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from Gatekeeper.Alameda.net (gatekeeper.Alameda.net [207.90.181.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA08205 for ; Thu, 3 Sep 1998 12:51:17 -0700 (PDT) (envelope-from ulf@Gatekeeper.Alameda.net) Received: by Gatekeeper.Alameda.net (8.8.8/8.8.6) id MAA07438; Thu, 3 Sep 1998 12:49:57 -0700 (PDT) Message-ID: <19980903124956.D198@Alameda.net> Date: Thu, 3 Sep 1998 12:49:56 -0700 From: Ulf Zimmermann To: Wilko Bulte , Bill Paul Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: pci memory mapping Reply-To: ulf@Alameda.net References: <199809022156.RAA09174@skynet.ctr.columbia.edu> <199809031037.MAA00970@yedi.iaf.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.1i In-Reply-To: <199809031037.MAA00970@yedi.iaf.nl>; from Wilko Bulte on Thu, Sep 03, 1998 at 12:37:54PM +0200 Organization: Alameda Networks, Inc. X-Operating-System: FreeBSD 2.2.6-STABLE Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Take a look at the pseudo code at the end of the manual. It says use detection method 1, if fails, use 2. But this manual is only for firmware 4.x On Thu, Sep 03, 1998 at 12:37:54PM +0200, Wilko Bulte wrote: > As Bill Paul wrote... > > Of all the gin joints in all the towns in all the world, Wilko Bulte had > > to walk into mine and say: > > > > > > > For some reason the followin code in attach() fails: > > > > > > > > > > if (!pci_map_mem(config_id, PCI_MAP_REG_START, &mp->vbase, > > > > > &mp->pbase)) { > > > > > printf("myx%d: couldn't map memory\n", unit); > > > > > goto fail; > > > > > } > > > > Okay, Ulf has sent me a copy of his source code so I could look at it. > > > > This doesn't seem quite right somehow. The constant PCI_MAP_REG_START > > is #define in /sys/pci/pcireg.h: > > > > #define PCI_MAP_REG_START 0x10 > > > > On the two devices that I've fiddled with so far, namely the ThunderLAN > > chip and the 3Com chip, 0x10 has always been the I/O base address, i.e. > > the address used for inb/outb PIO access, and 0x14 is the memory base > > address used for memory mapped access. My impression is that these two > > registers are standar, so it's unlikely that their meanings would be > > reversed unless the chip designer is up to no good. > > > > In any case, I would try to use 0x14 instead of PCI_MAP_REG_START and > > see if that makes a difference. > > It makes a difference allright: I now get a trap12 panic ;-) No 'cannot > map mem' anymore. > > Suppose this is a strong indication of the kernel telling me > "you get that *manual* before experimenting" 8) > > > > Right.... manual...... I'm still trying to convince Mylex that handing me > > > a copy of the DAC960 V2.xx programming manual will not wipe all life from > > > Planet Earth. Sigh. Sample code from Linux and Ulf's driver are based on > > > firmware V4.xx which is different in it's interface to the OS. > > > > Do not read sample Linux code without a barf bag nearby. > > This code is not bad as far as I can tell. > > > > > If the bit doesn't come on after you write to the command register, it > > > > probably means the device doesn't actually support memory mapped access. > > > > > > Well, the bit comes on because the printf() is not triggered. But still I > > > get the 'cannot map memory' from the code sample at the top of this mail. > > > > Then I'm probably right about the register that you need to supply > > to pci_map_mep(). This is just idle speculation, but maybe the other > > cards only support memory mapped mode, and the I/O base and mem base > > registers have the same values in them. > > Let's hope I can get programming docs somehow. > > Wilko > _ ______________________________________________________________________ > | / o / / _ Bulte email: wilko@yedi.iaf.nl > |/|/ / / /( (_) Arnhem, The Netherlands WWW : http://www.tcja.nl > ______________________________________________ Powered by FreeBSD __________ > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message -- Regards, Ulf. --------------------------------------------------------------------- Ulf Zimmermann, 1525 Pacific Ave., Alameda, CA-94501, #: 510-769-2936 Alameda Networks, Inc. | http://www.Alameda.net | Fax#: 510-521-5073 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message