[ECOS] PCI device driver questions

Gary Thomas gary@mlbassoc.com
Fri Jan 30 23:38:00 GMT 2004

On Fri, 2004-01-30 at 15:21, John Newlin wrote:
> Hello,
> I'm working on the driver for a PCI device.
> There is a region of Bus Address space reserved for mapping PCI I/O and
> PCI memory regions.
> Where in the PCI driver does one map a processor physical address to a PCI
> 32/64 bit address.
> For example:  If I have one device on PCI that has 1 4MB memory BAR, how
> would one map that 4MB region into local processor space.
> Pointers to some code examples would be great!

This happens automatically when you call cyg_pci_configure_bus.  All 
devices (and bridges) are discovered and eCos assigns both I/O and 
memory areas to them at that time.   Later, when you look up a 
particular device, the device information will have a copy of the BAR
registers so you can determine how to talk to the device.

This file has an example of the HAL PCI glue, including a call to 
configure the PCI space:

To see how one might use a PCI device, look at any of the PCI based
network device drivers.  For example:

Gary Thomas <gary@mlbassoc.com>
MLB Associates

Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

More information about the Ecos-discuss mailing list