VxWorks BSP Reference : ads860
sysLib [ads860] - Motorola 860ads board system-dependent library
sysSerialHwInit( ) - initialize the BSP serial devices to a quiesent state
sysSerialHwInit2( ) - connect BSP serial device interrupts
sysSerialChanGet( ) - get the SIO_CHAN device associated with a serial channel
sysSerialReset( ) - reset the serail device
ppc860IntrInit( ) - initialize the interrupt manager for the PowerPC 800 series
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
sysMotCpmEndLoad( ) - load an istance of the motCpmEnd driver
sysModel( ) - return the model name of the CPU board
sysBspRev( ) - return the bsp version with the revision eg 1.0/x
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( ) - additional system configuration and initialization
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
This library provides board-specific routines. The chip drivers included are:
ppc860Timer.c - PowerPC/860 Timer library
sysMotCpmEnd.c - configuration module for the motCpmEnd driver
sysLib.h
VxWorks Programmer's Guide: Configuration
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.
Both the SMC serial channels are initialized if the variable chanNum equals two. In this case, SMC1 uses BRG1 and SMC2 uses BRG2. However, if using an MPC823/850 processor, only SMC1 is initialized.
Data Parameter Ram layout:
-----------------------------
| | DPRAM base
| |
| |
| |
|---------------------------|
| 8 bytes per descriptor | SMC1 Tx Buffer Descriptor (0x2200)
|---------------------------|
| |
|---------------------------|
| 16 descriptors @ | SMC1 Rx Buffer Descriptors (0x2210)
| 8 bytes per descriptor |
| |
|---------------------------|
| | end SMC1 Rx BDs (0x2290)
| |
| |
|---------------------------|
| 80 bytes allowed | SMC1 Tx Buffer (0x2300 + DPRAM base )
|---------------------------|
| one receive char/buffer | SMC1 Rx Buffer (0x2380 + DPRAM base )
|---------------------------|
| |
| |
|---------------------------|
| 8 bytes per descriptor | SMC2 Tx Buffer Descriptor (0x2400)
|---------------------------|
| |
|---------------------------|
| 16 descriptors @ | SMC2 Rx Buffer Descriptors (0x2410)
| 8 bytes per descriptor |
| |
|---------------------------|
| | end SMC2 Rx BDs (0x2490)
| |
| |
|---------------------------|
| 80 bytes allowed | SMC2 Tx Buffer (0x2500 + DPRAM base )
|---------------------------|
| one receive char/buffer | SMC2 Rx Buffer (0x2580 + DPRAM base )
|---------------------------|
| |
| |
| |
| |
|---------------------------|
| 34 bytes of parameter info| SMC1 Parameter Area (0x3e80)
| including Rx and Tx BD |
| pointers, func codes |
| etc... |
|---------------------------|
| |
|---------------------------|
| 34 bytes of parameter info| SMC2 Parameter Area (0x3f80)
| 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 serail device
void sysSerialReset (void)
This function calls sysSerialHwInit( ) to reset the serail 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.
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.
This routine has no effect, since there is no non-volatile RAM.
ERROR, always.
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.
This routine has no effect, since there is no non-volatile RAM.
ERROR, always.
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( )
sysMotCpmEndLoad( ) - load an istance of the motCpmEnd driver
END_OBJ * sysMotCpmEndLoad ( char * pParamStr, /* ptr to initialization parameter string */ void * unused /* unused optional argument */ )
This routine loads the motCpmEnd driver with proper parameters. It also reads the BCSR3 to find out which type of processor is being used, and sets up the load string accordingly.
The END device load string formed by this routine is in the following format. motCpmAddr:ivec:sccNum:txBdNum:rxBdNum:txBdBase:rxBdBase: bufBase
- motCpmAddr
- Internal memory address
- ivec
- Interrupt vector
- sccNum
- SCC number being used
- txBdNum
- number of TBDs or NULL
- rxBdNum
- number of RBDs or NULL
- txBdBase
- base location of the TBDs
- rxBdBase
- base location of the RBDs
- bufBase
- address of the shared memory region
This routine only loads and initializes one instance of the device. If the user wishes to use more than one motCpmEnd devices, this routine should be changed.
pointer to END object or NULL.
sysLib, motCpmEndLoad ()
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.
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
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.
sysHwInit2( ) - additional system configuration and initialization
void sysHwInit2 (void)
This routine connects system interrupts and does any additional configuration necessary.
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.
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 - only slave SCC1 is wired to port */ )
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 )
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 - only slave SCC1 is wired to port */ )
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 - only slave SCC1 is wired to port */ 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.