Subject: Re: PCI network card on the BeBox (was Re: network interface card in slot 3)
To: None <tech-kern@netbsd.org>
From: Allen Briggs <briggs@wasabisystems.com>
List: tech-kern
Date: 01/26/2001 20:25:40
> This seems to be a nontrivial problem (at least for me). Are there
> any examples from other ports, where this kind of configuration is
> done in the kernel instead of the firmware ?

I have written some code, based partly on code written by Per Fogelstrom
for PMON/2000, that does the configuration for another PowerPC system that
I'm working on.  Right now, it just does the bare minimum that I need
for this system, but it probably wouldn't take too much work to generalize
it.  I'll see if I can put together a proposal for this.

Right now, it's an option (PCI_NETBSD_CONFIGURE) that causes
dev/pci/pciconf.c to be included.  This includes a function

int     pci_configure_bus(pci_chipset_tag_t pc, int bus, int maxdevs);

If PCI_NETBSD_CONFIGURE is defined, this function is called just before
the device loop in pci.c:pci_probe_bus().  This is slightly suboptimal
because when assigning memory and I/O ranges, we could do a better job
if we have all of the information for all busses.  I'm tempted to say
that this isn't a problem until someone runs into an actual case where
it is a problem.  :-)

I haven't defined a way for a port to declare its free memory and I/O
spaces.  That's one of the things that's currently hardcoded.  Does
anyone have any suggestions on the best way to do this?

-allen

-- 
 Allen Briggs                     briggs@wasabisystems.com
 http://www.wasabisystems.com/    Quality NetBSD CDs, Sales, Support, Service