From owner-freebsd-hackers Wed Sep 11 14:35:34 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id OAA02734 for hackers-outgoing; Wed, 11 Sep 1996 14:35:34 -0700 (PDT) Received: from FileServ1.MI.Uni-Koeln.DE (FileServ1.MI.Uni-Koeln.DE [134.95.212.1]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id OAA02720 for ; Wed, 11 Sep 1996 14:35:21 -0700 (PDT) Received: from x14.mi.uni-koeln.de (annexr2-43.slip.Uni-Koeln.DE) by FileServ1.MI.Uni-Koeln.DE with SMTP id AA06179 (5.67b/IDA-1.5 for ); Wed, 11 Sep 1996 23:35:11 +0200 Received: (from se@localhost) by x14.mi.uni-koeln.de (8.7.5/8.6.9) id WAA03498; Wed, 11 Sep 1996 22:29:54 +0200 (MET DST) Date: Wed, 11 Sep 1996 22:29:54 +0200 (MET DST) Message-Id: <199609112029.WAA03498@x14.mi.uni-koeln.de> From: Stefan Esser To: Peter Hawkins Cc: hackers@freebsd.org Subject: Re: PCI PnP question In-Reply-To: <199609070837.SAA17623@palin.cc.monash.edu.au> References: <199609070837.SAA17623@palin.cc.monash.edu.au> Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Peter Hawkins writes: Hi Peter! I'm feeling responsible for the PCI code in FreeBSD, so I'll try to get you going ... :) > I'm writing a driver for a pci card, but every time I plug it in (regardless > of whether I load the kernal with the driver) I see that ed1 (my ethernet card) > fails at boottime (can't clear memory c8000). I'm not really a PC person so Is this ed1 an ISA or another PCI card ? The ED driver supports a number of different cards, some of which need a memory region, others don't (they use rep inw/outw for the data transfer to the cards SRAM buffer). Best if you do a VERBOSE boot (enter "-v" at the boot prompt, and send me the output as written to /var/log/messages). > the vagaries of it's memory management are not things I follow well. I can't > find any way to adjust the way the bios allocates windows to pci devices > so I have to assume it doesn't overlap isa. I know this particular card requires The PCI BIOS assigns non-overlapping port and memory addresses to each card, as required by the hardware. If an ISA compatible PCI card needs memory in the >640K hole, then it is the card BIOS or driver that knows about this. PCI generally uses attach addresses higher than 256MB, most often in the >3GB quadrant, in order to not overlap with any legacy device. > 16k of memory. Can anyone enlighten me here and tell me how to avoid conflicts > (other than moving the card to another slot). Please boot without the card (and send me the verbose boot log as described above). Then insert the new PCI card and boot again, possibly with the Ethernet card removed (hoping the boot will succeed, then), again with "-v". If the boot fails, then you'll have to write down the corresponding probe line, something like: pci0:15:6: vendor=0x1234, device=0x0008, class=0x01, subclass=0x00 [no driver assigned] map(10): mem32(fec01008) map(14): io(4100) > Also does anyone know what the bios uses as a memory mapping strategy? This is generally not of any interest (and not published, nor guaranteed to be the same between BIOS releases), since it suffices to have non- overlapping regions for each device. The PCI specs describe how the map registers decode the size of the mapping, and the BIOS generally scans a PCI bus in either ascending or descending slot number, giving each device found a memory or port range adjusted to its size (i.e. a 4KB mapping will start on an address that is a multiple of 4KB) ascending or descending from a known unused physical address. In my system slots appear to be scanned from low to high numbers, and addresses are assigned going down from mem addr 0xfbfff000 and port 0xf000 (don't know why the port addresses assigned are so far apart): Probing for devices on PCI bus 0: configuration mode 2 allows 16 devices. chip0 rev 4 on pci0:0 ncr0 rev 1 int a irq 9 on pci0:1 mapreg[10] type=1 addr=0000e800 size=0100. mapreg[14] type=0 addr=fbfef000 size=0100. reg20: virtual=0xf4288000 physical=0xfbfef000 size=0x100 chip1 rev 3 on pci0:2 vga0 rev 0 on pci0:5 mapreg[10] type=0 addr=fb000000 size=800000. ed1 rev 0 int a irq 12 on pci0:6 mapreg[10] type=1 addr=0000e400 size=0020. pci0: uses 8388864 bytes of memory from fb000000 upto fbfef0ff. pci0: uses 288 bytes of I/O space from e400 upto e8ff. Regards, STefan