
VxWorks
BSP Developer’s Guide, 6.0
90
Example 3-1 Basic PCI Configuration
/* sysBusPci.c - configure PCI bus for hypothetical BSP */
/* forward declarations */
void sysPciAutoConfig (void);
void sysPciMemCfg (void *pCookie);
STATUS sysPciAutoconfigInclude
(
PCI_SYSTEM *pSys,
PCI_LOC *pLoc,
UINT devVend
);
UCHAR sysPciAutoconfigIntrAssign
(
PCI_SYSTEM *pSys,
PCI_LOC *pLoc,
UCHAR pin
);
/************************************************************
* sysPciAutoConfig - BSP support routine to configure PCI bus
*
* RETURNS: N/A
*/
void sysPciAutoConfig (void)
{
void *pCookie;
pCookie = pciAutoConfigLibInit(NULL);
/* Configure Memory Addresses and Sizes */
sysPciMemCfg(pCookie);
/* Configuration Options */
/* Cache Line Size */
pciAutoCfgCtl(pCookie, PCI_CACHE_SIZE_SET,
(void *)(_CACHE_ALIGN_SIZE/4));
/* Uniform MAX_LAT value */
pciAutoCfgCtl(pCookie, PCI_MAX_LAT_ALL_SET, (void *)PCI_LAT_TIMER);
/* BSP-Specified Devices to Configure */
pciAutoCfgCtl(pCookie, PCI_INCLUDE_FUNC_SET,
(void *)sysPciAutoConfigInclude);
/* BSP-Specified Interrupt Assignment */
pciAutoCfgCtl(pCookie, PCI_INT_ASSIGN_FUNC_SET,
(void *)sysPciAutoconfigIntrAssign);
/* Perform AutoConfig */
pciAutoCfg(pCookie);
/* Enable Fast Back To Back Transactions */
Kommentare zu diesen Handbüchern