VxWorks BSP Reference : ads860

sysLib [ads860]

NAME

sysLib [ads860] - Motorola 860ads board system-dependent library

ROUTINES

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

DESCRIPTION

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

INCLUDE FILES

sysLib.h

SEE ALSO

VxWorks Programmer's Guide: Configuration


ads860 : Routines

sysSerialHwInit( )

NAME

sysSerialHwInit( ) - initialize the BSP serial devices to a quiesent state

SYNOPSIS

void sysSerialHwInit (void)

DESCRIPTION

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...                    |
         |---------------------------|
         |                           |
         |                           |

RETURNS

N/A

SEE ALSO

sysLib


ads860 : Routines

sysSerialHwInit2( )

NAME

sysSerialHwInit2( ) - connect BSP serial device interrupts

SYNOPSIS

void sysSerialHwInit2 (void)

DESCRIPTION

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( ).

RETURNS

N/A

SEE ALSO

sysLib


ads860 : Routines

sysSerialChanGet( )

NAME

sysSerialChanGet( ) - get the SIO_CHAN device associated with a serial channel

SYNOPSIS

SIO_CHAN * sysSerialChanGet
    (
    int channel               /* serial channel */
    )

DESCRIPTION

This routine gets the SIO_CHAN device associated with a specified serial channel.

RETURNS

A pointer to the SIO_CHAN structure for the channel, or ERROR if the channel is invalid.

SEE ALSO

sysLib


ads860 : Routines

sysSerialReset( )

NAME

sysSerialReset( ) - reset the serail device

SYNOPSIS

void sysSerialReset (void)

DESCRIPTION

This function calls sysSerialHwInit( ) to reset the serail device

RETURNS

N/A

SEE ALSO

sysLib


ads860 : Routines

ppc860IntrInit( )

NAME

ppc860IntrInit( ) - initialize the interrupt manager for the PowerPC 800 series

SYNOPSIS

STATUS ppc860IntrInit
    (
    VOIDFUNCPTR * cpmIntrVec  /* Intr level of the CPM Intr ctrl */
    )

DESCRIPTION

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.

NOTE

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.

RETURN

OK or ERROR if the SUI interrupt level to connect the CPM interrupt contoller is wrong.

SEE ALSO

sysLib


ads860 : Routines

sysNvRamGet( )

NAME

sysNvRamGet( ) - get the contents of non-volatile RAM

SYNOPSIS

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 */
    )

DESCRIPTION

This routine copies the contents of non-volatile memory into a specified string. The string is terminated with an EOS.

NOTE

This routine has no effect, since there is no non-volatile RAM.

RETURNS

ERROR, always.

SEE ALSO

sysLib, sysNvRamSet( )


ads860 : Routines

sysNvRamSet( )

NAME

sysNvRamSet( ) - write to non-volatile RAM

SYNOPSIS

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 */
    )

DESCRIPTION

This routine copies a specified string into non-volatile RAM.

NOTE

This routine has no effect, since there is no non-volatile RAM.

RETURNS

ERROR, always.

SEE ALSO

sysLib, sysNvRamGet( )


ads860 : Routines

sysClkConnect( )

NAME

sysClkConnect( ) - connect a routine to the system clock interrupt

SYNOPSIS

STATUS sysClkConnect
    (
    FUNCPTR routine,          /* routine to connect */
    int     arg               /* argument for the routine */
    )

DESCRIPTION

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.

RETURNS

OK, or ERROR if the routine cannot be connected to the interrupt.

SEE ALSO

sysLib, intConnect( ), usrClock( ), sysClkEnable( )


ads860 : Routines

sysClkEnable( )

NAME

sysClkEnable( ) - turn on system clock interrupts

SYNOPSIS

void sysClkEnable (void)

DESCRIPTION

This routine enables system clock interrupts.

RETURNS

N/A

SEE ALSO

sysLib, sysClkConnect( ), sysClkDisable( ), sysClkRateSet( )


ads860 : Routines

sysClkDisable( )

NAME

sysClkDisable( ) - turn off system clock interrupts

SYNOPSIS

void sysClkDisable (void)

DESCRIPTION

This routine disables system clock interrupts.

RETURNS

N/A

SEE ALSO

sysLib, sysClkEnable( )


ads860 : Routines

sysClkRateGet( )

NAME

sysClkRateGet( ) - get the system clock rate

SYNOPSIS

int sysClkRateGet (void)

DESCRIPTION

This routine returns the system clock rate.

