From owner-freebsd-hackers Thu Sep 3 04:55:29 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id EAA06167 for freebsd-hackers-outgoing; Thu, 3 Sep 1998 04:55:29 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from uni4nn.gn.iaf.nl (osmium.gn.iaf.nl [193.67.144.12]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id EAA06161 for ; Thu, 3 Sep 1998 04:55:27 -0700 (PDT) (envelope-from wilko@yedi.iaf.nl) Received: by uni4nn.gn.iaf.nl with UUCP id AA19548 (5.67b/IDA-1.5); Thu, 3 Sep 1998 13:35:40 +0200 Received: (from wilko@localhost) by yedi.iaf.nl (8.8.8/8.6.12) id MAA00970; Thu, 3 Sep 1998 12:37:54 +0200 (CEST) From: Wilko Bulte Message-Id: <199809031037.MAA00970@yedi.iaf.nl> Subject: Re: pci memory mapping In-Reply-To: <199809022156.RAA09174@skynet.ctr.columbia.edu> from Bill Paul at "Sep 2, 98 05:56:21 pm" To: wpaul@skynet.ctr.columbia.edu (Bill Paul) Date: Thu, 3 Sep 1998 12:37:54 +0200 (CEST) Cc: freebsd-hackers@FreeBSD.ORG X-Organisation: Private FreeBSD site - Arnhem, The Netherlands X-Pgp-Info: PGP public key at 'finger wilko@freefall.freebsd.org' X-Mailer: ELM [version 2.4ME+ PL38 (25)] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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