VxWorks BSP Reference : wrPpmc8260
sysLib [wrPpmc8260] - system-dependent library
eepromNvRamSetup( ) - setup non-volatile ram system
eepromReadByte( ) - read one byte of Non-Volatile Ram
eepromWriteByte( ) - write one byte to Non-Volatile Ram
eepromUnlock( ) - Unlock the eeprom via the software protection mechanism
eepromLock( ) - Lock the eeprom via the software protection mechanism
eepromDelay( ) - eeprom delay routine
sysNvRamGet( ) - get the contents of non-volatile RAM
sysNvRamSet( ) - write to non-volatile RAM
sysLocalToBusAdrs( ) - convert a local address to a bus address
sysBusToLocalAdrs( ) - convert a bus address to a local address
sysBusIntAck( ) - acknowledge a bus interrupt
sysBusIntGen( ) - generate a bus interrupt
sysMailboxConnect( ) - connect a routine to the mailbox interrupt
sysMailboxEnable( ) - enable the mailbox interrupt
sysBusTas( ) - test and set a location across the bus
m82xxDpramLibInit( ) - init DPRAM memory allocation driver
m82xxDpramMalloc( ) - allocate memory from DPRAM main pool
m82xxDpramAlignedMalloc( ) - allocate aligned memory from DPRAM main pool
m82xxDpramFree( ) - free allocated memory from DPRAM main pool
m82xxDpramFccMalloc( ) - allocate memory from DPRAM FCC special pool
m82xxDpramFccFree( ) - free allocated memory from DPRAM FCC special pool
smc8260DevInit( ) - initialize the SMC
smc8260Int( ) - handle an SMC interrupt
sysSerialHwInit( ) - initialize the BSP serial devices to a quiesent state
sysSerialHwInit2( ) - connect BSP serial device interrupts
sysSerialChanGet( ) - get the SIO_CHAN device associated with a serial channel
sysSerialReset( ) - reset the serail device
m8260IntrInit( ) - initialize the interrupt manager for the PowerPC 8260
m8260IntEnable( ) - enable the indicated interrupt
m8260IntDisable( ) - Disable one of the Level or IRQ interrupts into the SIU
m8260IvecToInum( ) - get the relevant interrupt number
sysClkConnect( ) - connect a routine to the system clock interrupt
sysClkEnable( ) - turn on system clock interrupts
sysClkDisable( ) - turn off system clock interrupts
sysClkRateGet( ) - get the system clock rate
sysClkRateSet( ) - set the system clock rate
sysAuxClkConnect( ) - connect a routine to the auxiliary clock interrupt
sysAuxClkDisable( ) - turn off auxiliary clock interrupts
sysAuxClkEnable( ) - turn on auxiliary clock interrupts
sysAuxClkRateGet( ) - get the auxiliary clock rate
sysAuxClkRateSet( ) - set the auxiliary clock rate
sysTimestampConnect( ) - connect a user routine to the timestamp timer interrupt
sysTimestampEnable( ) - initialize and enable the timestamp timer
sysTimestampDisable( ) - turn off auxiliary clock interrupts
sysTimestampPeriod( ) - get the period of a timestamp timer
sysTimestampFreq( ) - get a timestamp timer clock frequency
sysTimestamp( ) - get a timestamp timer tick count
sysTimestampLock( ) - lock interrupts and get the timestamp timer tick count
sysLedInit( ) - Initialize LEDs.
sysLedOff( ) - Turn selected LED off.
sysLedOn( ) - Turn selected LED on.
sysLedControl( ) - Turn selected LED(s) on or off.
sysCacheLock( ) - locks specified data/instruction region
sysCacheUnlock( ) - Unlocks the previous locked cache
pciAutoConfigLibInit( ) - initialize PCI autoconfig library.
pciAutoCfg( ) - Automatically configure all nonexcluded PCI headers.
pciAutoCfgCtl( ) - set or get pciAutoConfigLib options.
pciAutoDevReset( ) - Quiesce a PCI device and reset all writeable status bits.
pciAutoBusNumberSet( ) - Set the primary, secondary, and subordinate bus number.
pciAutoFuncDisable( ) - Disable a specific PCI function.
pciAutoFuncEnable( ) - Perform final configuration and enable a function.
pciAutoGetNextClass( ) - find the next device of specific type from probe list.
pciAutoRegConfig( ) - Assign PCI space to a single PCI base address register.
pciAutoAddrAlign( ) - Align a PCI address and check boundary conditions.
pciAutoConfig( ) - Automatically configure all nonexcluded PCI headers. Obsolete.
sysPciAutoConfig( ) - PCI autoConfig support routine
sysPciFindDevice( ) - find the nth device with the given device & vendor ID
pciConfigLibInit( ) - initialize the configuration access-method and addresses
pciFindDevice( ) - find the nth device with the given device & vendor ID
pciFindClass( ) - find the nth occurence of a device by PCI class code.
pciDevConfig( ) - configure a device on a PCI bus
pciConfigBdfPack( ) - pack parameters for the Configuration Address Register
pciConfigExtCapFind( ) - find extended capability in ECP linked list
pciConfigInByte( ) - read one byte from the PCI configuration space
pciConfigInWord( ) - read one word from the PCI configuration space
pciConfigInLong( ) - read one longword from the PCI configuration space
pciConfigOutByte( ) - write one byte to the PCI configuration space
pciConfigOutWord( ) - write one 16-bit word to the PCI configuration space
pciConfigOutLong( ) - write one longword to the PCI configuration space
pciConfigModifyLong( ) - Perform a masked longword register update
pciConfigModifyWord( ) - Perform a masked longword register update
pciConfigModifyByte( ) - Perform a masked longword register update
pciSpecialCycle( ) - generate a special cycle with a message
pciConfigForeachFunc( ) - check condition on specified bus
pciConfigReset( ) - disable cards for warm boot
pciIntLibInit( ) - initialize the pciIntLib module
pciInt( ) - interrupt handler for shared PCI interrupt.
pciIntConnect( ) - connect the interrupt handler to the PCI interrupt.
pciIntDisconnect( ) - disconnect the interrupt handler (OBSOLETE)
pciIntDisconnect2( ) - disconnect an interrupt handler from the PCI interrupt.
pciDeviceShow( ) - print information about PCI devices
pciHeaderShow( ) - print a header of the specified PCI device
pciFindDeviceShow( ) - find a device by deviceId, then print an information.
pciFindClassShow( ) - find a device by 24-bit class code
pciConfigStatusWordShow( ) - show the decoded value of the status word
pciConfigCmdWordShow( ) - show the decoded value of the command word
pciConfigFuncShow( ) - show configuration details about a function
pciConfigTopoShow( ) - show PCI topology
sysPowerSpanPciEncode( ) - encode parameters for the Configuration Address
sysPowerSpanPciConfigWrite( ) - writes one PCI configuration space location
sysPowerSpanPciConfigRead( ) - reads one PCI configuration register location
sysPowerSpanInit( ) - initialize the PowerSpan PCIBus bridge controller
sysPowerSpanPostAutoConfigInit( ) - initializes the Power Span Auto Config
sysCheckIfVware( ) - check if we were lunched by vWARE
sysMotFccEndLoad( ) - load an istance of the motFccEnd driver
sysFccEnetEnable( ) - enable the MII interface to the FCC controller
sysFccEnetDisable( ) - disable MII interface to the FCC controller
sysFccEnetAddrGet( ) - get the hardware Ethernet address
sysFccEnetCommand( ) - issue a command to the Ethernet interface controller
sysFccMiiBitWr( ) - write one bit to the MII interface
sysFccMiiBitRd( ) - read one bit from the MII interface
sysDelay( ) - delay for a moment
sysFei82557EndLoad( ) - load fei82557 (fei) device.
sys557PciInit( ) - prepare LAN adapter for 82557 initialization
sys557Init( ) - prepare LAN adapter for 82557 initialization
sysNetHwInit( ) - initialize the network interface
sysNetHwInit2( ) - initialize additional features of the network interface
sysModel( ) - return the model name of the CPU board
sysBspRev( ) - return the BSP version and revision number
sysHwInit( ) - initialize the system hardware
sysPhysMemTop( ) - get the address of the top of physical memory
sysMemTop( ) - get the address of the top of VxWorks memory
sysToMonitor( ) - transfer control to the ROM monitor
sysHwInit2( ) - initialize additional system hardware
sysProcNumGet( ) - get the processor number
sysProcNumSet( ) - set the processor number
vxImmrSet( ) - Set the IMMR to a specific value
vxImmrGet( ) - return the current IMMR value
sysBaudClkFreq( ) - returns the frequency of the BRG clock
sysClkRateAdjust( ) - calculates proper decrementer frequency for a cpu frequency
sysInputFreqGet( ) - determines the Input Oscillator clock frequency
sysCpmFreqGet( ) - determines the CPM operating frequency
sysCoreFreqGet( ) - determines the Core operating frequency
sysModckHGet( ) - determines the value of MODCK_H reset configuration value
sysModck13Get( ) - determines the value of MODCK[1-3] reset configuration value
sysChipRev( ) - determines revision of Chip installed
sysCpmReset( ) - issues a CPM reset command
sysUserSwitchGet( ) - returns the value of the User Dip Switch
Depending on the value of CPU passed to the system by the compiler command line, the CPU_FAMILY is defined. This must be the first header file included by vxWorks.h.
eepromNvRamSetup( ) - setup non-volatile ram system
void eepromNvRamSetup (void)
This routine setup the Non-Volatile RAM.
N/A
sysLib, eepromReadByte( ), eepromWriteByte( ), eepromUnlock( ), eepromLock( )
eepromReadByte( ) - read one byte of Non-Volatile Ram
UINT8 eepromReadByte ( int offset )
This routine read one byte of Non-Volatile RAM.
One byte of data.
sysLib, eepromNvRamSetup( ), eepromWriteByte( ), eepromUnlock( ), eepromLock( )
eepromWriteByte( ) - write one byte to Non-Volatile Ram
STATUS eepromWriteByte ( int offset, UINT8 data )
This routine write one byte of data to nonvolatile ram.
OK or ERROR if cannot write nvram
sysLib, eepromNvRamSetup( ), eepromReadByte( ), eepromUnlock( ), eepromLock( )
eepromUnlock( ) - Unlock the eeprom via the software protection mechanism
void eepromUnlock (void)
This routine unlock the eeprom via the software protection mechanism.
N/A
sysLib, eepromNvRamSetup( ), eepromReadByte( ), eepromWriteByte( ), eepromLock( )
eepromLock( ) - Lock the eeprom via the software protection mechanism
void eepromLock (void)
This routine lock the eeprom via the software protection mechanism.
N/A
sysLib, eepromNvRamSetup( ), eepromReadByte( ), eepromWriteByte( ), eepromUnlock( )
eepromDelay( ) - eeprom delay routine
void eepromDelay ( ULONG delay )
This routine is the eeprom delay routine.
N/A
sysNvRamGet( ) - get the contents of non-volatile RAM
STATUS sysNvRamGet ( char * string, /* where to copy non-volatile RAM */ int strLen, /* maximum number of bytes to copy */ int offset /* byte offset into non-volatile RAM */ )
This routine copies the contents of non-volatile memory into a specified string. The string is terminated with an EOS.
OK, or ERROR if access is outside the non-volatile RAM range.
sysLib, sysNvRamSet( )
sysNvRamSet( ) - write to non-volatile RAM
STATUS sysNvRamSet ( char * string, /* string to be copied into non-volatile RAM */ int strLen, /* maximum number of bytes to copy */ int offset /* byte offset into non-volatile RAM */ )
This routine copies a specified string into non-volatile RAM.
OK, or ERROR if access is outside the non-volatile RAM range.
sysLib, sysNvRamGet( )
sysLocalToBusAdrs( ) - convert a local address to a bus address
STATUS sysLocalToBusAdrs ( int adrsSpace, /* bus address space in which busAdrs */ /* resides, use address modifier codes defined */ /* in vme.h, such as VME_AM_STD_SUP_DATA */ char * localAdrs, /* local address to convert */ char * *pBusAdrs /* where to return bus address */ )
This routine gets the VMEbus address that accesses a specified local memory address.
This routine has no effect, since there is no VMEbus.
ERROR, always.
sysBusToLocalAdrs( ) - convert a bus address to a local address
STATUS sysBusToLocalAdrs ( int adrsSpace, /* bus address space in which busAdrs */ /* resides, use address modifier codes defined */ /* in vme.h, such as VME_AM_STD_SUP_DATA */ char * busAdrs, /* bus address to convert */ char * *pLocalAdrs /* where to return local address */ )
This routine gets the local address that accesses a specified VMEbus address.
This routine has no effect, since there is no VMEbus.
ERROR, always.
sysBusIntAck( ) - acknowledge a bus interrupt
int sysBusIntAck ( int intLevel /* interrupt level to acknowledge */ )
This routine acknowledges a specified VMEbus interrupt level.
This routine has no effect, since there is no VMEbus.
NULL.
sysBusIntGen( ) - generate a bus interrupt
STATUS sysBusIntGen ( int level, /* bus interrupt level to generate */ int vector /* interrupt vector to return (0-255) */ )
This routine generates a VMEbus interrupt for a specified level with a specified vector.
This routine has no effect, since there is no VMEbus.
ERROR, always.
sysMailboxConnect( ) - connect a routine to the mailbox interrupt
STATUS sysMailboxConnect ( FUNCPTR routine, /* routine called at each mailbox interrupt */ int arg /* argument with which to call routine */ )
This routine specifies the interrupt service routine to be called at each mailbox interrupt.
This routine has no effect, since the hardware does not support mailbox interrupts.
ERROR, always.
sysMailboxEnable( ) - enable the mailbox interrupt
STATUS sysMailboxEnable ( INT8 * mailboxAdrs /* mailbox address */ )
This routine enables the mailbox interrupt.
This routine has no effect, since the hardware does not support mailbox interrupts.
ERROR, always.
sysBusTas( ) - test and set a location across the bus
BOOL sysBusTas ( INT8 * addr /* address to be tested and set */ )
This routine performs a test-and-set (TAS) instruction across the backplane.
This routine is equivalent to vxTas( ), since there is no VMEbus.
TRUE if the value had not been set but is now, or FALSE if the value was set already.
m82xxDpramLibInit( ) - init DPRAM memory allocation driver
void m82xxDpramLibInit (void)
This routine init the DPRAM memory allocation driver.
N/A
sysLib, m82xxDpramAlignedAddr( ), m82xxDpramAllocRange( ), m82xxDpramFindFreeEntry( ), m82xxDpramAllocateRange( ), m82xxDpramReleaseRenage( ), m82xxDpramMalloc( ), m82xxDpramAlignedMalloc( ), m82xxDpramFree( ), m82xxDpramFccMalloc( ), m82xxDpramFccFree( )
m82xxDpramMalloc( ) - allocate memory from DPRAM main pool
void * m82xxDpramMalloc ( size_t length )
This routine allocate memory from DPRAM main pool.
pointer to allocated memory
sysLib, m82xxDpramAlignedAddr( ), m82xxDpramAllocRange( ), m82xxDpramFindFreeEntry( ), m82xxDpramAllocateRange( ), m82xxDpramReleaseRenage( ), m82xxDpramLibInit( ), m82xxDpramAlignedMalloc( ), m82xxDpramFree( ), m82xxDpramFccMalloc( ), m82xxDpramFccFree( )
m82xxDpramAlignedMalloc( ) - allocate aligned memory from DPRAM main pool
void * m82xxDpramAlignedMalloc ( size_t length, size_t alignment )
This routine allocate aligned memory from DRPAM main pool.
pointer to allocated aligend memory
sysLib, m82xxDpramAlignedAddr( ), m82xxDpramAllocRange( ), m82xxDpramFindFreeEntry( ), m82xxDpramAllocateRange( ), m82xxDpramReleaseRenage( ), m82xxDpramLibInit( ), m82xxDpramMalloc( ), m82xxDpramFree( ), m82xxDpramFccMalloc( ), m82xxDpramFccFree( )
m82xxDpramFree( ) - free allocated memory from DPRAM main pool
void m82xxDpramFree ( void * addr )
This routine free allocated memory from DPRAM main pool.
N/A
sysLib, m82xxDpramAlignedAddr( ), m82xxDpramAllocRange( ), m82xxDpramFindFreeEntry( ), m82xxDpramAllocateRange( ), m82xxDpramReleaseRenage( ), m82xxDpramLibInit( ), m82xxDpramMalloc( ), m82xxDpramAlignedMalloc( ), m82xxDpramFccMalloc( ), m82xxDpramFccFree( )
m82xxDpramFccMalloc( ) - allocate memory from DPRAM FCC special pool
void * m82xxDpramFccMalloc ( size_t length, size_t alignment )
This routine allocate memory from DPRAM FCC special pool.
pointer to allocated memory
sysLib, m82xxDpramAlignedAddr( ), m82xxDpramAllocRange( ), m82xxDpramFindFreeEntry( ), m82xxDpramAllocateRange( ), m82xxDpramReleaseRenage( ), m82xxDpramLibInit( ), m82xxDpramMalloc( ), m82xxDpramAlignedMalloc( ), m82xxDpramFree( ), m82xxDpramFccFree( )
m82xxDpramFccFree( ) - free allocated memory from DPRAM FCC special pool
void m82xxDpramFccFree ( void * addr )
This routine free alocated memory from DPRAM FCC special pool.
pointer to allocated memory
sysLib, m82xxDpramAlignedAddr( ), m82xxDpramAllocRange( ), m82xxDpramFindFreeEntry( ), m82xxDpramAllocateRange( ), m82xxDpramReleaseRenage( ), m82xxDpramLibInit( ), m82xxDpramMalloc( ), m82xxDpramAlignedMalloc( ), m82xxDpramFree( ), m82xxDpramFccMalloc( )
smc8260DevInit( ) - initialize the SMC
void smc8260DevInit ( PPC8260SMC_CHAN * pChan )
This routine is called to initialize the chip to a quiescent state. Note that the smcNum field of PPC8260SMC_CHAN must be either 1 or 2.
N/A.
smc8260Int( ) - handle an SMC interrupt
void smc8260Int ( PPC8260SMC_CHAN * pChan )
This routine is called to handle SMC interrupts.
N/A
sysSerialHwInit( ) - initialize the BSP serial devices to a quiesent state
void sysSerialHwInit (void)
This routine initializes the BSP serial device descriptors and puts the devices in a quiesent state. It is called from sysHwInit( ) with interrupts locked.
N/A
sysSerialHwInit2( ) - connect BSP serial device interrupts
void sysSerialHwInit2 (void)
This routine connects the BSP serial device interrupts. It is called from sysHwInit2( ). Serial device interrupts could not be connected in sysSerialHwInit( ) because the kernel memory allocator was not initialized at that point, and intConnect( ) calls malloc( ).
N/A
sysLib, sysHwInit2( )
sysSerialChanGet( ) - get the SIO_CHAN device associated with a serial channel
SIO_CHAN * sysSerialChanGet ( int channel /* serial channel - [0, 1] */ )
This routine gets the SIO_CHAN device associated with a specified serial channel.
A pointer to the SIO_CHAN structure for the channel, or ERROR if the channel is invalid.
sysSerialReset( ) - reset the serail device
void sysSerialReset (void)
This function calls sysSerialHwInit( ) to reset the serail device
N/A
m8260IntrInit( ) - initialize the interrupt manager for the PowerPC 8260
STATUS m8260IntrInit ()
This routine connects the default demultiplexer, m8260IntrDeMux( ), to the external interrupt vector and associates all interrupt sources with the default interrupt handler. This routine is called by sysHwInit( ) in sysLib.c.
All interrupt from the SIU unit are enabled, CICR is setup so that SCC1 has the highest relative interrupt priority, through SCC4 with the lowest.
OK always
m8260IntEnable( ) - enable the indicated interrupt
int m8260IntEnable ( int intNum /* interrupt level to enable */ )
This routine will enable the indicated interrupt by setting the appropriate bit in the SIU Interrupt Mask Registers.
The design of the 8260 presents the following design requirements:
1. the mapping from interrupt number to mask bit can not be represented by
a function. An array, indexed by interrupt number (INUM), is used to map
the interrupt number to the appropriate mask.2. There are two 32 bit mask registers (SIMR_L and SIMR_H). The interrupt
number must be compared to 4 ranges to determine which register contains
its mask bit:
interrupt number in m8260IntrCtl.h register ---------------- ------- 0-15 SIMR_L 16-31 SIMR_H 32-47 SIMR_L 48-63 SIMR_H
0, always.
m8260IntDisable( ) - Disable one of the Level or IRQ interrupts into the SIU
int m8260IntDisable ( int intNum /* interrupt level to disable */ )
This routine will mask the bit in the SIMASK register corresponding to the requested interrupt level.
0, always.
m8260IvecToInum( ) - get the relevant interrupt number
int m8260IvecToInum ( VOIDFUNCPTR * vector /* interrupt vector to attach to */ )
This routine finds out the interrupt number associated with the vector in vector.
vector types are defined in h/drv/intrClt/m8260Intr.h.
the interrupt number for the vector
sysLib, m8260Intr.h
sysClkConnect( ) - connect a routine to the system clock interrupt
STATUS sysClkConnect ( FUNCPTR routine, /* routine to connect */ int arg /* argument for the routine */ )
This routine specifies the interrupt service routine to be called at each clock interrupt. Normally, it is called from usrRoot( ) in usrConfig.c to connect usrClock( ) to the system clock interrupt.
OK, or ERROR if the routine cannot be connected to the interrupt.
sysLib, intConnect( ), usrClock( ), sysClkEnable( )
sysClkEnable( ) - turn on system clock interrupts
void sysClkEnable (void)
This routine enables system clock interrupts.
N/A
sysLib, sysClkConnect( ), sysClkDisable( ), sysClkRateSet( )
sysClkDisable( ) - turn off system clock interrupts
void sysClkDisable (void)
This routine disables system clock interrupts.
N/A
sysLib, sysClkEnable( )
sysClkRateGet( ) - get the system clock rate
int sysClkRateGet (void)
This routine returns the system clock rate.
The number of ticks per second of the system clock.
sysLib, sysClkEnable( ), sysClkRateSet( )
sysClkRateSet( ) - set the system clock rate
STATUS sysClkRateSet ( int ticksPerSecond /* number of clock interrupts per second */ )
This routine sets the interrupt rate of the system clock. It is called by usrRoot( ) in usrConfig.c.
OK, or ERROR if the tick rate is invalid or the timer cannot be set.
sysLib, sysClkEnable( ), sysClkRateGet( )
sysAuxClkConnect( ) - connect a routine to the auxiliary clock interrupt
STATUS sysAuxClkConnect ( FUNCPTR routine, /* routine called at each aux. clock interrupt */ int arg /* argument to auxiliary clock interrupt */ /* routine */ )
This routine specifies the interrupt service routine to be called at each auxiliary clock interrupt. It does not enable auxiliary clock interrupts.
OK, or ERROR if the routine cannot be connected to the interrupt.
sysLib, intConnect( ), sysAuxClkEnable( )
sysAuxClkDisable( ) - turn off auxiliary clock interrupts
void sysAuxClkDisable (void)
This routine disables auxiliary clock interrupts.
N/A
sysAuxClkEnable( ) - turn on auxiliary clock interrupts
void sysAuxClkEnable (void)
This routine enables auxiliary clock interrupts. The timer is used in "reference mode" i.e. a value is programmed into the reference register and an interrupt occurs when the timer reaches that value.
N/A
sysLib, sysAuxClkConnect( ), sysAuxClkDisable( ), sysAuxClkRateSet( )
sysAuxClkRateGet( ) - get the auxiliary clock rate
int sysAuxClkRateGet (void)
This routine returns the interrupt rate of the auxiliary clock.
The number of ticks per second of the auxiliary clock.
sysLib, sysAuxClkEnable( ), sysAuxClkRateSet( )
sysAuxClkRateSet( ) - set the auxiliary clock rate
STATUS sysAuxClkRateSet ( int ticksPerSecond /* number of clock interrupts per second */ )
This routine sets the interrupt rate of the auxiliary clock. It does not enable auxiliary clock interrupts.
OK, or ERROR if the tick rate is invalid or the timer cannot be set.
sysLib, sysAuxClkEnable( ), sysAuxClkRateGet( )
sysTimestampConnect( ) - connect a user routine to the timestamp timer interrupt
STATUS sysTimestampConnect ( FUNCPTR routine, /* routine called at each timestamp timer */ /* interrupt */ int arg /* argument with which to call routine */ )
This routine specifies the user interrupt routine to be called at each timestamp timer interrupt. It does not enable the timestamp timer itself.
OK, or ERROR if sysTimestampInt( ) interrupt handler is not used.
sysTimestampEnable( ) - initialize and enable the timestamp timer
STATUS sysTimestampEnable (void)
This routine connects interrupts, and enables the timer device
TRUE always
sysTimestampDisable( ) - turn off auxiliary clock interrupts
STATUS sysTimestampDisable (void)
This routine disables auxiliary clock interrupts.
OK, always
sysTimestampPeriod( ) - get the period of a timestamp timer
UINT32 sysTimestampPeriod (void)
This routine gets the period of the timestamp timer, in ticks. The period, or terminal count, is the number of ticks to which the timestamp timer counts before rolling over and restarting the counting process.
The period of the timestamp timer in counter ticks.
sysTimestampFreq( ) - get a timestamp timer clock frequency
UINT32 sysTimestampFreq (void)
This routine gets the frequency of the timer clock, in ticks per second. The rate of the timestamp timer is set explicitly by the hardware and typically cannot be altered.
The timestamp timer clock frequency, in ticks per second.
sysTimestamp( ) - get a timestamp timer tick count
UINT32 sysTimestamp (void)
This routine returns the current value of the timestamp timer tick counter. The tick count can be converted to seconds by dividing it by the return of sysTimestampFreq( ).
This routine should be called with interrupts locked. If interrupts are not locked, sysTimestampLock( ) should be used instead.
The current timestamp timer tick count.
sysLib, sysTimestampFreq( ), sysTimestampLock( )
sysTimestampLock( ) - lock interrupts and get the timestamp timer tick count
UINT32 sysTimestampLock (void)
This routine locks interrupts when the tick counter must be stopped in order to read it or when two independent counters must be read. It then returns the current value of the timestamp timer tick counter.
The tick count can be converted to seconds by dividing it by the return of sysTimestampFreq( ).
If interrupts are already locked, sysTimestamp( ) should be used instead.
The current timestamp timer tick count.
sysLib, sysTimestampFreq( ), sysTimestamp( )
sysLedInit( ) - Initialize LEDs.
void sysLedInit (void)
This routine initializes the LED variable to zero and clears all LEDs.
N/A.
sysLib, sysLedOn( ), sysLedOff( ), sysLedControl( ).
sysLedOff( ) - Turn selected LED off.
void sysLedOff ( UINT8 led )
This routine set the selected LED to off.
N/A.
sysLib, sysLedInit( ), sysLedOff( ), sysLedControl( ).
sysLedOn( ) - Turn selected LED on.
void sysLedOn ( UINT8 led )
This routine set the selected LED to on.
N/A.
sysLib, sysLedInit( ), sysLedOn( ), sysLedControl( ).
sysLedControl( ) - Turn selected LED(s) on or off.
void sysLedControl ( int ledOn, UINT8 led )
This routine sets the selected LED on or off.
N/A.
sysLib, sysLedInit( ), sysLedOff( ), sysLedOn( ).
sysCacheLock( ) - locks specified data/instruction region
STATUS sysCacheLock ( CACHE_TYPE cacheType, void * adrs, UINT32 bytes )
This routine locks the specified region into the cache, cacheType. The region to be locked is specified by the start address, adrs, and the size, bytes. The region -- the start address, and size -- must be aligned on a 32-byte boundary.
Multiple calls to this routine will silently unlock the specified cache to lock the new region.
OK or error if cache is locked, or if cache is not supported.
sysLib, sysCacheUnlock( )
sysCacheUnlock( ) - Unlocks the previous locked cache
STATUS sysCacheUnlock ( CACHE_TYPE cacheType )
This routines unlocks the specified cache, cacheType
OK or error if cache is not supported.
sysLib, sysCacheLock( )
pciAutoConfigLibInit( ) - initialize PCI autoconfig library.
void * pciAutoConfigLibInit ( void * pArg /* reserved for future use */ )
pciAutoConfigLib initialization function.
not set
A cookie for use by subsequent pciAutoConfigLib function
calls.
pciAutoCfg( ) - Automatically configure all nonexcluded PCI headers.
STATUS pciAutoCfg ( void * pCookie /* cookie returned by pciAutoConfigLibInit() */ )
Top level function in the PCI configuration process.
pCookie = pciAutoConfigLibInit(NULL); pciAutoCfgCtl(pCookie, COMMAND, VALUE); ... pciAutoCfgCtl(pCookie, COMMAND, VALUE); pciAutoCfg(pCookie);For ease in converting from the old interface to the new one, a pciAutoCfgCtl( ) command PCI_PSYSTEM_STRUCT_COPY has been implemented. This can be used just like any other pciAutoCfgCtl( ) command, and it will initialize all the values in pSystem. If used, it should be the first call to pciAutoCfgCtl( ).For a description of the COMMANDs and VALUEs to pciAutoCfgCtl( ), see the pciAutoCfgCtl( ) documentation.
For all nonexcluded PCI functions on all PCI bridges, this routine will automatically configure the PCI configuration headers for PCI devices and subbridges. The fields that are programmed are:
1. Status register. 2. Command Register. 3. Latency timer. 4. Cache Line size. 5. Memory and/or I/O base address and limit registers. 6. Primary, secondary, subordinate bus number (for PCI-PCI bridges). 7. Expansion ROM disable. 8. Interrupt Line.
Probe PCI config space and create a list of available PCI functions. Call device exclusion function, if registered, to exclude/include device. Disable all devices before we initialize any. Allocate and assign PCI space to each device. Calculate and set interrupt line value. Initialize and enable each device.
N/A.
pciAutoCfgCtl( ) - set or get pciAutoConfigLib options.
STATUS pciAutoCfgCtl ( void * pCookie, /* system configuration information */ int cmd, /* command word */ void * pArg /* argument for the cmd */ )
pciAutoCfgCtl( ) can be considered analogous to ioctl( ) calls: the call takes arguments of (1) a pCookie, returned by pciAutoConfigLibInit( ). (2) A command, macros for which are defined in pciAutoConfigLib.h. And, (3) an argument, the type of which depends on the specific command, but will always fit in a pointer variable. Currently, only globally effective commands are implemented.
The commands available are:
- PCI_FBB_ENABLE - BOOL * pArg
- PCI_FBB_DISABLE - void
- PCI_FBB_UPDATE - BOOL * pArg
- PCI_FBB_STATUS_GET - BOOL * pArg
- Enable and disable the functions which check Fast Back To Back functionality. PCI_FBB_UPDATE is for use with dynamic/HA applications. It will first disable FBB on all functions, then enable FBB on all functions, if appropriate. In HA applications, it should be called any time a card is added or removed. The BOOL pointed to by pArg for PCI_FBB_ENABLE and PCI_FBB_UPDATE will be set to TRUE if all cards allow FBB functionality and FALSE if either any card does not allow FBB functionality or if FBB is disabled. The BOOL pointed to by pArg for PCI_FBB_STATUS_GET will be set to TRUE if PCI_FBB_ENABLE has been called and FBB is enabled, even if FBB is not activated on any card. It will be set to FALSE otherwise.
Note that in the current implementation, FBB will be enabled or disabled on the entire bus. If any device anywhere on the bus cannot support FBB, then it is not enabled, even if specific sub-busses could support it.
- PCI_MAX_LATENCY_FUNC_SET - FUNCPTR * pArg
- This routine will be called for each function present on the bus when discovery takes place. The routine must accept four arguments, specifying bus, device, function, and a user-supplied argument of type void *. See PCI_MAX_LATENCY_ARG_SET. The routine should return a UINT8 value, which will be put into the MAX_LAT field of the header structure. The user supplied routine must return a valid value each time it is called. There is no mechanism for any ERROR condition, but a default value can be returned in such a case. Default = NULL.
- PCI_MAX_LATENCY_ARG_SET - void * pArg
- When the routine specified in PCI_MAX_LATENCY_FUNC_SET is called, this will be passed to it as the fourth argument.
- PCI_MAX_LAT_ALL_SET - int pArg
- Specifies a constant max latency value for all cards, if no function has been specified with PCI_MAX_LATENCY_FUNC_SET..
- PCI_MAX_LAT_ALL_GET - UINT * pArg
- Retrieves the value of max latency for all cards, if no function has been specified with PCI_MAX_LATENCY_FUNC_SET. Otherwise, the integer pointed to by pArg is set to the value 0xffffffff.
- PCI_MSG_LOG_SET - FUNCPTR * pArg
- The argument specifies a routine will be called to print warning or error messages from pciAutoConfigLib if logMsg( ) has not been initialized at the time pciAutoConfigLib is used. The specified routine must accept arguments in the same format as logMsg( ), but it does not necessarily need to print the actual message. An example of this routine is presented below, which saves the message into a safe memory space and turns on an LED. This command is useful for BSPs which call pciAutoCfg( ) before message logging is enabled. Note that after logMsg( ) is configured, output will go to logMsg( ) even if this command has been called. Default = NULL.
/* sample PCI_MSG_LOG_SET function */ int pciLogMsg(char *fmt,int a1,int a2,int a3,int a4,int a5,int a6) { sysLedOn(4); return(sprintf(sysExcMsg,fmt,a1,a2,a3,a4,a5,a6)); }- PCI_MAX_BUS_GET - int * pArg
- During autoconfiguration, the library will maintain a counter with the highest numbered bus. This can be retrieved by
pciAutoCfgCtl(pCookie, PCI_MAX_BUS_GET, &maxBus)- PCI_CACHE_SIZE_SET - int pArg
- Sets the pci cache line size to the specified value. See CONFIGURATION SPACE PARAMETERS in the pciAutoConfigLib documentation for more details.
- PCI_CACHE_SIZE_GET - int * pArg
- Retrieves the value of the pci cache line size.
- PCI_AUTO_INT_ROUTE_SET - BOOL pArg
- Enables or disables automatic interrupt routing across bridges during the autoconfig process. See "INTERRUPT ROUTING ACROSS PCI-TO-PCI BRIDGES" in the pciAutoConfigLib documentation for more details.
- PCI_AUTO_INT_ROUTE_GET - BOOL * pArg
- Retrieves the status of automatic interrupt routing.
- PCI_MEM32_LOC_SET - UINT32 pArg
- Sets the base address of the PCI 32-bit memory space. Normally, this is given by the BSP constant PCI_MEM_ADRS.
- PCI_MEM32_SIZE_SET - UINT32 pArg
- Sets the maximum size to use for the PCI 32-bit memory space. Normally, this is given by the BSP constant PCI_MEM_SIZE.
- PCI_MEM32_SIZE_GET - UINT32 * pArg
- After autoconfiguration has been completed, this retrieves the actual amount of space which has been used for the PCI 32-bit memory space.
- PCI_MEMIO32_LOC_SET - UINT32 pArg
- Sets the base address of the PCI 32-bit non-prefetch memory space. Normally, this is given by the BSP constant PCI_MEMIO_ADRS.
- PCI_MEMIO32_SIZE_SET - UINT32 pArg
- Sets the maximum size to use for the PCI 32-bit non-prefetch memory space. Normally, this is given by the BSP constant PCI_MEMIO_SIZE.
- PCI_MEMIO32_SIZE_GET - UINT32 * pArg
- After autoconfiguration has been completed, this retrieves the actual amount of space which has been used for the PCI 32-bit non-prefetch memory space.
- PCI_IO32_LOC_SET - UINT32 pArg
- Sets the base address of the PCI 32-bit I/O space. Normally, this is given by the BSP constant PCI_IO_ADRS.
- PCI_IO32_SIZE_SET - UINT32 pArg
- Sets the maximum size to use for the PCI 32-bit I/O space. Normally, this is given by the BSP constant PCI_IO_SIZE.
- PCI_IO32_SIZE_GET - UINT32 * pArg
- After autoconfiguration has been completed, this retrieves the actual amount of space which has been used for the PCI 32-bit I/O space.
- PCI_IO16_LOC_SET - UINT32 pArg
- Sets the base address of the PCI 16-bit I/O space. Normally, this is given by the BSP constant PCI_ISA_IO_ADRS
- PCI_IO16_SIZE_SET - UINT32 pArg
- Sets the maximum size to use for the PCI 16-bit I/O space. Normally, this is given by the BSP constant PCI_ISA_IO_SIZE
- PCI_IO16_SIZE_GET - UINT32 * pArg
- After autoconfiguration has been completed, this retrieves the actual amount of space which has been used for the PCI 16-bit I/O space.
- PCI_INCLUDE_FUNC_SET - FUNCPTR * pArg
- The device inclusion routine is specified by assigning a function pointer with the PCI_INCLUDE_FUNC_SET pciAutoCfgCtl( ) command:
pciAutoCfgCtl(pSystem, PCI_INCLUDE_FUNC_SET,sysPciAutoconfigInclude);This optional user-supplied routine takes as input both the bus-device-function tuple, and a 32-bit quantity containing both the PCI vendorID and deviceID of the function. The function prototype for this function is shown below:STATUS sysPciAutoconfigInclude ( PCI_SYSTEM *pSys, PCI_LOC *pLoc, UINT devVend );This optional user-specified routine is called by PCI AutoConfig for each and every function encountered in the scan phase. The BSP developer may use any combination of the input data to ascertain whether a device is to be excluded from the autoconfig process. The exclusion routine then returns ERROR if a device is to be excluded, and OK if a device is to be included in the autoconfiguration process.Note that PCI-to-PCI Bridges may not be excluded, regardless of the value returned by the BSP device inclusion routine. The return value is ignored for PCI-to-PCI bridges.
The Bridge device will be always be configured with proper primary, secondary, and subordinate bus numbers in the device scanning phase and proper I/O and Memory aperture settings in the configuration phase of autoconfig regardless of the value returned by the BSP device inclusion routine.
- PCI_INT_ASSIGN_FUNC_SET - FUNCPTR * pArg
- The interrupt assignment routine is specified by assigning a function pointer with the PCI_INCLUDE_FUNC_SET pciAutoCfgCtl( ) command:
pciAutoCfgCtl(pCookie, PCI_INT_ASSIGN_FUNC_SET, sysPciAutoconfigIntrAssign);This optional user-specified routine takes as input both the bus-device-function tuple, and an 8-bit quantity containing the contents of the interrupt Pin register from the PCI configuration header of the device under consideration. The interrupt pin register specifies which of the four PCI Interrupt request lines available are connected. The function prototype for this function is shown below:UCHAR sysPciAutoconfigIntrAssign ( PCI_SYSTEM *pSys, PCI_LOC *pLoc, UCHAR pin );This routine may use any combination of these data to ascertain the interrupt level. This value is returned from the function, and will be programmed into the interrupt line register of the function's PCI configuration header. In this manner, device drivers may subsequently read this register in order to calculate the appropriate interrupt vector which to attach an interrupt service routine.
- PCI_BRIDGE_PRE_CONFIG_FUNC_SET - FUNCPTR * pArg
- The bridge pre-configuration pass initialization routine is provided so that the BSP Developer can initialize a bridge device prior to the configuration pass on the bus that the bridge implements. This routine is specified by calling pciAutoCfgCtl( ) with the PCI_BRIDGE_PRE_CONFIG_FUNC_SET command:
pciAutoCfgCtl(pCookie, PCI_BRIDGE_PRE_CONFIG_FUNC_SET, sysPciAutoconfigPreEnumBridgeInit);This optional user-specified routine takes as input both the bus-device-function tuple, and a 32-bit quantity containing both the PCI deviceID and vendorID of the device. The function prototype for this function is shown below:STATUS sysPciAutoconfigPreEnumBridgeInit ( PCI_SYSTEM *pSys, PCI_LOC *pLoc, UINT devVend );This routine may use any combination of these input data to ascertain any special initialization requirements of a particular type of bridge at a specified geographic location.
- PCI_BRIDGE_POST_CONFIG_FUNC_SET - FUNCPTR * pArg
- The bridge post-configuration pass initialization routine is provided so that the BSP Developer can initialize the bridge device after the bus that the bridge implements has been enumerated. This routine is specified by calling pciAutoCfgCtl( ) with the PCI_BRIDGE_POST_CONFIG_FUNC_SET command
pciAutoCfgCtl(pCookie, PCI_BRIDGE_POST_CONFIG_FUNC_SET, sysPciAutoconfigPostEnumBridgeInit);This optional user-specified routine takes as input both the bus-device-function tuple, and a 32-bit quantity containing both the PCI deviceID and vendorID of the device. The function prototype for this function is shown below:STATUS sysPciAutoconfigPostEnumBridgeInit ( PCI_SYSTEM *pSys, PCI_LOC *pLoc, UINT devVend );This routine may use any combination of these input data to ascertain any special initialization requirements of a particular type of bridge at a specified geographic location.
- PCI_ROLLCALL_FUNC_SET - FUNCPTR * pArg
- The specified routine will be configured as a roll call routine.
If a roll call routine has been configured, before any configuration is actually done, the roll call routine is called repeatedly until it returns TRUE. A return value of TRUE indicates that either (1) the specified number and type of devices named in the roll call list have been found during PCI bus enumeration or (2) the timeout has expired without finding all of the specified number and type of devices. In either case, it is assumed that all of the PCI devices which are going to appear on the busses have appeared and we can proceed with PCI bus configuration.
- PCI_TEMP_SPACE_SET - char * pArg
- This command is not currently implemented. It allows the user to set aside memory for use during pciAutoConfigLib execution, e.g. memory set aside using USER_RESERVED_MEM. After PCI configuration has been completed, the memory can be added to the system memory pool using memAddToPool( ).
- PCI_MINIMIZE_RESOURCES
- This command is not currently implemented. It specifies that pciAutoConfigLib minimize requirements for memory and I/O space.
- PCI_PSYSTEM_STRUCT_COPY - PCI_SYSTEM * pArg
- This command has been added for ease of converting from the old interface to the new one. This will set each value as specified in the pSystem structure. If the PCI_SYSTEM structure has already been filled, the pciAutoConfig(pSystem) call can be changed to:
void *pCookie; pCookie = pciAutoConfigLibInit(NULL); pciAutoCfgCtl(pCookie, PCI_PSYSTEM_STRUCT_COPY, (void *)pSystem); pciAutoCfgFunc(pCookie);The fields of the PCI_SYSTEM structure are defined below. For more information about each one, see the paragraphs above and the documentation for pciAutoConfigLib.
- pciMem32
- Specifies the 32-bit prefetchable memory pool base address.
- pciMem32Size
- Specifies the 32-bit prefetchable memory pool size.
- pciMemIo32
- Specifies the 32-bit non-prefetchable memory pool base address.
- pciMemIo32Size
- Specifies the 32-bit non-prefetchable memory pool size
- pciIo32
- Specifies the 32-bit I/O pool base address.
- pciIo32Size
- Specifies the 32-bit I/O pool size.
- pciIo16
- Specifies the 16-bit I/O pool base address.
- pciIo16Size
- Specifies the 16-bit I/O pool size.
- includeRtn
- Specifies the device inclusion routine.
- intAssignRtn
- Specifies the interrupt assignment routine.
- autoIntRouting
- Can be set to TRUE to configure pciAutoConfig( ) only to call the BSP interrupt routing routine for devices on bus number 0. Setting autoIntRoutine to FALSE will configure pciAutoConfig( ) to call the BSP interrupt routing routine for every device regardless of the bos on which the device resides.
- bridgePreInit
- Specifies the bridge initialization routine to call before initializing devices on the bus that the bridge implements.
- bridgePostInit
- Specifies the bridge initialization routine to call after initializing devices on the bus that the bridge implements.
EINVAL if pCookie is not NULL or cmd is not recognized
OK, or ERROR if the command or argument is invalid.
pciAutoDevReset( ) - Quiesce a PCI device and reset all writeable status bits.
STATUS pciAutoDevReset ( PCI_LOC * pPciLoc /* device to be reset */ )
This routine turns off a PCI device by disabling the Memory decoders, I/O decoders, and Bus Master capability. The routine also resets all writeable status bits in the status word that follows the command word sequentially in PCI config space by performing a longword access.
OK, always.
pciAutoBusNumberSet( ) - Set the primary, secondary, and subordinate bus number.
STATUS pciAutoBusNumberSet ( PCI_LOC * pPciLoc, /* device affected */ UINT primary, /* primary bus specification */ UINT secondary, /* secondary bus specification */ UINT subordinate /* subordinate bus specification */ )
This routine sets the primary, secondary, and subordinate bus numbers for a device that implements the Type 1 PCI Configuration Space Header.
This routine has external visibility to enable it to be used by BSP Developers for initialization of PCI Host Bridges that may implement registers similar to those found in the Type 1 Header.
OK, always.
pciAutoFuncDisable( ) - Disable a specific PCI function.
void pciAutoFuncDisable ( PCI_LOC * pPciFunc /* input: Pointer to PCI function struct */ )
This routine clears the I/O, mem, master, & ROM space enable bits for a single PCI function.
The PCI spec says that devices should normally clear these by default after reset but in actual practice, some PCI devices do not fully comply. This routine ensures that the devices have all been disabled before configuration is started.
N/A.
pciAutoFuncEnable( ) - Perform final configuration and enable a function.
void pciAutoFuncEnable ( PCI_SYSTEM * pSys, /* for backwards compatibility */ PCI_LOC * pFunc /* input: Pointer to PCI function structure */ )
Depending upon whether the device is included, this routine initializes a single PCI function as follows:
Initialize the cache line size register Initialize the PCI-PCI bridge latency timers Enable the master PCI bit for non-display devices Set the interrupt line value with the value from the BSP.
N/A.
pciAutoGetNextClass( ) - find the next device of specific type from probe list.
STATUS pciAutoGetNextClass ( PCI_SYSTEM * pSys, /* for backwards compatibility */ PCI_LOC * pPciFunc, /* output: Contains the BDF of the device found */ UINT * index, /* Zero-based device instance number */ UINT pciClass, /* class code field from the PCI header */ UINT mask /* mask is ANDed with the class field */ )
The function uses the probe list which was built during the probing process. Using configuration accesses, it searches for the occurrence of the device subject to the class and mask restrictions outlined below. Setting class to zero and mask to zero allows searching the entire set of devices found regardless of class.
TRUE if a device was found, else FALSE.
pciAutoRegConfig( ) - Assign PCI space to a single PCI base address register.
UINT pciAutoRegConfig ( PCI_SYSTEM * pSys, /* backwards compatibility */ PCI_LOC * pPciFunc, /* Pointer to function in device list */ UINT baseAddr, /* Offset of base PCI address */ UINT nSize, /* Size and alignment requirements */ UINT addrInfo /* PCI address type information */ )
This routine allocates and assigns PCI space (either memory or I/O) to a single PCI base address register.
Returns (1) if BAR supports mapping anywhere in 64-bit address space. Returns (0) otherwise.
pciAutoAddrAlign( ) - Align a PCI address and check boundary conditions.
STATUS pciAutoAddrAlign ( UINT32 base, /* base of available memory */ UINT32 limit, /* last addr of available memory */ UINT32 reqSize, /* required size */ UINT32 * pAlignedBase /* output: aligned address put here */ )
OK, or ERROR if available memory has been exceeded.
pciAutoConfig( ) - Automatically configure all nonexcluded PCI headers. Obsolete.
void pciAutoConfig ( PCI_SYSTEM * pSystem /* PCI system to configure */ )
This routine is obsolete. It is included for backward compatibility only. It is recommended that you use the pciAutoCfg( ) interface instead of this one.
Top level function in the PCI configuration process.
For all nonexcluded PCI functions on all PCI bridges, this routine will automatically configure the PCI configuration headers for PCI devices and subbridges. The fields that are programmed are:
*
1. Status register. 2. Command Register. 3. Latency timer. 4. Cache Line size. 5. Memory and/or I/O base address and limit registers. 6. Primary, secondary, subordinate bus number (for PCI-PCI bridges). 7. Expansion ROM disable. 8. Interrupt Line.
Probe PCI config space and create a list of available PCI functions. Call device exclusion function, if registered, to exclude/include device. Disable all devices before we initialize any. Allocate and assign PCI space to each device. Calculate and set interrupt line value. Initialize and enable each device.
N/A.
sysPciAutoConfig( ) - PCI autoConfig support routine
void sysPciAutoConfig (void)
This routine instantiates the PCI_SYSTEM structure needed to configure the system. This consists of assigning address ranges to each category of PCI system resource: Prefetchable and Non-Prefetchable 32-bit Memory, and 16- and 32-bit I/O. Global values for the Cache Line Size and Maximum Latency are also specified. Finally, the four supplemental routines for device inclusion/exclusion, interrupt assignment, and pre- and post-enumeration bridge initialization are specified.
N/A
sysPciFindDevice( ) - find the nth device with the given device & vendor ID
STATUS sysPciFindDevices ( SYS_PCI_IDENT * pDeviceList, /* ptr to array vend/device ID */ int index, /* desired instance of device */ int * pBusNo, /* bus number */ int * pDeviceNo, /* device number */ UINT16 * pVendID, /* vendor Id */ UINT16 * pDevID /* device Id */ )
This routine finds the nth device with the given device & vendor ID.
OK, or ERROR if the deviceId and vendorId didn't match.
pciConfigLibInit( ) - initialize the configuration access-method and addresses
STATUS pciConfigLibInit ( int mechanism, /* configuration mechanism: 0, 1, 2 */ ULONG addr0, /* config-addr-reg / CSE-reg */ ULONG addr1, /* config-data-reg / Forward-reg */ ULONG addr2 /* none / Base-address */ )
This routine initializes the configuration access-method and addresses.
Configuration mechanism one utilizes two 32-bit IO ports located at addresses 0x0cf8 and 0x0cfc. These two ports are:
- P"
- 32-bit configuration address port, at 0x0cf8
- P"
- 32-bit configuration data port, at 0x0cfc
Accessing a PCI function's configuration port is two step process.
- P"
- Write the bus number, physical device number, function number and register number to the configuration address port.
- P"
- Perform an IO read from or an write to the configuration data port.
Configuration mechanism two uses following two single-byte IO ports.
- P"
- Configuration space enable, or CSE, register, at 0x0cf8
- P"
- Forward register, at 0x0cfa
To generate a PCI configuration transaction, the following actions are performed.
* Configuration mechanism zero is for non-PC/PowerPC environments where an area of address space produces PCI configuration transactions. No support for special cycles is included.
- -
- Write the target bus number into the forward register.
- -
- Write a one byte value to the CSE register at 0x0cf8. The bit pattern written to this register has three effects: disables the generation of special cycles; enables the generation of configuration transactions; specifies the target PCI functional device.
- -
- Perform a one, two or four byte IO read or write transaction within the IO range 0xc000 through 0xcfff.
OK, or ERROR if a mechanism is not 0, 1, or 2.
pciFindDevice( ) - find the nth device with the given device & vendor ID
STATUS pciFindDevice ( int vendorId, /* vendor ID */ int deviceId, /* device ID */ int index, /* desired instance of device */ int * pBusNo, /* bus number */ int * pDeviceNo, /* device number */ int * pFuncNo /* function number */ )
This routine finds the nth device with the given device & vendor ID.
OK, or ERROR if the deviceId and vendorId didn't match.
pciFindClass( ) - find the nth occurence of a device by PCI class code.
STATUS pciFindClass ( int classCode, /* 24-bit class code */ int index, /* desired instance of device */ int * pBusNo, /* bus number */ int * pDeviceNo, /* device number */ int * pFuncNo /* function number */ )
This routine finds the nth device with the given 24-bit PCI class code (class subclass prog_if).
The classcode arg of must be carfully constructed from class and sub-class macros.
Example : To find an ethernet class device, construct the classcode arg as follows:
((PCI_CLASS_NETWORK_CTLR << 16 | PCI_SUBCLASS_NET_ETHERNET << 8))
OK, or ERROR if the class didn't match.
pciDevConfig( ) - configure a device on a PCI bus
STATUS pciDevConfig ( int pciBusNo, /* PCI bus number */ int pciDevNo, /* PCI device number */ int pciFuncNo, /* PCI function number */ UINT32 devIoBaseAdrs, /* device IO base address */ UINT32 devMemBaseAdrs, /* device memory base address */ UINT32 command /* command to issue */ )
This routine configures a device that is on a Peripheral Component Interconnect (PCI) bus by writing to the configuration header of the selected device.
It first disables the device by clearing the command register in the configuration header. It then sets the I/O and/or memory space base address registers, the latency timer value and the cache line size. Finally, it re-enables the device by loading the command register with the specified command.
This routine is designed for Type 0 PCI Configuration Headers ONLY. It is NOT usable for configuring, for example, a PCI-to-PCI bridge.
OK always.
pciConfigBdfPack( ) - pack parameters for the Configuration Address Register
int pciConfigBdfPack ( int busNo, /* bus number */ int deviceNo, /* device number */ int funcNo /* function number */ )
This routine packs three parameters into one integer for accessing the Configuration Address Register
packed integer encoded version of bus, device, and function numbers.
pciConfigExtCapFind( ) - find extended capability in ECP linked list
STATUS pciConfigExtCapFind ( UINT8 extCapFindId, /* Extended capabilities ID to search for */ int bus, /* PCI bus number */ int device, /* PCI device number */ int function, /* PCI function number */ UINT8 * pOffset /* returned config space offset */ )
This routine searches for an extended capability in the linked list of capabilities in config space. If found, the offset of the first byte of the capability of interest in config space is returned via pOffset.
OK if Extended Capability found, ERROR otherwise
pciConfigInByte( ) - read one byte from the PCI configuration space
STATUS pciConfigInByte ( int busNo, /* bus number */ int deviceNo, /* device number */ int funcNo, /* function number */ int offset, /* offset into the configuration space */ UINT8 * pData /* data read from the offset */ )
This routine reads one byte from the PCI configuration space
OK, or ERROR if this library is not initialized
pciConfigInWord( ) - read one word from the PCI configuration space
STATUS pciConfigInWord ( int busNo, /* bus number */ int deviceNo, /* device number */ int funcNo, /* function number */ int offset, /* offset into the configuration space */ UINT16 * pData /* data read from the offset */ )
This routine reads one word from the PCI configuration space
OK, or ERROR if this library is not initialized
pciConfigInLong( ) - read one longword from the PCI configuration space
STATUS pciConfigInLong ( int busNo, /* bus number */ int deviceNo, /* device number */ int funcNo, /* function number */ int offset, /* offset into the configuration space */ UINT32 * pData /* data read from the offset */ )
This routine reads one longword from the PCI configuration space
OK, or ERROR if this library is not initialized
pciConfigOutByte( ) - write one byte to the PCI configuration space
STATUS pciConfigOutByte ( int busNo, /* bus number */ int deviceNo, /* device number */ int funcNo, /* function number */ int offset, /* offset into the configuration space */ UINT8 data /* data written to the offset */ )
This routine writes one byte to the PCI configuration space.
OK, or ERROR if this library is not initialized
pciConfigOutWord( ) - write one 16-bit word to the PCI configuration space
STATUS pciConfigOutWord ( int busNo, /* bus number */ int deviceNo, /* device number */ int funcNo, /* function number */ int offset, /* offset into the configuration space */ UINT16 data /* data written to the offset */ )
This routine writes one 16-bit word to the PCI configuration space.
OK, or ERROR if this library is not initialized
pciConfigOutLong( ) - write one longword to the PCI configuration space
STATUS pciConfigOutLong ( int busNo, /* bus number */ int deviceNo, /* device number */ int funcNo, /* function number */ int offset, /* offset into the configuration space */ UINT32 data /* data written to the offset */ )
This routine writes one longword to the PCI configuration space.
OK, or ERROR if this library is not initialized
pciConfigModifyLong( ) - Perform a masked longword register update
STATUS pciConfigModifyLong ( int busNo, /* bus number */ int deviceNo, /* device number */ int funcNo, /* function number */ int offset, /* offset into the configuration space */ UINT32 bitMask, /* Mask which defines field to alter */ UINT32 data /* data written to the offset */ )
This function writes a field into a PCI configuration header without altering any bits not present in the field. It does this by first doing a PCI configuration read (into a temporary location) of the PCI configuration header word which contains the field to be altered. It then alters the bits in the temporary location to match the desired value of the field. It then writes back the temporary location with a configuration write. All configuration accesses are long and the field to alter is specified by the "1" bits in the bitMask parameter.
Be careful to using pciConfigModifyLong for updating the Command and status register. The status bits must be written back as zeroes, else they will be cleared. Proper use involves including the status bits in the mask value, but setting their value to zero in the data value.
The following example will set the PCI_CMD_IO_ENABLE bit without clearing any status bits. The macro PCI_CMD_MASK includes all the status bits as part of the mask. The fact that PCI_CMD_MASTER doesn't include these bits, causes them to be written back as zeroes, therefore they aren't cleared.
pciConfigModifyLong (b,d,f,PCI_CFG_COMMAND, (PCI_CMD_MASK | PCI_CMD_IO_ENABLE), PCI_CMD_IO_ENABLE);Use of explicit longword read and write operations for dealing with any register containing "write 1 to clear" bits is sound policy.
OK if operation succeeds, ERROR if operation fails.
pciConfigModifyWord( ) - Perform a masked longword register update
STATUS pciConfigModifyWord ( int busNo, /* bus number */ int deviceNo, /* device number */ int funcNo, /* function number */ int offset, /* offset into the configuration space */ UINT16 bitMask, /* Mask which defines field to alter */ UINT16 data /* data written to the offset */ )
This function writes a field into a PCI configuration header without altering any bits not present in the field. It does this by first doing a PCI configuration read (into a temporary location) of the PCI configuration header word which contains the field to be altered. It then alters the bits in the temporary location to match the desired value of the field. It then writes back the temporary location with a configuration write. All configuration accesses are long and the field to alter is specified by the "1" bits in the bitMask parameter.
Do not use this routine to modify any register that contains write 1 to clear type of status bits in the same longword. This specifically applies to the command register. Modify byte operations could potentially be implemented as longword operations with bit shifting and masking. This could have the effect of clearing status bits in registers that aren't being updated. Use pciConfigInLong and pciConfigOutLong, or pciModifyLong, to read and update the entire longword.
OK if operation succeeds. ERROR if operation fails.
pciConfigModifyByte( ) - Perform a masked longword register update
STATUS pciConfigModifyByte ( int busNo, /* bus number */ int deviceNo, /* device number */ int funcNo, /* function number */ int offset, /* offset into the configuration space */ UINT8 bitMask, /* Mask which defines field to alter */ UINT8 data /* data written to the offset */ )
This function writes a field into a PCI configuration header without altering any bits not present in the field. It does this by first doing a PCI configuration read (into a temporary location) of the PCI configuration header word which contains the field to be altered. It then alters the bits in the temporary location to match the desired value of the field. It then writes back the temporary location with a configuration write. All configuration accesses are long and the field to alter is specified by the "1" bits in the bitMask parameter.
Do not use this routine to modify any register that contains write 1 to clear type of status bits in the same longword. This specifically applies to the command register. Modify byte operations could potentially be implemented as longword operations with bit shifting and masking. This could have the effect of clearing status bits in registers that aren't being updated. Use pciConfigInLong and pciConfigOutLong, or pciModifyLong, to read and update the entire longword.
OK if operation succeeds, ERROR if operation fails.
pciSpecialCycle( ) - generate a special cycle with a message
STATUS pciSpecialCycle ( int busNo, /* bus number */ UINT32 message /* data driven onto AD[31:0] */ )
This routine generates a special cycle with a message.
OK, or ERROR if this library is not initialized
pciConfigForeachFunc( ) - check condition on specified bus
STATUS pciConfigForeachFunc ( UINT8 bus, /* bus to start on */ BOOL recurse, /* if TRUE, do subordinate busses */ PCI_FOREACH_FUNC funcCheckRtn, /* routine to call for each PCI func */ void * pArg /* argument to funcCheckRtn */ )
pciConfigForeachFunc( ) discovers the PCI functions present on the bus and calls a specified C-function for each one. If the function returns ERROR, further processing stops.
pciConfigForeachFunc( ) does not affect any HOST<->PCI bridge on the system.
not set
OK normally, or ERROR if funcCheckRtn( ) doesn't return OK.
pciConfigReset( ) - disable cards for warm boot
STATUS pciConfigReset ( int startType /* for reboot hook, ignored */ )
pciConfigReset( ) goes through the list of PCI functions at the top-level bus and disables them, preventing them from writing to memory while the system is trying to reboot.
Not set
OK, always
pciIntLibInit( ) - initialize the pciIntLib module
STATUS pciIntLibInit (void)
This routine initializes the linked lists used to chain together the PCI interrupt service routines.
OK, or ERROR upon link list failures.
pciInt( ) - interrupt handler for shared PCI interrupt.
VOID pciInt ( int irq /* IRQ associated to the PCI interrupt */ )
This routine executes multiple interrupt handlers for a PCI interrupt. Each interrupt handler must check the device dependent interrupt status bit to determine the source of the interrupt, since it simply execute all interrupt handlers in the link list.
This is not a user callable routine
N/A
pciIntConnect( ) - connect the interrupt handler to the PCI interrupt.
STATUS pciIntConnect ( VOIDFUNCPTR * vector, /* interrupt vector to attach to */ VOIDFUNCPTR routine, /* routine to be called */ int parameter /* parameter to be passed to routine */ )
This routine connects an interrupt handler to a shared PCI interrupt vector. A link list is created for each shared interrupt used in the system. It is created when the first interrupt handler is attached to the vector. Subseqent calls to pciIntConnect just add their routines to the linked list for that vector.
OK, or ERROR if the interrupt handler cannot be built.
pciIntDisconnect( ) - disconnect the interrupt handler (OBSOLETE)
STATUS pciIntDisconnect ( VOIDFUNCPTR * vector, /* interrupt vector to attach to */ VOIDFUNCPTR routine /* routine to be called */ )
This routine disconnects the interrupt handler from the PCI interrupt line.
In a system where one driver and one ISR services multiple devices, this routine removes all instances of the ISR because it completely ignores the parameter argument used to install the handler.
Use of this routine is discouraged and will be obsoleted in the future. New code should use the pciIntDisconnect2( ) routine instead.
OK, or ERROR if the interrupt handler cannot be removed.
pciIntDisconnect2( ) - disconnect an interrupt handler from the PCI interrupt.
STATUS pciIntDisconnect2 ( VOIDFUNCPTR * vector, /* interrupt vector to attach to */ VOIDFUNCPTR routine, /* routine to be called */ int parameter /* routine parameter */ )
This routine disconnects a single instance of an interrupt handler from the PCI interrupt line.
This routine should be used in preference to the original pciIntDisconnect( ) routine. This routine is compatible with drivers that are managing multiple device instances, using the same basic ISR, but with different parameters.
OK, or ERROR if the interrupt handler cannot be removed.
pciDeviceShow( ) - print information about PCI devices
STATUS pciDeviceShow ( int busNo /* bus number */ )
This routine prints information about PCI devices There are two ways to find out an empty device.
- -
- check Master Abort bit after the access.
- -
- check whether the read value is 0xffff.
It uses the second method, since I didn't see the Master Abort bit of the host/PCI bridge changing.
OK, or ERROR if the library is not initialized.
pciHeaderShow( ) - print a header of the specified PCI device
STATUS pciHeaderShow ( int busNo, /* bus number */ int deviceNo, /* device number */ int funcNo /* function number */ )
This routine prints a header of the PCI device specified by busNo, deviceNo, and funcNo.
OK, or ERROR if this library is not initialized.
pciFindDeviceShow( ) - find a device by deviceId, then print an information.
STATUS pciFindDeviceShow ( int vendorId, /* vendor ID */ int deviceId, /* device ID */ int index /* desired instance of device */ )
This routine finds a device by deviceId, then print an information.
OK, or ERROR if this library is not initialized.
pciFindClassShow( ) - find a device by 24-bit class code
STATUS pciFindClassShow ( int classCode, /* 24-bit class code */ int index /* desired instance of device */ )
This routine finds a device by its 24-bit PCI class code, then prints its information.
OK, or ERROR if this library is not initialized.
pciConfigStatusWordShow( ) - show the decoded value of the status word
STATUS pciConfigStatusWordShow ( int bus, /* bus */ int device, /* device */ int function, /* function */ void * pArg /* ignored */ )
This routine reads the value of the status word for the specified bus,device,function and prints the value in a human-readable format.
OK, always.
pciConfigCmdWordShow( ) - show the decoded value of the command word
STATUS pciConfigCmdWordShow ( int bus, /* bus */ int device, /* device */ int function, /* function */ void * pArg /* ignored */ )
This routine reads the value of the command word for the specified bus,device,function and prints the value in a human-readable format.
OK, always.
pciConfigFuncShow( ) - show configuration details about a function
STATUS pciConfigFuncShow ( int bus, /* bus */ int device, /* device */ int function, /* function */ void * pArg /* ignored */ )
This routine reads various information from the specified bus,device,function, and prints the information in a human-readable format.
OK, always.
pciConfigTopoShow( ) - show PCI topology
void pciConfigTopoShow ()
This routine traverses the PCI bus and prints assorted information about every device found. The information is intended to present the topology of the PCI bus. In includes: (1) the device type, (2) the command and status words, (3) for PCI to PCI bridges the memory and I/O space configuration, and (4) the values of all implemented BARs.
N/A.
sysPowerSpanPciEncode( ) - encode parameters for the Configuration Address
UINT32 sysPowerSpanPciEncode ( UINT nBus, UINT nDevice, UINT nFunc )
Register
This routine packs three parameters into one integer for accessing the Configuration Address Register
integer encoded version of bus, device, and function numbers.
sysPowerSpanPciConfigWrite( ) - writes one PCI configuration space location
STATUS sysPowerSpanPciConfigWrite ( int bus, int device, int function, int offset, /* offset into the configuration space */ int width, /* data width */ UINT data /* data to be written */ )
This routine write to one PCI configuration register location of the specified size (1, 2 or 4 bytes).
N/A
sysLib, sysPowerSpanPciConfigRead( )
sysPowerSpanPciConfigRead( ) - reads one PCI configuration register location
STATUS sysPowerSpanPciConfigRead ( int bus, int device, int function, int offset, /* offset into the configuration space */ int width, /* data width */ void * pResult )
This routine reads one PCI configuration space register location of the specified size (1, 2 or 4 bytes).
contents of specified register
sysLib, sysPowerSpanPciConfigWrite( )
sysPowerSpanInit( ) - initialize the PowerSpan PCIBus bridge controller
STATUS sysPowerSpanInit (void)
This routine purpose is to initialize the PowerSpan device. This device spans the PowerBus to PCIBus.
OK or ERROR
sysPowerSpanPostAutoConfigInit( ) - initializes the Power Span Auto Config
void sysPowerSpanPostAutoConfigInit (void)
This routine initializes the Power Span Auto Config
N/A
sysCheckIfVware( ) - check if we were lunched by vWARE
BOOL sysCheckIfVware (void)
This routine check if we were lunched by vWARE
TRUE if yes, FALSE if no
sysLib, sysVwareBuildBootLine( ), sysVware2BuildBootLine( ), sysVware1BuildBootLine( )
sysMotFccEndLoad( ) - load an istance of the motFccEnd driver
END_OBJ * sysMotFccEndLoad ( char * pParamStr, /* ptr to initialization parameter string */ void * unused /* unused optional argument */ )
This routine loads the motFccEnd driver with proper parameters. It also reads the BCSR3 to find out which type of processor is being used, and sets up the load string accordingly.
The END device load string formed by this routine is in the following format. immrVal:fccNum:bdBase:bdSize:bufBase:bufSize:fifoTxBase :fifoRxBase:tbdNum:rbdNum:phyAddr:phyDefMode:pAnOrderTbl: userFlags:mBlkRatio:clusterRatio
- immrVal
- Internal memory address
- fccNum
- FCC number being used
- bdBase
- buffer descriptors base address
- bdSize
- buffer descriptors space size
- bufBase
- data buffers base address
- bufSize
- data buffers space size
- fifoTxBase
- tx buffer in internal memory
- fifoRxBase
- rx buffer in internal memory
- tbdNum
- number of TBDs or NONE
- rbdNum
- number of RBDs or NONE
- phyAddr
- address of a MII-compliant PHY device
- phyDefMode
- default operating mode of a MII-compliant PHY device
- pAnOrderTbl
- auto-negotiation order table for a MII-compliant PHY device or NONE
- userFlags
- User flages
- mBlkRatio
- Ratio between mBlk's and Rx BD's
- clusterRatio
- Ratio between Clusters and Rx BD's
This routine only loads and initializes one instance of the device. If the user wishes to use more than one motFccEnd devices, this routine should be changed.
pointer to END object or NULL.
sysLib, motFccEndLoad ()
sysFccEnetEnable( ) - enable the MII interface to the FCC controller
STATUS sysFccEnetEnable ( UINT32 immrVal, /* base address of the on-chip RAM */ UINT8 fccNum /* FCC being used */ )
This routine is expected to perform any target specific functions required to enable the Ethernet device and to connect the MII interface to the FCC.
OK, or ERROR if the FCC controller cannot be enabled.
sysFccEnetDisable( ) - disable MII interface to the FCC controller
STATUS sysFccEnetDisable ( UINT32 immrVal, /* base address of the on-chip RAM */ UINT8 fccNum /* FCC being used */ )
This routine is expected to perform any target specific functions required to disable the Ethernet device and the MII interface to the FCC controller. This involves restoring the default values for all the Port B and C signals.
OK, always.
sysFccEnetAddrGet( ) - get the hardware Ethernet address
STATUS sysFccEnetAddrGet ( int unit , /* not used - only slave SCC1 is wired to port */ UINT8 * addr /* Location address is returned in */ )
This routine provides the six byte Ethernet hardware address that will be used by each individual FCC device unit. This routine must copy the six byte address to the space provided by addr.
OK, or ERROR if the Ethernet address cannot be returned.
sysFccEnetCommand( ) - issue a command to the Ethernet interface controller
STATUS sysFccEnetCommand ( UINT32 immrVal, /* base address of the on-chip RAM */ UINT8 fccNum, /* FCC being used */ UINT16 command )
OK, or ERROR if the Ethernet controller could not be restarted.
sysFccMiiBitWr( ) - write one bit to the MII interface
STATUS sysFccMiiBitWr ( UINT32 immrVal, /* base address of the on-chip RAM */ UINT8 fccNum, /* FCC being used */ INT32 bitVal /* the bit being written */ )
This routine writes the value in bitVal to the MDIO line of a MII interface. The MDC line is asserted for a while, and then negated. If bitVal is NONE, then the MDIO pin should be left in high-impedance state.
sysLib, sysFccMiiBitRd( )
OK, or ERROR.
sysFccMiiBitRd( ) - read one bit from the MII interface
STATUS sysFccMiiBitRd ( UINT32 immrVal, /* base address of the on-chip RAM */ UINT8 fccNum, /* FCC being used */ INT8 * bitVal /* the bit being read */ )
This routine reads one bit from the MDIO line of a MII interface. The MDC line is asserted for a while, and then negated.
sysLib, sysFccMiiBitWr( )
OK, or ERROR.
sysDelay( ) - delay for a moment
void sysDelay (void)
This routine delay for a moment.
N/A
sysFei82557EndLoad( ) - load fei82557 (fei) device.
END_OBJ * sysFei82557EndLoad ( char * pParamStr, /* ptr to initialization parameter string */ void * unused /* unused optional argument */ )
This routine loads the fei device with initial parameters.
pointer to END object or ERROR.
sys557PciInit( ) - prepare LAN adapter for 82557 initialization
void sys557PciInit (void)
This routine find out the PCI device, and map its memory and IO address. It must be done prior to initializing the 82557, sys557Init( ). Also must be done prior to MMU initialization, usrMmuInit( ).
N/A
sys557Init( ) - prepare LAN adapter for 82557 initialization
STATUS sys557Init ( int unit, /* unit number */ FEI_BOARD_INFO * pBoard /* board information for the end driver */ )
This routine is expected to perform any adapter-specific or target-specific initialization that must be done prior to initializing the 82557.
The 82557 driver calls this routine from the driver attach routine before any other routines in this library.
This routine returns the interrupt level the pIntLvl parameter.
OK or ERROR if the adapter could not be prepared for initialization.
sysNetHwInit( ) - initialize the network interface
void sysNetHwInit (void)
This routine initializes the network hardware to a quiescent state. It does not connect interrupts.
Only polled mode operation is possible after calling this routine. Interrupt mode operation is possible after the memory system has been initialized and sysNetHwInit2( ) has been called.
N/A
sysNetHwInit2( ) - initialize additional features of the network interface
void sysNetHwInit2 (void)
This routine completes initialization needed for interrupt mode operation of the network device drivers. Interrupt handlers can be connected. Interrupt or DMA operations can begin.
N/A
sysLib, sysHwInit2( )
sysModel( ) - return the model name of the CPU board
char * sysModel (void)
This routine returns the model name of the CPU board.
A pointer to the string.
sysBspRev( ) - return the BSP version and revision number
char * sysBspRev (void)
This routine returns a pointer to a BSP version and revision number, for example, 1.2/0. BSP_REV is concatenated to BSP_VERSION and returned.
A pointer to the BSP version/revision string.
sysHwInit( ) - initialize the system hardware
void sysHwInit (void)
This routine initializes various feature of the EST MPC8260 board. It sets up the control registers, initializes various devices if they are present.
This routine should not be called directly by the user.
N/A
sysPhysMemTop( ) - get the address of the top of physical memory
char * sysPhysMemTop (void)
This routine returns the address of the first missing byte of memory, which indicates the top of memory.
Normally, the user specifies the amount of physical memory with the macro LOCAL_MEM_SIZE in config.h. BSPs that support run-time memory sizing do so only if the macro LOCAL_MEM_AUTOSIZE is defined. If not defined, then LOCAL_MEM_SIZE is assumed to be, and must be, the true size of physical memory.
Do no adjust LOCAL_MEM_SIZE to reserve memory for application use. See sysMemTop( ) for more information on reserving memory.
The address of the top of physical memory.
sysMemTop( ) - get the address of the top of VxWorks memory
char * sysMemTop (void)
This routine returns a pointer to the first byte of memory not controlled or used by VxWorks.
The user can reserve memory space by defining the macro USER_RESERVED_MEM in config.h. This routine returns the address of the reserved memory area. The value of USER_RESERVED_MEM is in bytes.
The address of the top of VxWorks memory.
sysToMonitor( ) - transfer control to the ROM monitor
STATUS sysToMonitor ( int startType /* parameter passed to ROM to tell it how */ /* to boot */ )
This routine transfers control to the ROM monitor. Normally, it is called only by reboot( )--which services ^X--and by bus errors at interrupt level. However, in some circumstances, the user may wish to introduce a startType to enable special boot ROM facilities.
Does not return.
sysHwInit2( ) - initialize additional system hardware
void sysHwInit2 (void)
This routine connects system interrupt vectors and configures any required features not configured by sysHwInit( ).
N/A
sysProcNumGet( ) - get the processor number
int sysProcNumGet (void)
This routine returns the processor number for the CPU board, which is set with sysProcNumSet( ).
The processor number for the CPU board.
sysLib, sysProcNumSet( )
sysProcNumSet( ) - set the processor number
void sysProcNumSet ( int procNum /* processor number */ )
This routine sets the processor number for the CPU board. Processor numbers should be unique on a single backplane. It also maps local resources onto the VMEbus.
N/A
sysLib, sysProcNumGet( )
vxImmrSet( ) - Set the IMMR to a specific value
void vxImmrSet ( UINT32 value )
This routine sets the IMMR to a specific value
N/A
vxImmrGet( ) - return the current IMMR value
UINT32 vxImmrGet (void)
This routine returns the current IMMR value
current IMMR value
sysBaudClkFreq( ) - returns the frequency of the BRG clock
int sysBaudClkFreq (void)
This routine returns the frequency of the BRG clock
From page 9-5 in Rev0 of 8260 book
Frequence in HZ
sysClkRateAdjust( ) - calculates proper decrementer frequency for a cpu frequency
void sysClkRateAdjust ( int * sysDecClkFrequency )
This routine calculates proper decrementer frequency for a cpu frequency
Speed in Hz
sysInputFreqGet( ) - determines the Input Oscillator clock frequency
UINT32 sysInputFreqGet (void)
This routine determines the Input Oscillator clock frequency
From page 9-2 in Rev0 of 8260 book
Input frequency in HZ
sysCpmFreqGet( ) - determines the CPM operating frequency
UINT32 sysCpmFreqGet (void)
This routine determines the CPM operating frequency
From page 9-2 in Rev0 of 8260 book
CPM frequency in HZ
sysCoreFreqGet( ) - determines the Core operating frequency
UINT32 sysCoreFreqGet (void)
This routine determines the Core operating frequency
From page 9-2 in Rev0 of 8260 book
Core frequency in HZ
sysModckHGet( ) - determines the value of MODCK_H reset configuration value
UINT8 sysModckHGet (void)
This routine determines the value of MODCK_H reset configuration value
From page 9-2 in Rev0 of 8260 book
MODCK_H value
sysModck13Get( ) - determines the value of MODCK[1-3] reset configuration value
UINT8 sysModck13Get (void)
This routine determines the value of MODCK[1-3] reset configuration value
From Clock Configuration Modes 8260 Manual
User Dip Switch 6,7, and 8 must match Config Switch 6,7, 8
MODCK[1-3] value
sysChipRev( ) - determines revision of Chip installed
UINT32 sysChipRev (void)
This routine determines revision of Chip installed
Chip revision
sysCpmReset( ) - issues a CPM reset command
void sysCpmReset (void)
This routine issues a CPM reset command
N/A
sysUserSwitchGet( ) - returns the value of the User Dip Switch
UINT8 sysUserSwitchGet (void)
This routine returns the value of the User Dip Switch
Reverse bits so S1 is MSB S8 is LSB
Unsigned 8 bit value