From 8bbf69e6e66aeee9add5b78d43c954e087b6a7f0 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 16 May 2012 16:04:10 -0500 Subject: pci.h cleanup - Consolidate common defines to cpukit pci.h + libbsp/sparc/shared/include/pci.h was largely a copy of an older version of the cpukit pci.h. Removed much of the contents and included . + sparc/*/pci*.c - Move to required updating to use uint32_t for dword accesses. + Rename PCI_MULTI_FUNCTION to PCI_HEADER_TYPE_MULTI_FUNCTION + Define PCI_HEADER_TYPE_MULTI_FUNCTION in cpukit pci.h and remove PCI_MULTI_FUNCTION definitions in C files. + Move PCI_INVALID_VENDORDEVICEID definitions from various C files to cpukit pci.h --- c/src/lib/libbsp/powerpc/shared/pci/pci.c | 7 ++----- c/src/lib/libbsp/powerpc/shared/pci/pcifinddevice.c | 4 +--- 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'c/src/lib/libbsp/powerpc/shared') diff --git a/c/src/lib/libbsp/powerpc/shared/pci/pci.c b/c/src/lib/libbsp/powerpc/shared/pci/pci.c index db5a4861c9..5a960179ad 100644 --- a/c/src/lib/libbsp/powerpc/shared/pci/pci.c +++ b/c/src/lib/libbsp/powerpc/shared/pci/pci.c @@ -34,9 +34,6 @@ #define PCI_CONFIG_DATA 0xcfc #endif -#define PCI_INVALID_VENDORDEVICEID 0xffffffff -#define PCI_MULTI_FUNCTION 0x80 - /* define a shortcut */ #define pci BSP_pci_configuration @@ -411,7 +408,7 @@ void FixupPCI( const struct _int_map *bspmap, int (*swizzler)(int,int) ) /* got a device */ pci_read_config_byte(pbus, pslot, 0, PCI_HEADER_TYPE, &cvalue); - nfuns = cvalue & PCI_MULTI_FUNCTION ? PCI_MAX_FUNCTIONS : 1; + nfuns = cvalue & PCI_HEADER_TYPE_MULTI_FUNCTION ? PCI_MAX_FUNCTIONS : 1; for (pfun=0; pfun< nfuns; pfun++) { pci_read_config_word(pbus, pslot, pfun, PCI_DEVICE_ID, &devid); @@ -604,7 +601,7 @@ int pci_initialize(void) continue; } pci_read_config_byte(0, ucSlotNumber, 0, PCI_HEADER_TYPE, &ucHeader); - if (ucHeader&PCI_MULTI_FUNCTION) { + if (ucHeader&PCI_HEADER_TYPE_MULTI_FUNCTION) { ucNumFuncs=PCI_MAX_FUNCTIONS; } else { ucNumFuncs=1; diff --git a/c/src/lib/libbsp/powerpc/shared/pci/pcifinddevice.c b/c/src/lib/libbsp/powerpc/shared/pci/pcifinddevice.c index 782eaba5b1..8aad50547a 100644 --- a/c/src/lib/libbsp/powerpc/shared/pci/pcifinddevice.c +++ b/c/src/lib/libbsp/powerpc/shared/pci/pcifinddevice.c @@ -46,8 +46,6 @@ * * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03 */ -#define PCI_INVALID_VENDORDEVICEID 0xffffffff -#define PCI_MULTI_FUNCTION 0x80 #include #include @@ -188,7 +186,7 @@ BSP_pciScan( if ( 0 == fun ) { pci_read_config_byte(bus,dev,0, PCI_HEADER_TYPE, &hd); - hd = (hd & PCI_MULTI_FUNCTION ? PCI_MAX_FUNCTIONS : 1); + hd = (hd & PCI_HEADER_TYPE_MULTI_FUNCTION ? PCI_MAX_FUNCTIONS : 1); } (void)pci_read_config_dword(bus,dev,fun,PCI_VENDOR_ID,&d); -- cgit v1.2.3