sysLib [mv2304] - Motorola MVME2600 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
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
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
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
sysScsiInit( ) - initialize an on-board SCSI port
inOrderExecute( ) - enforce in-order execution of PowerPC accesses
sysScsiConfig( ) - system SCSI configuration
sysScsiInByte( ) - BSP-specific byte input routine
sysScsiOutByte( ) - BSP-specific byte output routine
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( ) - Raven VMEbus interrupt handler
sysBusRmwEnable( ) - enable Read-Modify-Write (RMW) cycle on VMEbus
sysBusRmwDisable( ) - Disable Read-Modify-Write (RMW) cycle on the VMEbus.
sysMpicInit( ) - initialize the MPIC in the Raven
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.
sysIbcIntLevelSet( ) - set the interrupt priority level
sysAuxClkInit( ) - raven aux. clock initialization routine
sysAuxClkConnect( ) - connect a routine to the auxiliary clock interrupt
sysAuxClkDisable( ) - turn off auxiliary clock interrupts
sysAuxClkEnable( ) - turn on auxiliary clock interrupts
sysAuxClkRateGet( ) - get the auxiliary clock rate
sysAuxClkRateSet( ) - set the auxiliary clock rate
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( )
sysLanIntEnable( ) - enable the LAN interrupt
sysLanIntDisable( ) - disable the LAN interrupt
sysNvRead( ) - read one byte from NVRAM
sysNvWrite( ) - write one byte to NVRAM
sysCpuCheck( ) - confirm the CPU type
sysRavenErrClr( ) - Clear error conditions in Raven
sysPciExtRavenInit( ) - initialize the extended portion of the Raven PCI header
sysGetBusSpd( ) - get the speed of the 60x processor bus
sysDec21x40EnetAddrGet( ) - retrive ethernet address.
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.
sysGetMpuSpd( ) - get the speed of the MPC750 processor.
sysUsDelay( ) - delay at least the specified amount of time (in microseconds)
This library provides board-specific routines. The chip drivers included are:
i8250Sio.c - Intel 8250 UART driver
z8530Sio.c - Zilog 8530 ESCC driver
ppcDecTimer.c - PowerPC decrementer timer library (system clock)
ppcZ8536Timer.c - Zilog Z8536 timer library (auxiliary 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
ncr810Lib - NCR 53C810 or NCR 53C825 SCSI controller library
fdcDrv.c - driver for PS2 floppy device controller(FDC)
isaDma.c - I8237 ISA DMA transfer interface librarysl82565IntrCtl.c - interrupt controller driver
or
ravenMpic.c - raven Mpic / W83C553 PIB/IBC Interrupt Controller
sysLib.h
sysLib, 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.
- -
- 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.
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.
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).
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.
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
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( )
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( )
sysScsiInit( ) - initialize an on-board SCSI port
STATUS sysScsiInit ()
This routine creates and initializes an NCR 53C8xx SCSI I/O processor (SIOP) structure, enabling use of the on-board SCSI port. It connects the proper interrupt service routine to the desired vector, and enables the interrupt at the desired level.
OK, or ERROR if the SIOP structure cannot be created, the controller cannot be initialized, valid values cannot be set up in the SIOP registers, or the interrupt service routine cannot be connected.
inOrderExecute( ) - enforce in-order execution of PowerPC accesses
void inOrderExecute ()
This routine enforces in-order execution of register accesses to the SCSI I/O processor (SIOP). It is invoked by the SCSI-2 driver, and is a wrapper to a PowerPC assembler instruction.
N/A.
sysScsiConfig( ) - system SCSI configuration
STATUS sysScsiConfig (void)
This routine is an example SCSI configuration routine.
Most of the code for this routine shows how to declare a SCSI peripheral configuration. This routine must be edited to reflect the actual configuration of the user's SCSI bus. This example can also be found in src/config/usrScsi.c.
For users just getting started, hardware configurations can be tested by defining SCSI_AUTO_CONFIG in config.h, which probes the bus and displays all devices found. No device should have the same SCSI bus ID as the VxWorks SCSI port (default = 7), or the same ID as any other device. Check for proper bus termination.
This routine includes three configuration examples that demonstrate configuration of a SCSI hard disk (any type), of an OMTI 3500 floppy disk, and of a tape drive (any type).
The hard disk is divided into two 32-megabyte partitions and a third partition with the remainder of the disk. The first partition is initialized as a dosFs device. The second and third partitions are initialized as rt11Fs devices, each with 256 directory entries.
It is recommended that the first partition on a block device (BLK_DEV) be a dosFs device, if the intention is eventually to boot VxWorks from the device. This will simplify the task considerably.
The floppy, since it is a removable medium device, is allowed to have only a single partition, and dosFs is the file system of choice because it facilitates media compatibility with IBM PC machines.
While the hard disk configuration is fairly straightforward, the floppy setup in this example is more intricate. Note that the scsiPhysDevCreate( ) call is issued twice. The first time is merely to get a "handle" to pass to scsiModeSelect( ); the default media type is sometimes inappropriate (in the case of generic SCSI-to-floppy cards). After the hardware is correctly configured, the handle is discarded using scsiPhysDevDelete( ), after which a second call to scsiPhysDevCreate( ) correctly configures the peripheral. (Before the scsiModeSelect( ) call, the configuration information was incorrect.) Also note that following the scsiBlkDevCreate( ) call, correct values for sectorsPerTrack and nHeads must be set using scsiBlkDevInit( ). This is necessary for IBM PC compatibility.
Similarly, the tape configuration is more complex because certain device parameters must be turned off within VxWorks and the tape fixed block size must be defined, assuming that the tape supports fixed blocks.
The last parameter to the dosFsDevInit( ) call is a pointer to a DOS_VOL_CONFIG structure. If NULL is specified, dosFsDevInit( ) reads this information off the disk in the drive. The read may fail if no disk is present or if the disk has no valid dosFs directory. Should that happen, use dosFsMkfs( ) to create a new directory on a disk. This routine uses default parameters (see dosFsLib) that may not be suitable an application, in which case, use dosFsDevInit( ) with a pointer to a valid DOS_VOL_CONFIG structure that has been created and initialized by the user. If dosFsDevInit( ) is used, a call to diskInit( ) should be made to write a new directory on the disk, if the disk is blank or disposable.
The variable pSbdFloppy is global to allow the above calls to be made from the VxWorks shell, for example:
-> dosFsMkfs "/fd0/", pSbdFloppyIf a disk is new, use diskFormat( ) to format it.
sysScsiInByte( ) - BSP-specific byte input routine
UINT8 sysScsiInByte ( UINT32 adr /* address of where to read byte */ )
This routine reads one byte at the specified address in a BSP-specific manner. It is invoked by the SCSI-2 driver, and is a wrapper to a PowerPC assembler routine.
unsigned byte
sysScsiOutByte( ) - BSP-specific byte output routine
void sysScsiOutByte ( UINT32 adr, /* address of where to write byte */ UINT8 val /* value of byte to write */ )
This routine writes one byte at the specified address in a BSP-specific manner. It is invoked by the SCSI-2 driver, and is a wrapper to a PowerPC assembler routine.
N/A.
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( ) - Raven VMEbus interrupt handler
void sysUnivVmeIntr (void)
This is the VMEbus interrupt handler for the Motorola Raven PCI Host Bridge (PHB) and Multi-Processor Interrupt Controller (MPIC). It is connected to the single VMEbus interrupt from the Raven 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
sysMpicInit( ) - initialize the MPIC in the Raven
STATUS sysMpicInit (void)
This function initializes the Multi-Processor Interrupt Controller (MPIC) contained in the Raven 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. This is also compatible for the PBC within the VT82C586B PIPC.
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
sysIbcIntLevelSet( ) - set the interrupt priority level
void sysIbcIntLevelSet ( int intNum /* interrupt level to implement */ )
This routine masks interrupts with real priority equal to or lower than intNum. The special value 16 indicates all interrupts are enabled. Individual interrupt numbers have to be specifically enabled by sysIbcIntEnable( ) before they are ever enabled by setting the interrupt level value.
Note because of the IBM cascade scheme, the actual priority order for interrupt numbers is (high to low) 0, 1, 8, 9, 10, 11, 12, 13, 14, 15, 3, 4, 5, 6, 7, 16 (all enabled)
N/A
sysAuxClkInit( ) - raven aux. clock initialization routine
STATUS sysAuxClkInit (void)
This routine should be called before calling any other routine in this module.
OK, or ERROR.
sysAuxClkConnect( ) - connect a routine to the auxiliary clock interrupt
STATUS sysAuxClkConnect ( FUNCPTR routine, /* routine called at each aux clock interrupt */ int arg /* argument with which to call routine */ )
This routine specifies the interrupt service routine to be called at each auxiliary clock interrupt.
OK, or ERROR if the routine cannot be connected to the interrupt.
sysLib, intConnect( ), sysAuxClkEnable( )
sysAuxClkDisable( ) - turn off auxiliary clock interrupts
void sysAuxClkDisable (void)
This routine disables auxiliary clock interrupts.
N/A
sysAuxClkEnable( ) - turn on auxiliary clock interrupts
void sysAuxClkEnable (void)
This routine enables auxiliary clock interrupts.
N/A
sysAuxClkRateGet( ) - get the auxiliary clock rate
int sysAuxClkRateGet (void)
This routine returns the interrupt rate of the auxiliary clock.
The number of ticks per second of the auxiliary clock.
sysLib, sysAuxClkEnable( ), sysAuxClkRateSet( )
sysAuxClkRateSet( ) - set the auxiliary clock rate
STATUS sysAuxClkRateSet ( int ticksPerSecond /* number of clock interrupts per second */ )
This routine sets the interrupt rate of the auxiliary clock. It is not supported, since the auxiliary clock always runs at the same rate as the system clock.
OK or ERROR.
sysLib, sysAuxClkEnable( ), sysAuxClkRateGet( )
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, for example, "Motorola MVME2600 - MPC 604e".
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 Raven3 ---------- ---- ---- 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 Raven3 ------------ ------------ ------------ 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
sysLanIntEnable( ) - enable the LAN interrupt
STATUS sysLanIntEnable ( int intLevel /* interrupt level to enable */ )
This routine enables interrupts at a specified level for the on-board LAN chip. LAN interrupts are controlled by the ISA Bridge Control (IBC) chip. The LANCE chip on this board is on the Peripheral Component Interconnect (PCI) bus. The PCI interrupts should be routed through the IBC to the processor. The LANCE chip asserts PCI IRQ0 which is routed to the IBC. The IBC must be programmed to generate an ISA IRQ10.
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.
OK, or ERROR if network support not included.
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.
sysRavenErrClr( ) - Clear error conditions in Raven
void sysRavenErrClr (void)
This routine clears any existing errors in the Motorola Raven PCI Host Bridge Controller.
N/A
sysPciExtRavenInit( ) - initialize the extended portion of the Raven PCI header
STATUS sysPciExtRavenInit ( 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 Raven ISA Bridge Controller (IBC).
OK, or ERROR if...
sysLib, sysPciExtIbcInit( )
sysGetBusSpd( ) - get the speed of the 60x processor bus
int sysGetBusSpd (void)
This routine returns the speed (in MHz) of the 60x system bus.
The bus speed (inMHz).
sysDec21x40EnetAddrGet( ) - retrive ethernet address.
STATUS sysDec21x40EnetAddrGet ( int unit, char * enetAdrs )
This routine returns a six-byte ethernet address for a given ethernet unit. The dec21x40End driver uses this routine to obtain the ethernet address if indicated by a user-flag in DEC_LOAD_STRING in configNet.h; or if the reading the ethernet address ROM is unsuccessful.
ERROR, always since this board always has a valid standard ethernet address ROM.
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 Raven 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 */ /* value read */ )
This routine probes an address on the VME bus. The PCI bridge (Raven 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 Raven 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 */ /* value read */ )
This routine probes an address on the PCI bus. The PCI bridge (Raven 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 Raven 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 */ /* 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.
sysGetMpuSpd( ) - get the speed of the MPC750 processor.
UINT sysGetMpuSpd(void)
This routine returns the speed (in MHz) of the 60x processor
The approximate CPU speed (inMHz).
Note: This speed returned is an approximation based on the accuracy of the value returned by sysGetBusSpd( ). For a 267MHz Arthur system, running with a bus clock of 67 MHz, the actual speed returned is 268MHz.
This function is dependent upon proper bus speed being returned via call to sysGetBusSpd( ). In addition to this dependency, the function will only work for CPUs whose speed is dependent upon the bus speed and the value in the PLL bits of the HID1 register. CPUs which HAVE this property are 602, Arthur, 604ev and 604r. CPUs which do NOT HAVE this property (and for which this function will NOT work) are: 601, 603, 603e, 603p, and 604.
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