VxWorks BSP Reference : mv2400
sysLib [mv2400] - Motorola MVME2400 board series system-dependent library
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
sysNetHwInit( ) - initialize the network interface
sysNetHwInit2( ) - initialize additional features of the network interface
sysLanIntEnable( ) - enable the LAN interrupt
sysLanIntDisable( ) - disable the LAN interrupt
sysDec21x40EndLoad( ) - create load string and load a dec21x40 (dc) device.
sysDec21x40PciInit( ) - prepare LAN adapter for DEC21X4X initialization
sysDec21x40Init( ) - prepare LAN adapter for dec21X4X initialization
sysDec21x40EnetAddrGet( ) - get Ethernet address
sysDec21143MediaSelect( ) - hook routine for dec21x40Start
sysDec21x40DynEnetFind( ) - Find ethernet network device dynamically
sysSerialHwInit( ) - initialize the BSP serial devices to a quiescent state
sysSerialHwInit2( ) - connect BSP serial device interrupts
sysSerialChanGet( ) - get the SIO_CHAN device associated with a serial channel
sysSerialReset( ) - reset all serial devices to a quiescent state
sysNvRamGet( ) - get the contents of non-volatile RAM
sysNvRamSet( ) - write to non-volatile RAM
sysReportVpdError( ) - routine to report errors in vpd data.
sysGetBusSpd( ) - routine to get the speed of the 60x processor bus
sysGetPciSpd( ) - routine to get the speed of the PCI bus
sysGetMpuSpd( ) - routine to get the speed of the 60x processor bus
sysVpdInit( ) - initialize the board vital product data structures.
sysProdConfigGet( ) - initialize the board vital product data structures.
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
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
vpdPktPrintType( ) - print the vpd packet type in ascii
vpdPktPrintAscii( ) - print the data area of an ascii vpd packet.
vpdPktPrintDecimal( ) - print the data area of an decimal vpd packet.
vpdPktPrintHex( ) - print the data area of an binary vpd packet in hex.
vpdPktPrint( ) - display the contents of a vpd packet
vpdPrint( ) - display the contents of a vpd structure
vpdShow( ) - display the board's vpd data
smcPrintTiming( ) - read and print the smc sdram timing information.
smcPrintBankInfo( ) - read and print the smc sdram bank information.
smcReadConfig( ) - read the contents of the hawk smc sdram controller registers.
smcShow( ) - display the SMC configuration data
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
sysL2CacheInit( ) - initialize the L2 cache
sysL2CacheDisable( ) - disable the L2 cache(s)
sysL2CacheEnable( ) - enable the L2 cache(s)
sysUniverseReset( ) - reset the Universe VME chip
sysUniverseInit( ) - initialize registers of the Universe chip
sysIntDisable( ) - disable a bus interrupt level
sysIntEnable( ) - enable a bus interrupt level
sysBusIntAck( ) - acknowledge a bus interrupt
sysBusIntGen( ) - generate a bus interrupt
sysUnivIntEnable( ) - enable Universe-supported interrupt(s)
sysUnivIntDisable( ) - disable Universe-supported interrupt(s)
sysUnivIntLevelSet( ) - set a Universe-supported interrupt level
sysUnivIntConnect( ) - connect an interrupt handler for an interrupt type
sysMailboxConnect( ) - connect a routine to the mailbox interrupt
sysMailboxEnable( ) - enable the mailbox interrupt
sysMailboxDisable( ) - disable the mailbox interrupt
sysUnivVERRClr( ) - Universe VMEbus Error Clear routine
sysUnivLevelDecode( ) - decode highest pending priority Universe interrupt
sysUnivVmeIntr( ) - Hawk VMEbus interrupt handler
sysBusRmwEnable( ) - enable Read-Modify-Write (RMW) cycle on VMEbus
sysBusRmwDisable( ) - Disable Read-Modify-Write (RMW) cycle on the VMEbus.
hawkPhbInit( ) - initialize the Hawk PHB registers
hawkPhbInit2( ) - initialize the Hawk PHB registers which require VPD
hawkInitPhbExt( ) - initialize the extended portion of the Hawk PHB PCI header
hawkErrClr( ) - Clear error conditions in Hawk
sysMpicInit( ) - initialize the MPIC in the Hawk
sysMpicIntHandler( ) - handle an interrupt received at the Mpic
sysIbcInit( ) - Initialize the IBC
sysIbcIntEnable( ) - enable a IBC interrupt level
sysIbcIntDisable( ) - disable a IBC interrupt level
sysIbcIntHandler( ) - handler of the sl82565 IBC interrupt.
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
sysLocalToBusAdrs( ) - convert a local address to a bus address
sysBusToLocalAdrs( ) - convert a bus address to a local address
sysBusTas( ) - test and set a specified location
sysBusTasClear( ) - clear a location set by sysBusTas( )
sysNvRead( ) - read one byte from NVRAM
sysNvWrite( ) - write one byte to NVRAM
sysCpuCheck( ) - confirm the CPU type
sysProbeErrClr( ) - clear errors associated with probing an address on a bus.
sysVmeProbe( ) - probe a VME bus address
sysPciProbe( ) - probe a PCI bus address
sysBusProbe( ) - probe a bus address based on bus type.
sysUsDelay( ) - delay at least the specified amount of time (in microseconds)
sysDebugMsg( ) - print a debug string to the console in polled mode.
sysConfigBpe( ) - configure processor bus parity checking
reportBootromErrors( ) - report errors detected during rom start.
This library provides board-specific routines. The chip drivers included are:
i8250Sio.c - Intel 8250 UART driver
ppcDecTimer.c - PowerPC decrementer timer library (system clock)
byteNvRam.c - byte-oriented generic non-volatile RAM library
pciConfigLib.c - PCI configuration library
universe.c - Tundra Universe chip VME-to-PCI interface library
HawkAuxClk.c - Hawk timer library (auxiliary clock)sl82565IntrCtl.c - interrupt controller driver
or
hawkMpic.c - Hawk Mpic / W83C553 PIB/IBC Interrupt Controller
sysLib.h
VxWorks Programmer's Guide: Configuration
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
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.
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.
sysLanIntEnable( ) - enable the LAN interrupt
STATUS sysLanIntEnable ( int intLevel /* interrupt level to enable */ )
This routine enables interrupts at a specified level
OK, or ERROR if network support not included.
sysLanIntDisable( ) - disable the LAN interrupt
STATUS sysLanIntDisable ( int intLevel /* interrupt level to enable */ )
This routine disables interrupts for the on-board LAN chip.
return of intDisable, or ERROR if network support not included.
sysDec21x40EndLoad( ) - create load string and load a dec21x40 (dc) device.
END_OBJ * sysDec21x40EndLoad ( char * pParamStr, /* ptr to initialization parameter string */ void * unused /* unused optional argument */ )
This routine loads the dc device with initial parameters probed during dec21x40PciInit( ).
pointer to END object or NULL.
sysDec21x40PciInit( ) - prepare LAN adapter for DEC21X4X initialization
STATUS sysDec21x40PciInit (void)
This routine finds the PCI device, and maps its memory and IO address. It must be done prior to initializing the DEC21X4X, sysDec21x40Init( ).
N/A
sysDec21x40Init( ) - prepare LAN adapter for dec21X4X initialization
STATUS sysDec21x40Init ( DEC21X40_DRV_CTRL * pDrvCtrl )
This routine is expected to perform any adapter-specific or target-specific initialization that must be done prior to initializing the dec21X4X.
The dec21X4X driver calls this routine from the driver endLoad routine before any other routines in this library.
This routine determines the base address, the main memory address over the PCI bus, the interrupt level and the interrupt vector parameter.
OK or ERROR if the adapter could not be prepared for initialization.
sysDec21x40EnetAddrGet( ) - get Ethernet address
STATUS sysDec21x40EnetAddrGet ( int unit, char * enetAdrs )
This routine provides a target-specific interface for accessing a device Ethernet address.
OK or ERROR if could not be obtained.
sysDec21143MediaSelect( ) - hook routine for dec21x40Start
STATUS sysDec21143MediaSelect ( DEC21X40_DRV_CTRL * pDrvCtrl, /* Driver control */ UINT * pCsr6Val /* CSR6 return value */ )
This is hook routine for dec21x40Start( ). This routine selects a media for dec21143 board.
OK, always.
sysDec21x40DynEnetFind( ) - Find ethernet network device dynamically
STATUS sysDec21x40DynEnetFind ( int unit, /* input: unit number */ INT32 instance, /* input: instance number */ INT32 bus, /* input: bus number on which to look */ INT32 * pDev, /* output: device number found */ INT32 * pFunc /* output: function number found */ )
This function dynamically finds the ethernet network device. The encoded location is returned the pciLoc output parameter if the device is found. The constraints of the search require that the device found be on the PCI bus number which matches the bus input parameter. In addition, if the unit input parameter is zero, the device/vendor ID must match the PCI_ID_PRI_LAN define, and if the unit parameter is nonzero, the device/vendor * ID must match the PCI_ID_SEC_LAN define.
OK if ethernet device is found, ERROR otherwise
sysSerialHwInit( ) - initialize the BSP serial devices to a quiescent state
void sysSerialHwInit (void)
This routine initializes the BSP serial device descriptors and puts the devices in a quiescent state. It is called from sysHwInit( ) with interrupts locked. Polled mode serial operations are possible, but not interrupt mode operations which are enabled by sysSerialHwInit2( ).
N/A
sysLib, sysHwInit( ), sysSerialHwInit2( )
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 cannot be connected in sysSerialHwInit( ) because the kernel memory allocator is 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 */ )
This routine returns a pointer to the SIO_CHAN device associated with a specified serial channel. It is called by usrRoot( ) to obtain pointers when creating the system serial devices, /tyCo/x. It is also used by the WDB agent to locate its serial channel.
A pointer to the SIO_CHAN structure for the channel, or ERROR if the channel is invalid.
sysSerialReset( ) - reset all serial devices to a quiescent state
void sysSerialReset (void)
This routine resets all serial devices to a quiescent state. It is called by sysToMonitor( ).
N/A
sysLib, sysToMonitor( )
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( )
sysReportVpdError( ) - routine to report errors in vpd data.
void sysReportVpdError ( char * str )
This routine prints an error message at the system console and optionally returns to the boot rom.
N/A
sysGetBusSpd( ) - routine to get the speed of the 60x processor bus
UINT sysGetBusSpd (void)
This routine returns the speed (in Hz) of the 60x system bus.
The bus speed (inHz).
sysGetPciSpd( ) - routine to get the speed of the PCI bus
UINT sysGetPciSpd (void)
This routine returns the speed (in Hz) of the PCI bus.
The bus speed (inHz).
sysGetMpuSpd( ) - routine to get the speed of the 60x processor bus
UINT sysGetMpuSpd (void)
This routine returns the speed (in Hz) of the 60x system bus.
The bus speed (inHz).
sysVpdInit( ) - initialize the board vital product data structures.
STATUS sysVpdInit (void)
This routine reads the VPD and extracts the commonly used data.
OK, if successful or ERROR if unsuccessful.
sysLib, N/A( )
sysProdConfigGet( ) - initialize the board vital product data structures.
BOOL sysProdConfigGet ( UINT32 optionId )
This routine tests the presence of a caller specified product configuration option using the contents of the product configuration option vpd packet.
TRUE if the option is present or FALSE if the product configuration option is not present or if the product configuration option packet is missing.
sysLib, N/A
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( )
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.
* It uses the second method, since I didn't see the Master Abort bit of the host/PCI bridge changing.
- -
- check Master Abort bit after the access.
- -
- check whether the read value is 0xffff.
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.
vpdPktPrintType( ) - print the vpd packet type in ascii
void vpdPktPrintType ( UCHAR type )
This routine prints the vpd packet type in ascii.
N/A
vpdPktPrintAscii( ) - print the data area of an ascii vpd packet.
void vpdPktPrintAscii ( VPD_PACKET * pVpdPkt )
This routine prints the data area of an ascii packet. the number of bytes printed is taken from the packet header.
N/A
sysLib, vpdPktPrintDecimal( ), vpdPktPrintHex( )
vpdPktPrintDecimal( ) - print the data area of an decimal vpd packet.
void vpdPktPrintDecimal ( VPD_PACKET * pVpdPkt )
This routine prints the data area of an decimal packet. the data width (byte, half-word, or word) is taken from the packet header.
N/A
sysLib, vpdPktPrintAscii( ), vpdPktPrintHex( )
vpdPktPrintHex( ) - print the data area of an binary vpd packet in hex.
void vpdPktPrintHex ( VPD_PACKET * pVpdPkt, BOOL contiguous )
This routine prints the data area of an binary packet. the number of bytes printed is taken from the packet header. An input parameter is passed which controls the formatting of the displayed hex data. If the flag is set, the data bytes are printed contiguously, (0x01020304...). If the flag is cleared, the data bytes are printed individually (0x01 0x02 0x03 0x04...). The output is formatted to limit the number of columns used to display the data. The maximum number of bytes per line varies depending on the formatting flag pvreiously mentioned.
N/A
sysLib, vpdPktPrintAscii( ), vpdPktPrintDecimal( )
vpdPktPrint( ) - display the contents of a vpd packet
void vpdPktPrint ( VPD_PACKET * pVpdPkt )
This routine prints the contents of a vpd packet.
N/A
vpdPrint( ) - display the contents of a vpd structure
STATUS vpdPrint ( VPD_PACKET * * pVpdPkts )
This routine loops through the vpd packet pointer array and prints the contents of each packet.
OK, if successful or ERROR if unsuccessful.
sysLib, vpdPktPrint( )
vpdShow( ) - display the board's vpd data
STATUS vpdShow (void)
If required, this routine reads the board-level vital product data from a serial eeprom and, if valid, displays the vpd contents.
OK, if successful or ERROR if unsuccessful.
sysLib, N/A
smcPrintTiming( ) - read and print the smc sdram timing information.
void smcPrintTiming ( hawkSmc * pSmcReg )
This routine prints the hawk sdram memory controller timing values in bus clocks.
N/A
smcPrintBankInfo( ) - read and print the smc sdram bank information.
void smcPrintBankInfo ( hawkSmc * pSmcReg )
This routine prints the size and starting address of each enabled hawk sdram bank.
N/A
smcReadConfig( ) - read the contents of the hawk smc sdram controller registers.
void smcReadConfig ( hawkSmc * pSmcReg )
This routine reads the contents of the smc sdram controller registers and stores the values into a caller provided storage area.
N/A
smcShow( ) - display the SMC configuration data
void smcShow (void)
This routine reads and displays the Hawk SMC SDRAM timing and bank configuration information.
OK, if successful or ERROR if unsuccessful.
sysLib, N/A
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. The "MASK_PCI_xxx_BITS is dependant on the memory map, (i.e. if EXTENDED_VME is defined). 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.
Non-Extended VME 0x80000000 ----------------- ISA_MSTR_IO_LOCAL
| ISA LEGACY | 0x80004000 ----------------- ISA_MSTR_IO_LOCAL + ISA_LEGACY_SIZE
| PCI 16-bit I/O | 0x80010000 ----------------- PCI_MSTR_IO_LOCAL = ISA Master + ISA Size
| PCI 32-bit I/O | 0x80810000 ----------------- PCI_MSTR_IO_LOCAL + PCI_MSTR_IO_SIZE
: :0xC0000000 ----------------- PCI_MSTR_MEMIO_LOCAL
| NPREF PCI MEM | 0xC0800000 ----------------- PCI_MSTR_MEM_LOCAL = PCI MemIO + PCI MemIO Sz
| PCI 32-bit MEM | 0xC1800000 ----------------- PCI_MSTR_MEM_LOCAL + PCI_MSTR_MEM_SIZE
Extended VME 0xFD000000 ----------------- PCI_MSTR_MEMIO_LOCAL
| NPREF PCI MEM | 0xFD800000 ----------------- PCI_MSTR_MEM_LOCAL = PCI MemIO + PCI MemIO Sz
| PCI 32-bit MEM | 0xFE000000 ----------------- ISA_MSTR_IO_LOCAL
| ISA LEGACY | 0xFE004000 ----------------- ISA_MSTR_IO_LOCAL + ISA_LEGACY_SIZE
| PCI 16-bit I/O | 0xFE010000 ----------------- ISA_MSTR_IO_LOCAL + ISA_MSTR_IO_SIZE
| PCI 32-bit I/O | 0xFE810000 ----------------- PCI_MSTR_IO_LOCAL + PCI_MSTR_IO_SIZE
N/A
sysL2CacheInit( ) - initialize the L2 cache
STATUS sysL2CacheInit (void)
This routine initializes and enables L2 cache(s) support.
OK, or ERROR if cache is not present or not supported.
sysLib, sysL2CacheInit( ), sysL2CacheEnable( ), sysL2CacheDisable( )
sysL2CacheDisable( ) - disable the L2 cache(s)
void sysL2CacheDisable (void)
This routine disables the L2 cache(s) if either or both were previously initialized using sysL2CacheInit( ). Calling this routine invalidates the L2 tag bits.
N/A
sysLib, sysL2CacheInit( ), sysL2CacheEnable( ), sysL2CacheDisable( )
sysL2CacheEnable( ) - enable the L2 cache(s)
void sysL2CacheEnable (void)
This routine enables the L2 cache(s). It checks for the presence of either L2 cache and ensures that the cache(s) is(are) disabled.
N/A
sysLib, sysL2CacheInit( ), sysL2CacheEnable( ), sysL2CacheDisable( )
sysUniverseReset( ) - reset the Universe VME chip
void sysUniverseReset (void)
This routine performs the reseting of the Universe chip. All functions and VME mapping are disabled.
N/A
sysUniverseInit( ) - initialize registers of the Universe chip
STATUS sysUniverseInit (void)
This routine initializes registers of the Universe VME-to-PCI bridge and maps access to the VMEbus memory space.
The sysProcNumSet( ) routine maps the master node's local memory on the VMEbus.
OK, always.
sysIntDisable( ) - disable a bus interrupt level
STATUS sysIntDisable ( int intLevel /* interrupt level to disable (1-7) */ )
This routine disables reception of a specified VMEbus interrupt level.
revision 1.0 Universe chips can fail and lockup if two or more interrupt levels are enabled. For more details see Tundra Universe Errata sheet.
OK, or ERROR if intLevel is not in the range 1 - 7.
sysLib, sysIntEnable( )
sysIntEnable( ) - enable a bus interrupt level
STATUS sysIntEnable ( int intLevel /* interrupt level to enable (1-7) */ )
This routine enables reception of a specified VMEbus interrupt level.
revision 1.0 Universe chips can fail and lockup if two or more interrupt levels are enabled. For more details see Tundra Universe Errata sheet.
OK, or ERROR if intLevel is not in the range 1 - 7.
sysLib, sysIntDisable( )
sysBusIntAck( ) - acknowledge a bus interrupt
int sysBusIntAck ( int intLevel /* interrupt level to acknowledge */ )
This routine acknowledges a specified VMEbus interrupt level.
This routine is included for BSP compliance only. Since VMEbus interrupts are re-enabled in the interrupt handler, and acknowledged automatically by hardware, this routine is a no-op.
NULL.
sysLib, sysBusIntGen( )
sysBusIntGen( ) - generate a bus interrupt
STATUS sysBusIntGen ( int level, /* interrupt level to generate */ int vector /* interrupt vector for interrupt */ )
This routine generates a VMEbus interrupt for a specified level with a specified vector. Only one VME interrupt can be generated at a time and none can be generated if a previously generated VME interrupt has not been acknowledged, i.e., if no VME bus IACK cycle has completed.
OK, or ERROR if level or vector are out of range or if an interrupt is already in progress.
sysLib, sysBusIntAck( )
sysUnivIntEnable( ) - enable Universe-supported interrupt(s)
STATUS sysUnivIntEnable ( int univIntType /* interrupt type */ )
This routine enables the specified type(s) of interrupt supported by the Universe VME-to-PCI bridge.
OK, or ERROR if invalid interrupt type(s).
sysUnivIntDisable( ) - disable Universe-supported interrupt(s)
STATUS sysUnivIntDisable ( int univIntType /* interrupt type */ )
This routine disables the specified type(s) of interrupt supported by the Universe VME-to-PCI bridge.
OK, or ERROR if invalid interrupt type(s).
sysUnivIntLevelSet( ) - set a Universe-supported interrupt level
int sysUnivIntLevelSet ( int univIntLvl /* Universe interrupt level */ )
This routine disables all interrupts supported by the Universe at and below the specified level. The lowest level is 0, the highest is 15. The priority mapping is:
0 no interrupts masked 1 UNIVERSE_VOWN_INT 2 VMEBUS_LVL1 3 VMEBUS_LVL2 4 VMEBUS_LVL3 5 VMEBUS_LVL4 6 VMEBUS_LVL5 7 VMEBUS_LVL6 8 VMEBUS_LVL7 9 UNIVERSE_DMA_INT 10 UNIVERSE_LERR_INT 11 UNIVERSE_VERR_INT 12 UNIVERSE_VME_SW_IACK_INT 13 UNIVERSE_PCI_SW_INT 14 UNIVERSE_SYSFAIL_INT 15 UNIVERSE_ACFAIL_INTIf the level specified is -1, the level is not changed, just the current level is returned.
previous interrupt level.
sysLib, sysUnivIntDisable( ), sysUnivIntEnable( )
sysUnivIntConnect( ) - connect an interrupt handler for an interrupt type
STATUS sysUnivIntConnect ( int univIntType, /* the interrupt type to connect with */ VOIDFUNCPTR routine, /* routine to be called */ int parameter /* parameter to be passed to routine */ )
This routine connects an interrupt handler for a specified interrupt type to the system vector table of the Universe VME-to-PCI bridge.
OK, or ERROR if any argument is invalid or memory cannot be allocated.
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.
The mailbox interrupt is SIG1.
OK, or ERROR if the routine cannot be connected to the interrupt.
sysLib, intConnect( ), sysMailboxEnable( )
sysMailboxEnable( ) - enable the mailbox interrupt
STATUS sysMailboxEnable ( char * mailboxAdrs /* address of mailbox (ignored) */ )
This routine enables the mailbox interrupt.
The mailbox interrupt is SIG1.
OK, always.
sysLib, sysMailboxConnect( ), sysMailboxDisable( )
sysMailboxDisable( ) - disable the mailbox interrupt
STATUS sysMailboxDisable ( char * mailboxAdrs /* address of mailbox (ignored) */ )
This routine disables the mailbox interrupt.
The mailbox interrupt is SIG1.
OK, always.
sysLib, sysMailboxConnect( ), sysMailboxEnable( )
sysUnivVERRClr( ) - Universe VMEbus Error Clear routine
void sysUnivVERRClr (void)
This is the VMEbus Error clear routine for the Tundra Universe PCI to VME Bridge. It counts the ocuurances at the specified counter and clears the error condition in the three registers associated with VME Bus Errors: LINT_STAT, VINT_STAT, and V_AMERR.
N/A
sysUnivLevelDecode( ) - decode highest pending priority Universe interrupt
int sysUnivLevelDecode ( int bitField, /* one interrupt per bit, up to 15 bits */ int * vecNum, /* where to return associated vector */ int * intLvl /* where to return associated Universe int */ /* level */ )
This routine decodes the highest pending priority Universe interrupt from a bit field of interrupts and returns the associated interrupt vector, priority level and priority level bit mask.
highest pending interrupt priority level bit mask
sysLib, register and bit field defs in universe.h
sysUnivVmeIntr( ) - Hawk VMEbus interrupt handler
void sysUnivVmeIntr (void)
This is the VMEbus interrupt handler for the Motorola Hawk PCI Host Bridge (PHB) and Multi-Processor Interrupt Controller (MPIC). It is connected to the single VMEbus interrupt from the Hawk and examines the Universe to chip to determine the interrupt level and vector of the interrupt source. Having obtained the vector number, this routine then vectors into the system vector table to the specified interrupt handling routine.
N/A
sysBusRmwEnable( ) - enable Read-Modify-Write (RMW) cycle on VMEbus
void sysBusRmwEnable ( UINT swapCompareEnable, /* Enabled bits involved in compare and swap */ UINT compareData, /* Data to compare with read portion of RMW */ UINT swapData, /* Data to write during write portion of RMW */ char * rmwAddress /* RMW address */ )
These parameters are written to the SCG as Big-Endian values. This is probably a bug because all other registers in the Universe are Little-Endian.
N/A
sysBusRmwDisable( ) - Disable Read-Modify-Write (RMW) cycle on the VMEbus.
void sysBusRmwDisable ()
Disable Read-Modify-Write (RMW) cycle on the VMEbus.
N/A
hawkPhbInit( ) - initialize the Hawk PHB registers
void hawkPhbInit (void)
This function performs the first phase of the Hawk PPC-bus registers and sets up the CPU->PCI windows.
N/A
hawkPhbInit2( ) - initialize the Hawk PHB registers which require VPD
void hawkPhbInit2 (void)
This function performs the second phase of the Hawk PPC-bus registers. These registers require information contained in the VPD.
N/A
hawkInitPhbExt( ) - initialize the extended portion of the Hawk PHB PCI header
STATUS hawkInitPhbExt ( int busNo, /* bus number */ int deviceNo, /* device number */ int funcNo /* function number */ )
This routine initializes the extended portion of the PCI header for the Motorola Hawk PCI-Host Bridge Controller (PHB).
OK, always
hawkErrClr( ) - Clear error conditions in Hawk
void hawkErrClr (void)
This routine clears any existing errors in the Motorola Hawk PCI Host Bridge Controller.
N/A
sysMpicInit( ) - initialize the MPIC in the Hawk
STATUS sysMpicInit (void)
This function initializes the Multi-Processor Interrupt Controller (MPIC) contained in the Hawk chip.
It first initializes the system vector table, connects the MPIC interrupt handler to the PPC external interrupt and attaches the local MPIC routines for interrupt connecting, enabling and disabling to the corresponding system routine pointers.
It then initializes the MPIC registers, clears any pending MPIC interrupts, enables interrupt handling by the MPIC and enables external ISA interrupts (from the W83C553).
OK always
sysMpicIntHandler( ) - handle an interrupt received at the Mpic
void sysMpicIntHandler (void)
This routine will process interrupts received from PCI or ISA devices as these interrupts arrive via the MPIC. This routine supports MPIC interrupt nesting.
N/A
sysIbcInit( ) - Initialize the IBC
STATUS sysIbcInit (void)
This routine initializes the non-PCI Header configuration registers of the IBC within the W83C553 PIB.
OK always
sysIbcIntEnable( ) - enable a IBC interrupt level
void sysIbcIntEnable ( int intNum /* interrupt level to enable */ )
This routine enables a specified IBC interrupt level.
N/A
sysIbcIntDisable( ) - disable a IBC interrupt level
void sysIbcIntDisable ( int intNum /* interrupt level to disable */ )
This routine disables a specified IBC interrupt level.
N/A
sysIbcIntHandler( ) - handler of the sl82565 IBC interrupt.
void sysIbcIntHandler (void)
This routine handles interrupts originating from the W83C553 PIB ISA Bus Controller (IBC). This device implements the functional equivalent of two cascaded 8259 PICs.
This routine is entered with CPU external interrupts enabled.
Because the ISA bus is only accessible via the PCI bus, this driver first initiates a PCI interrupt acknowledge cycle to read the interrupt number (vector) coming from the IBC.
This routine then processes the interrupt by calling all interrupt service routines chained to the vector.
Finally, this routine re-arms the interrupt at the IBC by performing a IBC EOI.
N/A
sysModel( ) - return the model name of the CPU board
char * sysModel (void)
This routine returns the model name of the CPU board. The returned string depends on the board model and CPU version being used.
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.1/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 features of the CPU board. It is called by usrInit( ) in usrConfig.c. This routine sets up the control registers and initializes various devices if they are present.
This routine should not be called directly by the user application. It cannot be used to initialize interrupt vectors.
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( )
sysLocalToBusAdrs( ) - convert a local address to a bus address
STATUS sysLocalToBusAdrs ( int adrsSpace, /* bus address space where busAdrs resides */ char * localAdrs, /* local address to convert */ char * * pBusAdrs /* where to return bus address */ )
This routine returns a VMEbus address as it would be seen on the bus. The local address that is passed into this routine is the address of the local resource as seen by the CPU.
OK, or ERROR if the address space is unknown or the mapping is not possible.
sysBusToLocalAdrs( ) - convert a bus address to a local address
STATUS sysBusToLocalAdrs ( int adrsSpace, /* bus address space where busAdrs resides */ char * busAdrs, /* bus address to convert */ char * * pLocalAdrs /* where to return local address */ )
This routine returns a local address that is used to access the VMEbus. The bus address that is passed into this routine is the VMEbus address as it would be seen on the bus.
OK, or ERROR if the address space is unknown or the mapping is not possible.
sysBusTas( ) - test and set a specified location
BOOL sysBusTas ( char * adrs /* address to be tested and set */ )
This routine performs a test-and-set (TAS) instruction on the specified address. To prevent deadlocks, interrupts are disabled during the test-and-set operation. The following table defines the method used to insure an atomic operation.
Master Slave_1 Slave_2 VME Chip Don't Care U1 U1 ---------- ---- ---- Method VOWN VOWN VOWN VME Chip Don't Care U1 U2 ---------- ---- ---- Method VOWN VOWN RMW VME Chip U1 or U2 U2 U2+ ---------- ---- ---- Method VOWN+++ RMW RMW VME Chip U2++ U2 U2 PCI Bridge or Hawk ---------- ---- ---- Method lwarx/stwcx RMW RMW + = Refer to target.txt file for explaination of older boards with Universe II (U2). ++ = Refer to target.txt file for explaination of newer boards with Universe II (U2). +++ = The master's hardware does not preserve the atomic RMW. ++++ = If SM_OFF_BOARD == TRUE, the method used will be the same as if the master board is acting like a slave board; namely: RMW for UNIVERSE_II and VOWN for UNIVERSE_I
Although the address passed-in to sysBusTas( ) is defined as "char *", vxTas( ) operates on the address as a "void *". For PowerPC, this implies that the location tested-and-set is actually a 32-bit entity.
TRUE if the value had not been set but is now, or FALSE if the value was set already.
sysLib, vxTas( ), sysBusTasClear( )
sysBusTasClear( ) - clear a location set by sysBusTas( )
void sysBusTasClear ( volatile char * adrs /* Address of semaphore to be cleared */ )
This routine clears the specified 32-bit location typically set by sysBusTas( ). The following table defines the method used to insure an atomic operation.
Master Slave_1 Slave_2 VME Chip Don't Care U1 U1 ---------- ---- ---- Method VOWN VOWN VOWN VME Chip Don't Care U1 U2 ---------- ---- ---- Method VOWN VOWN RMW VME Chip U1 or U2 U2 U2+ ---------- ---- ---- Method VOWN+++ RMW RMW VME Chip U2++ U2 U2 PCI Bridge or Hawk ------------ ------------ ------------ Method simple clear simple clear simple clear + = Refer to target.txt file for explaination of older boards with Universe II (U2). ++ = Refer to target.txt file for explaination of newer boards with Universe II (U2). +++ = The master's hardware does not preserve the atomic RMW. ++++ = If SM_OFF_BOARD == TRUE, no special/additional processing is required.
N/A
sysNvRead( ) - read one byte from NVRAM
UCHAR sysNvRead ( ULONG offset /* NVRAM offset to read the byte from */ )
This routine reads a single byte from a specified offset in NVRAM.
The byte from the specified NVRAM offset.
sysNvWrite( ) - write one byte to NVRAM
void sysNvWrite ( ULONG offset, /* NVRAM offset to write the byte to */ UCHAR data /* datum byte */ )
This routine writes a single byte to a specified offset in NVRAM. The MVME2600 uses a 48T18 device w/fast write times, no wait.
N/A
sysCpuCheck( ) - confirm the CPU type
void sysCpuCheck (void)
This routine validates the cpu type. If the wrong cpu type is discovered a message is printed using the serial channel in polled mode.
N/A.
sysProbeErrClr( ) - clear errors associated with probing an address on a bus.
void sysProbeErrClr (void)
This routine clears the error flags and conditions in the DAR, DSISR, SRR0 and SRR1 PowerPC registers arising from probing addresses as well as the Hawk MERST and PCI_CFG_STATUS registers and the Universe PCI_CSR and V_AMERR registers.
N/A
sysVmeProbe( ) - probe a VME bus address
STATUS sysVmeProbe ( char * adrs, /* address to be probed */ int mode, /* VX_READ or VX_WRITE */ int length, /* 1, 2 or 4 byte probe */ char * pVal /* address of value to write OR address of */ /* location to place value read */ )
This routine probes an address on the VME bus. The PCI bridge (Hawk chip) must have a special setup to enable generation of Master Abort cycles on write probes and reception of Target Abort cycles on read probes. The Hawk MPC must be configured to generate Machine Check interrupts on Master Abort or Target Abort cycles. The CPU must be configured to enable Machine Check exceptions. In addition, if the probe is a write, the Universe must be configured to disable Posted Writes. All probing is done with interrupts disabled.
This routine assumes that the Universe Local Control registers are dedicated to these VME address spaces:
LSI0 - LM/SIG (mailbox) LSI1 - A32 LSI2 - A24 LSI3 - A16
OK or ERROR if address cannot be probed
sysPciProbe( ) - probe a PCI bus address
STATUS sysPciProbe ( char * adrs, /* address to be probed */ int mode, /* VX_READ or VX_WRITE */ int length, /* 1, 2 or 4 byte probe */ char * pVal /* address of value to write OR address of */ /* location to place value read */ )
This routine probes an address on the PCI bus. The PCI bridge (Hawk chip) must have a special setup to enable generation of Master Abort cycles on write probes and reception of Target Abort cycles on read probes. The Hawk MPC must be configured to generate Machine Check interrupts on Master Abort or Target Abort cycles. The CPU must be configured to enable Machine Check exceptions. All probing is done with interrupts disabled.
OK or ERROR if address cannot be probed
sysBusProbe( ) - probe a bus address based on bus type.
STATUS sysBusProbe ( char * adrs, /* address to be probed */ int mode, /* VX_READ or VX_WRITE */ int length, /* 1, 2 or 4 byte probe */ char * pVal /* address of value to write OR address of */ /* location to place value read */ )
This routine is a function hook into vxMemProbe. It determines which bus, VME, PCI or local is being probed based on the address to be probed. If the VME bus is being probed, the sysVmeProbe( ) routine is called to do the special VME probing. If the PCI bus is being probed, the sysPciProbe( ) routine is called to do the special PCI probing. If the local bus is being probed, the routine returns ERROR which indicates that the default local bus probe in vxMemProbe( ) should be used.
ERROR if local bus is being probed, OK if VME or PCI bus.
sysUsDelay( ) - delay at least the specified amount of time (in microseconds)
void sysUsDelay ( UINT32 delay /* length of time in microsec to delay */ )
This routine will delay for at least the specified amount of time using the lower 32 bit "word" of the Time Base register as the timer. The accuracy of the delay increases as the requested delay increases due to a certain amount of overhead. As an example, a requested delay of 10 microseconds is accurate within approximately twenty percent, and a requested delay of 100 microseconds is accurate within approximately two percent.
This routine will not relinquish the CPU; it is meant to perform a busy loop delay. The minimum delay that this routine will provide is approximately 10 microseconds. The maximum delay is approximately the size of UINT32; however, there is no roll-over compensation for the total delay time, so it is necessary to back off two times the system tick rate from the maximum.
N/A
sysDebugMsg( ) - print a debug string to the console in polled mode.
void sysDebugMsg ( char * str, UINT32 recovery )
This routine prints a message to the system console in polled mode and optionally exits to the monitor.
N/A
sysConfigBpe( ) - configure processor bus parity checking
void sysConfigBpe (void)
This function configures processor bus parity checking. Parity checking must be enabled in 3 places: 1) Processor, 2) Hawk SMC, and 3) Hawk PHB. It assumes that the default VxWorks machine check exception handler is installed to catch and display processor bus parity errors.
OK if parity enabled, ERROR otherwise.
reportBootromErrors( ) - report errors detected during rom start.
void reportBootromErrors (void)
This function reports error bits left behind by the rom start sequence. These bits are stored in the Hawk PHB general purpose registers and are read out and printed by this routine.
N/A