diff options
author | Daniel Hellstrom <daniel@gaisler.com> | 2011-12-16 14:10:57 +0100 |
---|---|---|
committer | Daniel Hellstrom <daniel@gaisler.com> | 2015-04-17 01:10:17 +0200 |
commit | 46e41c98b30e9084e8a706129a78327da27c22a4 (patch) | |
tree | 5101111e5fc61a31cabf9c1370a06aa98051f7ae /c/src/lib/libbsp/sparc/shared/pci/pcifinddevice.c | |
parent | LEON3: new Console driver, APBUART driver using Driver Manager (diff) | |
download | rtems-46e41c98b30e9084e8a706129a78327da27c22a4.tar.bz2 |
LEON: replaced old BSP PCI layer with new generic libpci PCI layer
The old code used a limited PCI configuration library, which was
duplicated into LEON2 and LEON3 BSP pci.c together with respective
Host controller PCI interface.
The LEON2 BSP had support for AT697 PCI, and LEON3 for GRPCI PCI
Host controller. With this update new PCI Host drivers are added,
and all support the new generic PCI Library:
* AT697 PCI (LEON2 only)
* GRPCI (LEON2-GRLIB and LEON3)
* GRPCI2 (LEON2-GRLIB and LEON3)
* Actel PCIF GRLIB Wrapper (LEON3 only)
The LEON2 BSP is defined as big-endian PCI in bsp.h, since the
AT697 supports only big-endian PCI.
Diffstat (limited to 'c/src/lib/libbsp/sparc/shared/pci/pcifinddevice.c')
-rw-r--r-- | c/src/lib/libbsp/sparc/shared/pci/pcifinddevice.c | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/c/src/lib/libbsp/sparc/shared/pci/pcifinddevice.c b/c/src/lib/libbsp/sparc/shared/pci/pcifinddevice.c deleted file mode 100644 index bd05aab063..0000000000 --- a/c/src/lib/libbsp/sparc/shared/pci/pcifinddevice.c +++ /dev/null @@ -1,51 +0,0 @@ -/* Author: Till Straumann <strauman@slac.stanford.edu>, 2001 */ - -/* find a particular PCI device - * (we assume, the firmware configured the PCI bus[es] for us) - */ - -#include <pci.h> -#include <rtems/bspIo.h> - -int -BSP_pciFindDevice( unsigned short vendorid, unsigned short deviceid, - int instance, int *pbus, int *pdev, int *pfun ) -{ - uint32_t d; - unsigned short s; - unsigned char bus,dev,fun,hd; - - for (bus=0; bus<BusCountPCI(); bus++) { - for (dev=0; dev<PCI_MAX_DEVICES; dev++) { - - pci_read_config_byte(bus,dev,0, PCI_HEADER_TYPE, &hd); - hd = (hd & PCI_HEADER_TYPE_MULTI_FUNCTION ? PCI_MAX_FUNCTIONS : 1); - - for (fun=0; fun<hd; fun++) { - /* - * The last devfn id/slot is special; must skip it - */ - if (PCI_MAX_DEVICES-1==dev && PCI_MAX_FUNCTIONS-1 == fun) - break; - (void)pci_read_config_dword(bus,dev,fun,PCI_VENDOR_ID,&d); - if (PCI_INVALID_VENDORDEVICEID == d) - continue; -#ifdef PCI_DEBUG - printk("BSP_pciFindDevice: found 0x%08x at %d/%d/%d\n",d,bus,dev,fun); -#endif - (void) pci_read_config_word(bus,dev,fun,PCI_VENDOR_ID,&s); - if (vendorid != s) - continue; - (void) pci_read_config_word(bus,dev,fun,PCI_DEVICE_ID,&s); - if (deviceid == s) { - if (instance--) continue; - *pbus=bus; *pdev=dev; *pfun=fun; - return 0; - } - } - } - } - return -1; -} - -/* eof */ |