RETURNS

The number of ticks per second of the system clock.

SEE ALSO

sysLib, sysClkEnable( ), sysClkRateSet( )


ads860 : Routines

sysClkRateSet( )

NAME

sysClkRateSet( ) - set the system clock rate

SYNOPSIS

STATUS sysClkRateSet
    (
    int ticksPerSecond        /* number of clock interrupts per second */
    )

DESCRIPTION

This routine sets the interrupt rate of the system clock. It is called by usrRoot( ) in usrConfig.c.

RETURNS

OK, or ERROR if the tick rate is invalid or the timer cannot be set.

SEE ALSO

sysLib, sysClkEnable( ), sysClkRateGet( )


ads860 : Routines

sysMotCpmEndLoad( )

NAME

sysMotCpmEndLoad( ) - load an istance of the motCpmEnd driver

SYNOPSIS

END_OBJ * sysMotCpmEndLoad
    (
    char * pParamStr,         /* ptr to initialization parameter string */
    void * unused             /* unused optional argument */
    )

DESCRIPTION

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.

RETURNS

pointer to END object or NULL.

SEE ALSO

sysLib, motCpmEndLoad ()


ads860 : Routines

sysModel( )

NAME

sysModel( ) - return the model name of the CPU board

SYNOPSIS

char * sysModel (void)

DESCRIPTION

This routine returns the model name of the CPU board.

RETURNS

A pointer to the string.

SEE ALSO

sysLib


ads860 : Routines

sysBspRev( )

NAME

sysBspRev( ) - return the bsp version with the revision eg 1.0/x

SYNOPSIS

char * sysBspRev (void)

DESCRIPTION

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.

RETURNS

A pointer to the BSP version/revision string.

SEE ALSO

sysLib


ads860 : Routines

sysHwInit( )

NAME

sysHwInit( ) - initialize the system hardware

SYNOPSIS

void sysHwInit (void)

DESCRIPTION

This routine initializes various feature of the MPC860ADS boards. It sets up the control registers, initializes various devices if they are present.

NOTE

This routine should not be called directly by the user.

RETURNS

N/A

SEE ALSO

sysLib


ads860 : Routines

sysPhysMemTop( )

NAME

sysPhysMemTop( ) - get the address of the top of physical memory

SYNOPSIS

char * sysPhysMemTop (void)

DESCRIPTION

This routine returns the address of the first missing byte of memory, which indicates the top of memory.

RETURNS

The address of the top of physical memory.

SEE ALSO

sysLib, sysMemTop( )


ads860 : Routines

sysMemTop( )

NAME

sysMemTop( ) - get the address of the top of VxWorks memory

SYNOPSIS

char * sysMemTop (void)

DESCRIPTION

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.

RETURNS

The address of the top of VxWorks memory.

SEE ALSO

sysLib


ads860 : Routines

sysToMonitor( )

NAME

sysToMonitor( ) - transfer control to the ROM monitor

SYNOPSIS

STATUS sysToMonitor
    (
    int startType             /* parameter passed to ROM to tell it how */
                              /* to boot */ 
    )

DESCRIPTION

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.

RETURNS

Does not return.

SEE ALSO

sysLib


ads860 : Routines

sysHwInit2( )

NAME

sysHwInit2( ) - additional system configuration and initialization

SYNOPSIS

void sysHwInit2 (void)

DESCRIPTION

This routine connects system interrupts and does any additional configuration necessary.

RETURNS

N/A

SEE ALSO

sysLib


ads860 : Routines

sysProcNumGet( )

NAME

sysProcNumGet( ) - get the processor number

SYNOPSIS

int sysProcNumGet (void)

DESCRIPTION

This routine returns the processor number for the CPU board, which is set with sysProcNumSet( ).

RETURNS

The processor number for the CPU board.

SEE ALSO

sysLib, sysProcNumSet( )


ads860 : Routines

sysProcNumSet( )

NAME

sysProcNumSet( ) - set the processor number

SYNOPSIS

void sysProcNumSet
    (
    int procNum               /* processor number */
    )

DESCRIPTION

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.

RETURNS

N/A

SEE ALSO

sysLib, sysProcNumGet( )


ads860 : Routines

sysLocalToBusAdrs( )

NAME

sysLocalToBusAdrs( ) - convert a local address to a bus address

SYNOPSIS

STATUS sysLocalToBusAdrs
    (
    int      adrsSpace,       /* bus address space where busAdrs resides */
    char *   localAdrs,       /* local address to convert */
    char * * pBusAdrs         /* where to return bus address */
    )

