VxWorks BSP Reference : mbx860
sysLib [mbx860] - Motorola MBX860 board 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
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
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 serial device
ppc860IntrInit( ) - initialize the interrupt manager for the PowerPC 800 series
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
sysNvRamGet( ) - get the contents of non-volatile RAM
sysNvRamSet( ) - write to non-volatile RAM
mbxI2cConfigParamsGet( ) - get the board configuration parameters out of SROM
mbxI2cMemcConfig( ) - configure the MEMC registers
qspanHostInit( ) - initialize the QSpan PCIBus bridge controller
qspanRegMap( ) - map QSPAN registers
qspanSlaveImageSet( ) - setup a PCI slave image
qspanTargetImageSet( ) - setup a PCI target image
qspanHostEnable( ) - enable the bridge
qspanHostReset( ) - reset the QSpan PCIBus bridge controller
sysIbcPciExtInit( ) - initialize the extended portion of the IBC PCI header
sysIbcInit( ) - Initialize the IBC
sysIbcIntConnect( ) - connect an interrupt handler to the system vector table
sysIbcIntEnable( ) - enable a IBC interrupt level
sysIbcIntDisable( ) - disable a IBC interrupt level
sysIbcIntHandler( ) - handler of the sl82565 IBC interrupt.
smcC67Init( ) - initialize the Super I/O chip
i2cMcp( ) - download RISC microcode patch
sysModel( ) - return the model name of the CPU board
sysBspRev( ) - return the bsp version with the revision eg 1.0/x
sysClkRateAdjust( ) - Adjust the clock frequency
sysHwInit( ) - initialize the system hardware
sysPciCfgRead( ) - read longword from PCI configuration space
sysPciCfgWrite( ) - write longword to PCI configuration space
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
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 location across the bus
sysBusClearTas( ) - test and clear
sysCpmEnetDisable( ) - disable the Ethernet controller
sysCpmEnetIntDisable( ) - disable the Ethernet interface interrupt
sysCpmEnetEnable( ) - enable the Ethernet controller
sysCpmEnetAddrGet( ) - get the hardware Ethernet address
sysCpmEnetCommand( ) - issue a command to the Ethernet interface controller
sysCpmEnetIntEnable( ) - enable the Ethernet interface interrupt
sysCpmEnetIntClear( ) - clear the Ethernet interface interrupt
sysPciTrap( ) - trap handler for PCI exception
sysMsDelay( ) - delay for the specified amount of time (MS)
sysIntEnablePIC( ) - enable an ISA/PCI interrupt
sysDelay( ) - delay for approx. 1ms
sysAtaInit( ) - initialize the EIDE/ATA interface
sysInByteString( ) - reads a string of bytes from an io address.
sysOutByteString( ) - writes a string of bytes to an io address.
sysInWordString( ) - reads a string of words from an io address.
sysInWordStringRev( ) - byte reversed word read.
sysOutWordString( ) - writes a string of words to an io address.
sysInLongString( ) - reads a string of longwords from an io address.
sysOutLongString( ) - writes a string of longwords to an io address.
This library provides board-specific routines. The chip drivers included are:
ppc860Timer.c - PowerPC Decrementer Timer library + 860 timers.
ppcDecTimer.c - PowerPC Decrementer Timer library.
byteNvRam.c - NVRAM access routines
mbxI2c.c - I2C bus access
qspanPci.c - QSPAN PCI bus bridge device
w83c553f.c - ISA interrupt controller
smcC67SuperIo.c - Super I/O chip initialization
i2cMcp.c - I2C micro-chip patch
ataDrv.c - IDE/ATA driver
mbxPcmcia.c - PCMCIA support
mbxLptDrv.c - Parallel port driver
fdcDrv.c - Floppy driver
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
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.
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.
Data Parameter Ram layout:
----------------------------- | | DPRAM base (address = 0x2000) | | | | |---------------------------| | 8 bytes per descriptor | Tx Buffer Descriptor (0x2200) |---------------------------| | | |---------------------------| | 16 descriptors @ | Rx Buffer Descriptors (0x2210) | 8 bytes per descriptor | | | |---------------------------| | | end Rx BDs (0x2290) | | | | |---------------------------| | 80 bytes allowed | Tx Buffer (0x2300) |---------------------------| | one receive char/buffer | Rx Buffer (0x2380) |---------------------------| | | | | | | | | |---------------------------| | 3A hex bytes of parameter | SMC1 Parameter Area (0x3e80) | info including Rx and Tx | | BD pointers, func codes | | etc... | |---------------------------|
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
sysSerialChanGet( ) - get the SIO_CHAN device associated with a serial channel
SIO_CHAN * sysSerialChanGet ( int channel /* serial channel */ )
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 serial device
void sysSerialReset (void)
This function calls sysSerialHwInit( ) to reset the serial device
N/A
ppc860IntrInit( ) - initialize the interrupt manager for the PowerPC 800 series
STATUS ppc860IntrInit ( VOIDFUNCPTR * cpmIntrVec /* Intr level of the CPM Intr ctrl */ )
This routine connects the default demultiplexers, ppc860IntrDeMux( ) and ppc860CpmIntrDeMux, 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 and CPM unit are enabled, CICR is setup so that SCC1 has the highest relative interrupt priority, through SCC4 with the lowest.
OK or ERROR if the SUI interrupt level to connect the CPM interrupt contoller is wrong.
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( )
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( )
mbxI2cConfigParamsGet( ) - get the board configuration parameters out of SROM
void mbxI2cConfigParamsGet (void)
This routine will read board specific parameters via the I2C from the SROM and the DIMM. The results will be store in temprory variables in DPRAM, and then copied into global variables in sysHwInit.
N/A
mbxI2cMemcConfig( ) - configure the MEMC registers
void mbxI2cMemcConfig (void)
This routine will perform the final adjustments to the Memory Controller Bank/Option registers.
N/A
qspanHostInit( ) - initialize the QSpan PCIBus bridge controller
void qspanHostInit ( UINT32 qspanAdr /* base address of the QSpan device regs. */ )
This function's purpose is to initialize the QSpan device. This device spans the QBus to PCIBus.
N/A
qspanRegMap( ) - map QSPAN registers
STATUS qspanRegMap ( UINT32 qspanAdr, /* base address of the QSpan device regs. */ UINT32 pciSpace, UINT32 baseAdr )
This function will map a 4KB block in either PCI memory of I/O space to allow access to the QSPAN register set.
N/A
qspanSlaveImageSet( ) - setup a PCI slave image
void qspanSlaveImageSet ( UINT32 qspanAdr, /* base address of the QSpan device regs. */ UINT32 image, /* slave image number 0 or 1 */ UINT32 cntrlRegValue, /* value to be stored in the slave image */ /* control register */ UINT32 adrRegValue /* value to be stored in the slave image */ /* address translation register */ )
This function will program one of the QSPAN PCI slave images (CPU to PCI mapping).
N/A
qspanTargetImageSet( ) - setup a PCI target image
void qspanTargetImageSet ( UINT32 qspanAdr, /* base address of the QSpan device regs. */ UINT32 image, /* target image number 0 or 1 */ UINT32 pciBaseAdr, /* base address of the target image */ UINT32 translateAdr, /* base address for translation of target adr */ UINT32 cntrlRegValue /* value to be stored in the target image */ /* control register */ )
This function will program the selected QSPAN PCI target image (mapping the address space from the point of view of the PCI bus). It is used mostly for mapping access from PCI memory space to the local DRAM.
N/A
qspanHostEnable( ) - enable the bridge
void qspanHostEnable ( UINT32 qspanAdr /* base address of the QSpan device regs. */ )
This function enables I/O-space, memory-space, and bus mastering on the host.
N/A
qspanHostReset( ) - reset the QSpan PCIBus bridge controller
void qspanHostReset ( UINT32 qspanAdr /* base address of the QSpan device regs. */ )
This function's purpose is to reset the QSpan device.
N/A
sysIbcPciExtInit( ) - initialize the extended portion of the IBC PCI header
STATUS sysIbcPciExtInit ( int pciBusNo, /* PCI bus number */ int pciDevNo, /* PCI device number */ int pciFuncNo /* PCI function number */ )
This routine initializes the extended portion of the ISA Bridge Controller (IBC) PCI header.
OK or ERROR.
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
sysIbcIntConnect( ) - connect an interrupt handler to the system vector table
STATUS sysIbcIntConnect ( VOIDFUNCPTR * vector, /* interrupt vector to attach */ VOIDFUNCPTR routine, /* routine to be called */ int parameter /* parameter to be passed to routine */ )
This function connects an interrupt handler to the system vector table.
OK or ERROR.
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 disabled.
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.
It then saves the current ISA interrupt mask values and sets the new mask values to mask all further ISA interrupts of equal or lesser level. It then re-enables MPIC interrupts and re-enables CPU external interrupts.
This routine then processes the interrupt by calling all interrupt service routines chained to the vector.
Finally, this routine disables CPU external interrupts and restores the ISA interrupt mask values before returning.
N/A
smcC67Init( ) - initialize the Super I/O chip
void smcC67Init (void)
This function performs the necessary initialization of the devices on the SMC fdc37c67 Super I/O chip.
Upon completion, UIO resource registers are mapped as follows:
Resource Enabled Address FDC Yes PRI 3F0-3F7 IDE Yes PRI 1F0-1F7 3F6, 3F7 UART1 Yes COM1 3F8-3FF UART2 Yes COM2 2F8-2FF Parallel PORT Yes LPT1 3BC-3BE RTC Yes 070, 071 KBC Yes 060, 064 GPIO Yes 0EA, 0EB
N/A
i2cMcp( ) - download RISC microcode patch
void i2cMcp ()
This function's purpose is to install the RISC microcode patch.
N/A
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 with the revision eg 1.0/x
char * sysBspRev (void)
This function returns a pointer to a bsp version with the revision. for eg. 1.0/x. BSP_REV defined in config.h is concatanated to BSP_VERSION and returned.
A pointer to the BSP version/revision string.
sysClkRateAdjust( ) - Adjust the clock frequency
void sysClkRateAdjust ( int * sysDecClkFreq )
This function recalculates the decrementer clock frequency value based on the actual system clock speed.
N/A
sysHwInit( ) - initialize the system hardware
void sysHwInit (void)
This routine initializes various feature of the MPC860ADS boards. 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
sysPciCfgRead( ) - read longword from PCI configuration space
STATUS sysPciCfgRead ( int busNo, int deviceNo, int funcNo, int offset, int size, /* 1, 2, or 4 */ void * pResult )
This does a QSPAN style PCI read. This function is passed as a pointer during initialization of PCI mechanism 0 in pciConfigLibInit. This function has the machine check handler support included in.
OK always.
sysPciCfgWrite( ) - write longword to PCI configuration space
STATUS sysPciCfgWrite ( int busNo, int deviceNo, int funcNo, int offset, int size, UINT32 data )
This does a QSPAN style PCI write. This function is passed as a pointer during initialization of PCI mechanism 0 in pciConfigLibInit. This function has the machine check handler support included in.
OK always
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.
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 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.
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.
Not applicable for the busless 860Ads.
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 gets the VMEbus address that accesses a specified local memory address.
Not applicable for the 860Ads
ERROR, always.
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 gets the local address that accesses a specified VMEbus physical memory address.
Not applicable for the 860Ads
ERROR, always.
sysBusTas( ) - test and set a location across the bus
BOOL sysBusTas ( char * adrs /* address to be tested-and-set */ )
This routine does an atomic test-and-set operation across the backplane.
Not applicable for the 860Ads.
FALSE, always.
sysBusClearTas( ) - test and clear
void sysBusClearTas ( volatile char * address /* address to be tested-and-cleared */ )
This routine is a null function.
N/A
sysCpmEnetDisable( ) - disable the Ethernet controller
void sysCpmEnetDisable ( int unit /* not used */ )
This routine is expected to perform any target specific functions required to disable the Ethernet controller. This usually involves disabling the Transmit Enable (TENA) signal.
N/A
sysCpmEnetIntDisable( ) - disable the Ethernet interface interrupt
void sysCpmEnetIntDisable ( int unit /* not used */ )
This routine disable the interrupt for the Ethernet interface specified by unit.
N/A.
sysCpmEnetEnable( ) - enable the Ethernet controller
STATUS sysCpmEnetEnable ( int unit /* not used */ )
This routine is expected to perform any target specific functions required to enable the Ethernet controller. These functions typically include enabling the Transmit Enable signal (TENA) and connecting the transmit and receive clocks to the SCC.
OK, or ERROR if the Ethernet controller cannot be enabled.
sysCpmEnetAddrGet( ) - get the hardware Ethernet address
STATUS sysCpmEnetAddrGet ( int unit, /* not used */ UINT8 * addr )
This routine provides the six byte Ethernet hardware address that will be used by each individual Ethernet 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.
sysCpmEnetCommand( ) - issue a command to the Ethernet interface controller
STATUS sysCpmEnetCommand ( int unit, UINT16 command )
OK, or ERROR if the Ethernet controller could not be restarted.
sysCpmEnetIntEnable( ) - enable the Ethernet interface interrupt
void sysCpmEnetIntEnable ( int unit )
This routine enable the interrupt for the Ethernet interface specified by unit.
N/A.
sysCpmEnetIntClear( ) - clear the Ethernet interface interrupt
void sysCpmEnetIntClear ( int unit )
This routine clears the interrupt for the Ethernet interface specified by unit.
N/A.
sysPciTrap( ) - trap handler for PCI exception
void sysPciTrap ( ESFPPC * pEsf /* pointer to exception stack frame */ )
This routine is called from the excConnectCode stub if the PCI configuration access generates an exception. By default, sysIn... returns the value read. This code changes the PC to sysPciErr which sets the return value to -1.
NOTE: The QSpan PCI Bridge causes machine check exceptions to
occur when a non-present device address is put into the
configuration register. This is why the sysPciTrap routine
is essential.
N/A
sysMsDelay( ) - delay for the specified amount of time (MS)
void sysMsDelay ( UINT delay /* length of time in MS to delay */ )
This routine will delay for the specified amount of time by counting decrementer ticks.
This routine is not dependent on a particular rollover value for the decrementer, it should work no matter what the rollover value is.
A small amount of count may be lost at the rollover point resulting in the sysMsDelay( ) causing a slightly longer delay than requested.
This routine will produce incorrect results if the delay time requested requires a count larger than 0xffffffff to hold the decrementer elapsed tick count. For an MBX860 40MHz board that amounts to about 1716 seconds (thus not considered too severe a restriction).
N/A
sysIntEnablePIC( ) - enable an ISA/PCI interrupt
STATUS sysIntEnablePIC ( int intNum )
This function call is used by certain vxWorks device drivers. It calls the system routine intConnect.
OK or ERROR
sysDelay( ) - delay for approx. 1ms
void sysDelay (void)
This implements an unsupported system call to support drivers ported from Intel platforms.
N/A
sysAtaInit( ) - initialize the EIDE/ATA interface
void sysAtaInit ( int pciBusNo, /* PCI bus number */ int pciDevNo, /* PCI device number */ int pciFuncNo /* PCI function number */ )
Perform the necessary initialization required before starting up the ATA/EIDE driver.
sysInByteString( ) - reads a string of bytes from an io address.
void sysInByteString ( ULONG ioAddr, /* I/O address */ UCHAR * bufPtr, /* pointer to data buffer */ int nBytes /* number of bytes to read */ )
This function reads a byte string from a specified io address.
N/A
sysOutByteString( ) - writes a string of bytes to an io address.
void sysOutByteString ( ULONG ioAddr, /* I/O address */ UCHAR * bufPtr, /* pointer to data buffer */ int nBytes /* number of bytes to write */ )
This function writes a byte string to a specified io address.
N/A
sysInWordString( ) - reads a string of words from an io address.
void sysInWordString ( ULONG ioAddr, /* I/O address */ UINT16 * bufPtr, /* pointer to data buffer */ int nWords /* number of 2 byte words to read */ )
This function reads a word string from a specified io address.
N/A
sysInWordStringRev( ) - byte reversed word read.
void sysInWordStringRev ( ULONG ioAddr, /* I/O address */ UINT16 * bufPtr, /* pointer to data buffer */ int nWords /* number of 2 byte words to read */ )
This function reads a byte reversed word string from a specified io address.
N/A
sysOutWordString( ) - writes a string of words to an io address.
void sysOutWordString ( ULONG ioAddr, /* I/O address */ UINT16 * bufPtr, /* pointer to data buffer */ int nWords /* number of 2 byte words to write */ )
This function writes a word string from a specified io address.
N/A
sysInLongString( ) - reads a string of longwords from an io address.
void sysInLongString ( ULONG ioAddr, /* I/O address */ ULONG * bufPtr, /* pointer to data buffer */ int nLongs /* number of 4 byte words to read */ )
This function reads a longword string from a specified io address.
N/A
sysOutLongString( ) - writes a string of longwords to an io address.
void sysOutLongString ( ULONG ioAddr, /* I/O address */ ULONG * bufPtr, /* pointer to data buffer */ int nLongs /* number of 4 byte words to write */ )
This function writes a longword string from a specified io address.
N/A