DESCRIPTION

This routine gets the VMEbus address that accesses a specified local memory address.

Not applicable for the 860Ads

RETURNS

ERROR, always.

SEE ALSO

sysLib, sysBusToLocalAdrs( )


ads860 : Routines

sysBusToLocalAdrs( )

NAME

sysBusToLocalAdrs( ) - convert a bus address to a local address

SYNOPSIS

STATUS sysBusToLocalAdrs
    (
    int      adrsSpace,       /* bus address space where busAdrs resides */
    char *   busAdrs,         /* bus address to convert */
    char * * pLocalAdrs       /* where to return local address */
    )

DESCRIPTION

This routine gets the local address that accesses a specified VMEbus physical memory address.

Not applicable for the 860Ads

RETURNS

ERROR, always.

SEE ALSO

sysLib, sysLocalToBusAdrs( )


ads860 : Routines

sysBusTas( )

NAME

sysBusTas( ) - test and set a location across the bus

SYNOPSIS

BOOL sysBusTas
    (
    char * adrs               /* address to be tested-and-set */
    )

DESCRIPTION

This routine does an atomic test-and-set operation across the backplane.

Not applicable for the 860Ads.

RETURNS

FALSE, always.

SEE ALSO

sysLib, vxTas( )


ads860 : Routines

sysBusClearTas( )

NAME

sysBusClearTas( ) - test and clear

SYNOPSIS

void sysBusClearTas
    (
    volatile char * address   /* address to be tested-and-cleared */
    )

DESCRIPTION

This routine is a null function.

RETURNS

N/A

SEE ALSO

sysLib


ads860 : Routines

sysCpmEnetDisable( )

NAME

sysCpmEnetDisable( ) - disable the Ethernet controller

SYNOPSIS

void sysCpmEnetDisable
    (
    int unit                  /* not used - only slave SCC1 is wired to port */
    )

DESCRIPTION

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.

RETURNS

N/A

SEE ALSO

sysLib


ads860 : Routines

sysCpmEnetIntDisable( )

NAME

sysCpmEnetIntDisable( ) - disable the Ethernet interface interrupt

SYNOPSIS

void sysCpmEnetIntDisable
    (
    int unit
    )

DESCRIPTION

This routine disable the interrupt for the Ethernet interface specified by unit.

RETURNS

N/A.

SEE ALSO

sysLib


ads860 : Routines

sysCpmEnetEnable( )

NAME

sysCpmEnetEnable( ) - enable the Ethernet controller

SYNOPSIS

STATUS sysCpmEnetEnable
    (
    int unit                  /* not used - only slave SCC1 is wired to port */
    )

DESCRIPTION

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.

RETURNS

OK, or ERROR if the Ethernet controller cannot be enabled.

SEE ALSO

sysLib


ads860 : Routines

sysCpmEnetAddrGet( )

NAME

sysCpmEnetAddrGet( ) - get the hardware Ethernet address

SYNOPSIS

STATUS sysCpmEnetAddrGet
    (
    int     unit,             /* not used - only slave SCC1 is wired to port */
    UINT8 * addr
    )

DESCRIPTION

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.

RETURNS

OK, or ERROR if the Ethernet address cannot be returned.

SEE ALSO

sysLib


ads860 : Routines

sysCpmEnetCommand( )

NAME

sysCpmEnetCommand( ) - issue a command to the Ethernet interface controller

SYNOPSIS

STATUS sysCpmEnetCommand
    (
    int    unit,
    UINT16 command
    )

DESCRIPTION

RETURNS

OK, or ERROR if the Ethernet controller could not be restarted.

SEE ALSO

sysLib


ads860 : Routines

sysCpmEnetIntEnable( )

NAME

sysCpmEnetIntEnable( ) - enable the Ethernet interface interrupt

SYNOPSIS

void sysCpmEnetIntEnable
    (
    int unit
    )

DESCRIPTION

This routine enable the interrupt for the Ethernet interface specified by unit.

RETURNS

N/A.

SEE ALSO

sysLib


ads860 : Routines

sysCpmEnetIntClear( )

NAME

sysCpmEnetIntClear( ) - clear the Ethernet interface interrupt

SYNOPSIS

void sysCpmEnetIntClear
    (
    int unit
    )

DESCRIPTION

This routine clears the interrupt for the Ethernet interface specified by unit.

RETURNS

N/A.

SEE ALSO

sysLib