VxWorks BSP Reference : evb403

sysLib [evb403]

NAME

sysLib [evb403] - IBM 403 EVB system-dependent routines

ROUTINES

sysFlashGet( ) - get the contents of flash memory
sysFlashDelay( ) - create a delay for a specified number of microseconds
sysFlashDataPoll( ) - wait for a flash device operation to complete
sysSectorErase( ) - erase the contents of a sector
sysFlashErase( ) - erase the contents of flash memory
sysFlashWrite( ) - write data to flash memory
sysFlashTypeGet( ) - determine the device type of on-board flash memory
sysFlashSet( ) - write to flash memory
sysNvRamGet( ) - get the contents of non-volatile RAM
sysNvRamSet( ) - write to non-volatile RAM
sysLocalToBusAdrs( ) - convert a local address to a bus address
sysBusToLocalAdrs( ) - convert a bus address to a local address
sysBusIntAck( ) - acknowledge a bus interrupt
sysBusIntGen( ) - generate a bus interrupt
sysMailboxConnect( ) - connect a routine to the mailbox interrupt
sysMailboxEnable( ) - enable the mailbox interrupt
sysBusTas( ) - test and set a location across the bus
sysPpc403IntrInit( ) - initialize the PPC403GA interrupt facility
sysPpc403IntHandler( ) - PPC403GA external interrupt handler
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
sysAuxClkConnect( ) - connect a routine to the auxiliary clock interrupt
sysAuxClkEnable( ) - turn on auxiliary clock interrupts
sysAuxClkDisable( ) - turn off auxiliary clock interrupts
sysAuxClkRateGet( ) - get the auxiliary clock rate
sysAuxClkRateSet( ) - set the auxiliary clock rate
sysWdtConnect( ) - connect a routine to the watchdog interrupt
sysWdtEnable( ) - turn on watchdog interrupts
sysWdtDisable( ) - turn off watchdog interrupts
sysWdtRateGet( ) - get the watchdog timer rate
sysWdtRateSet( ) - set the watchdog timer rate
sysTimestampConnect( ) - connect a user routine to a timestamp timer interrupt
sysTimestampEnable( ) - initialize and enable a timestamp timer
sysTimestampDisable( ) - disable a timestamp timer
sysTimestampPeriod( ) - get a timestamp timer period
sysTimestampFreq( ) - get a timestamp timer clock frequency
sysTimestamp( ) - get a timestamp timer tick count
sysTimestampLock( ) - lock an interrupt and get a timestamp timer tick count
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
sysModel( ) - return the model name of the CPU board
sysBspRev( ) - return the BSP version and revision number
sysHwInit( ) - initialize the system hardware
sysHwInit2( ) - initialize additional 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
sysProcNumGet( ) - get the processor number
sysProcNumSet( ) - set the processor number
sysEnetAddrGet( ) - get the hardware Ethernet address
sysIntLockLevelSet( ) - set the current interrupt lock-out level
sysLanIntEnable( ) - enable the LAN interrupt
sysLanIntDisable( ) - disable the LAN interrupt
sysInByte( ) - read one byte from an I/O address
sysOutByte( ) - write one byte to an I/O address

DESCRIPTION

This library provides board-specific routines. The chip drivers included are:

    ppc403Sio.c - PPC403GA embedded serial controller library (S1)
    evbNs16550Sio.c - National Semiconductor 16550 UART library (S2)
    ppc403Timer.c - on-chip timer library
    flashMem.c - generic flash memory library
    nvRamToFlash.c - non-volatile RAM-to-flash memory library
    ppc403Intr.c - on-chip programmable interrupt controller library
    if_nicEvb - NS 83902A ST-NIC chip network interface library (nicEvb)

INCLUDE FILES

sysLib.h

SEE ALSO

VxWorks Programmer's Guide: Configuration


evb403 : Routines

sysFlashGet( )

NAME

sysFlashGet( ) - get the contents of flash memory

SYNOPSIS

STATUS sysFlashGet
    (
    char * string,            /* where to copy flash memory */
    int    strLen,            /* maximum number of bytes to copy */
    int    offset             /* byte offset into flash memory */
    )

DESCRIPTION

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

RETURNS

OK, or ERROR if access is outside the flash memory range.

SEE ALSO

sysLib, sysFlashSet( )


evb403 : Routines

sysFlashDelay( )

NAME

sysFlashDelay( ) - create a delay for a specified number of microseconds

SYNOPSIS

void sysFlashDelay
    (
    int delayCount            /* number of uSec to delay */
    )

DESCRIPTION

This routine implements a busy wait for a specified number of microseconds. The timing loop can be adjusted on a board-dependent basis by defining values for the following macros:

The values SYS_FLASH_DELAY_SHIFT and SYS_FLASH_DELAY_ADJ convert microseconds into a board-dependent tick-count. This routine can call a user-defined hook, sysFlashBoardDelay( ), which creates a delay for a number of board-dependent ticks as specified by SYS_FLASH_DELAY_INCR. To use sysFlashBoardDelay( ), define SYS_FLASH_BOARD_DELAY in config.h.

RETURNS

N/A

SEE ALSO

sysLib, sysFlashErase( ), sysFlashWrite( )


evb403 : Routines

sysFlashDataPoll( )

NAME

sysFlashDataPoll( ) - wait for a flash device operation to complete

SYNOPSIS

STATUS sysFlashDataPoll
    (
    volatile UINT8 * pFA,     /* programmed address to poll */
    UINT8            value    /* data programmed to poll address */
    )

DESCRIPTION

This routine polls a specified address on a 29Fxxx flash device until the device operation at that location completes or times out.

While a flash operation is in progress, a read on the device returns on Q7 (data bit 7) the complement of the previous value of Q7. Once the flash operation has completed, the Q7 bit returns the true data of the last write. Subsequent reads return the correct data in Q0-7.

The Q5 bit implements a timeout functionality. When a currently executing flash operation exceeds specified limits, the Q5 bit is set (to 1).

RETURNS

OK, or ERROR if the timeout (!Q5) occurs before the device operation completes.

SEE ALSO

sysLib, sysFlashErase( ), sysFlashWrite( )


evb403 : Routines

sysSectorErase( )

NAME

sysSectorErase( ) - erase the contents of a sector

SYNOPSIS

STATUS sysSectorErase
    (
    UINT8 * pFA,              /* Sector start address */
    UINT8   flashType         /* type of flash memory on-board */
    )

DESCRIPTION

This routine clears the contents of one sector in the flash memory.

Flash 29Fxxx devices are erased by writing the six-byte erase code into specific address locations, which sets all byte locations to a high value (0xFF).

RETURNS

OK, or ERROR if the contents of sector cannot be erased.

SEE ALSO

sysLib


evb403 : Routines

sysFlashErase( )

NAME

sysFlashErase( ) - erase the contents of flash memory

SYNOPSIS

STATUS sysFlashErase
    (
    UINT8 flashType           /* type of flash memory on-board */
    )

DESCRIPTION

This routine clears the contents of flash memory.

Flash 28Fxxx devices are erased by writing a flash erase command to the device and verifying that each flash location is set to a high value (0xFF).

Flash 29Fxxx devices are erased by writing the six-byte erase code into specific address locations, which sets all byte locations to a high value (0xFF).

RETURNS

OK, or ERROR if the contents of flash memory cannot be erased.

SEE ALSO

sysLib


evb403 : Routines

sysFlashWrite( )

NAME

sysFlashWrite( ) - write data to flash memory

SYNOPSIS

STATUS sysFlashWrite
    (
    UINT8 * pFB,              /* string to be copied; use value if NULL */
    int     size,             /* size to program in bytes */
    int     offset,           /* byte offset into flash memory */
    UINT8   flashType,        /* type of flash memory on-board */
    UINT8   value             /* value to program */
    )

DESCRIPTION

This routine copies specified data of a specified length, size, into a specified offset, offset, in the flash memory. Data is passed as a string, pFB, if not NULL. If NULL, data is taken as a repeated sequence of value. The parameter flashType should be set to the flash device code. The parameter offset must be appropriately aligned for the width of the Flash devices in use.

Flash 28Fxxx devices are programmed by a sequence of operations:

Flash 29Fxxx devices are programmed by a sequence of operations:

RETURNS

OK, or ERROR if the write operation fails.

SEE ALSO

sysLib, sysFlashSet( )


evb403 : Routines

sysFlashTypeGet( )

NAME

sysFlashTypeGet( ) - determine the device type of on-board flash memory

SYNOPSIS

UINT8 sysFlashTypeGet (void)

DESCRIPTION

This routine uses the autoselect command to determine the device type of on-board flash memory for flash 29Fxxx devices.

RETURNS

An integer indicating the device type of on-board flash memory.

SEE ALSO

sysLib


evb403 : Routines

sysFlashSet( )

NAME

sysFlashSet( ) - write to flash memory

SYNOPSIS

STATUS sysFlashSet
    (
    char * string,            /* string to be copied into flash memory */
    int    strLen,            /* maximum number of bytes to copy */
    int    offset             /* byte offset into flash memory */
    )

DESCRIPTION

This routine copies a specified string into flash memory after calling sysFlashErase( ) and clearing flash memory.

If FLASH_NO_OVERLAY is defined, the parameter offset must be appropriately aligned for the Flash devices in use (device width, sector size etc.).

If the specified string must be overlaid on the contents of flash memory, undefine FLASH_NO_OVERLAY.

RETURNS

OK, or ERROR if the write fails or the input parameters are out of range.

SEE ALSO

sysLib, sysFlashErase( ), sysFlashGet( ), sysFlashTypeGet( ), sysFlashWrite( )


evb403 : 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 calls sysFlashGet( ) to copy the contents of flash memory into a specified string. The string is terminated with an EOS.

NOTE

This routine uses flash memory, since there is no NVRAM on the IBM 403 EVB.

RETURNS

The return value of sysFlashGet( ).

SEE ALSO

sysLib, sysNvRamSet( ), sysFlashGet( )


evb403 : 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 calls sysFlashSet( ) to copy a specified string into flash memory.

NOTE

This routine uses flash memory, since there is no NVRAM on the IBM 403 EVB.

RETURNS

The return value of sysFlashSet( ).

SEE ALSO

sysLib, sysNvRamGet( ), sysFlashSet( )


evb403 : Routines

sysLocalToBusAdrs( )

NAME

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

SYNOPSIS

STATUS sysLocalToBusAdrs
    (
    int    adrsSpace,         /* bus address space in which busAdrs */
                              /* resides, use address modifier codes defined */
                              /* in vme.h, such as VME_AM_STD_SUP_DATA */ 
    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.

NOTE

This routine has no effect, since there is no VMEbus.

RETURNS

ERROR, always.

SEE ALSO

sysLib, sysBusToLocalAdrs( )


evb403 : Routines

sysBusToLocalAdrs( )

NAME

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

SYNOPSIS

STATUS sysBusToLocalAdrs
    (
    int    adrsSpace,         /* bus address space in which busAdrs */
                              /* resides, use address modifier codes defined */
                              /* in vme.h, such as VME_AM_STD_SUP_DATA */ 
    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 address.

NOTE

This routine has no effect, since there is no VMEbus.

RETURNS

ERROR, always.

SEE ALSO

sysLib, sysLocalToBusAdrs( )


evb403 : Routines

sysBusIntAck( )

NAME

sysBusIntAck( ) - acknowledge a bus interrupt

SYNOPSIS

int sysBusIntAck
    (
    int intLevel              /* interrupt level to acknowledge */
    )

DESCRIPTION

This routine acknowledges a specified VMEbus interrupt level.

NOTE

This routine has no effect, since there is no VMEbus.

RETURNS

NULL.

SEE ALSO

sysLib


evb403 : Routines

sysBusIntGen( )

NAME

sysBusIntGen( ) - generate a bus interrupt

SYNOPSIS

STATUS sysBusIntGen
    (
    int level,                /* bus interrupt level to generate */
    int vector                /* interrupt vector to return (0-255) */
    )

DESCRIPTION

This routine generates a VMEbus interrupt for a specified level with a specified vector.

NOTE

This routine has no effect, since there is no VMEbus.

RETURNS

ERROR, always.

SEE ALSO

sysLib


evb403 : Routines

sysMailboxConnect( )

NAME

sysMailboxConnect( ) - connect a routine to the mailbox interrupt

SYNOPSIS

STATUS sysMailboxConnect
    (
    FUNCPTR routine,          /* routine called at each mailbox interrupt */
    int     arg               /* argument with which to call routine */
    )

DESCRIPTION

This routine specifies the interrupt service routine to be called at each mailbox interrupt.

NOTE

This routine has no effect, since the hardware does not support mailbox interrupts.

RETURNS

ERROR, always.

SEE ALSO

sysLib, sysMailboxEnable( )


evb403 : Routines

sysMailboxEnable( )

NAME

sysMailboxEnable( ) - enable the mailbox interrupt

SYNOPSIS

STATUS sysMailboxEnable
    (
    INT8 * mailboxAdrs        /* mailbox address */
    )

DESCRIPTION

This routine enables the mailbox interrupt.

NOTE

This routine has no effect, since the hardware does not support mailbox interrupts.

RETURNS

ERROR, always.

SEE ALSO

sysLib, sysMailboxConnect( )


evb403 : Routines

sysBusTas( )

NAME

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

SYNOPSIS

BOOL sysBusTas
    (
    INT8 * addr               /* address to be tested and set */
    )

DESCRIPTION

This routine performs a test-and-set (TAS) instruction across the backplane.

NOTE

This routine is equivalent to vxTas( ), since there is no VMEbus.

RETURNS

TRUE if the value had not been set but is now, or FALSE if the value was set already.

SEE ALSO

sysLib, vxTas( )


evb403 : Routines

sysPpc403IntrInit( )

NAME

sysPpc403IntrInit( ) - initialize the PPC403GA interrupt facility

SYNOPSIS

STATUS sysPpc403IntrInit (void)

DESCRIPTION

This routine initializes the interrupt facility for the PPC403GA Embedded Controller.

RETURNS

OK, always.

SEE ALSO

sysLib


evb403 : Routines

sysPpc403IntHandler( )

NAME

sysPpc403IntHandler( ) - PPC403GA external interrupt handler

SYNOPSIS

void sysPpc403IntHandler (void)

DESCRIPTION

This is the external interrupt handler for the PPC403GA Embedded Controller. In case of DMA interrupts, the DMA Status register is always passed to the ISR, that was connected to the DMA interrupt via intConnect( ), as an argument.

RETURNS

N/A

SEE ALSO

sysLib


evb403 : Routines

sysClkConnect( )

NAME

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

SYNOPSIS

STATUS sysClkConnect
    (
    FUNCPTR routine,          /* routine to connect */
    int     arg               /* argument with which to call 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. It also connects the clock error interrupt service routine.

RETURNS

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

SEE ALSO

sysLib, usrClock( ), sysClkEnable( )


evb403 : 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( )


evb403 : 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( )


evb403 : 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( )


evb403 : 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 does not enable system clock interrupts. 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( )


evb403 : Routines

sysAuxClkConnect( )

NAME

sysAuxClkConnect( ) - connect a routine to the auxiliary clock interrupt

SYNOPSIS

STATUS sysAuxClkConnect
    (
    FUNCPTR routine,          /* routine called at each aux. clock interrupt */
    int     arg               /* argument to auxiliary clock interrupt */
    )

DESCRIPTION

This routine specifies the interrupt service routine to be called at each auxiliary clock interrupt. It does not enable auxiliary clock interrupts.

RETURNS

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

SEE ALSO

sysLib, excIntConnectTimer( ), sysAuxClkEnable( )


evb403 : Routines

sysAuxClkEnable( )

NAME

sysAuxClkEnable( ) - turn on auxiliary clock interrupts

SYNOPSIS

void sysAuxClkEnable (void)

DESCRIPTION

This routine enables auxiliary clock interrupts.

RETURNS

N/A

SEE ALSO

sysLib, sysAuxClkConnect( ), sysAuxClkDisable( ), sysAuxClkRateSet( )


evb403 : Routines

sysAuxClkDisable( )

NAME

sysAuxClkDisable( ) - turn off auxiliary clock interrupts

SYNOPSIS

void sysAuxClkDisable (void)

DESCRIPTION

This routine disables auxiliary clock interrupts.

RETURNS

N/A

SEE ALSO

sysLib, sysAuxClkEnable( )


evb403 : Routines

sysAuxClkRateGet( )

NAME

sysAuxClkRateGet( ) - get the auxiliary clock rate

SYNOPSIS

int sysAuxClkRateGet (void)

DESCRIPTION

This routine returns the interrupt rate of the auxiliary clock.

RETURNS

The number of ticks per second of the auxiliary clock.

SEE ALSO

sysLib, sysAuxClkEnable( ), sysAuxClkRateSet( )


evb403 : Routines

sysAuxClkRateSet( )

NAME

sysAuxClkRateSet( ) - set the auxiliary clock rate

SYNOPSIS

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

DESCRIPTION

This routine sets the interrupt rate of the auxiliary clock. It does not enable auxiliary clock interrupts.

RETURNS

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

SEE ALSO

sysLib, sysAuxClkEnable( ), sysAuxClkRateGet( )


evb403 : Routines

sysWdtConnect( )

NAME

sysWdtConnect( ) - connect a routine to the watchdog interrupt

SYNOPSIS

STATUS sysWdtConnect
    (
    FUNCPTR routine,          /* routine called at each watchdog interrupt */
    int     arg               /* argument with which to call routine */
    )

DESCRIPTION

This routine specifies the interrupt service routine to be called at each watchdog interrupt. It does not enable watchdog interrupts.

RETURNS

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

SEE ALSO

sysLib, excIntCrtConnect( ), sysWdtEnable( )


evb403 : Routines

sysWdtEnable( )

NAME

sysWdtEnable( ) - turn on watchdog interrupts

SYNOPSIS

void sysWdtEnable (void)

DESCRIPTION

This routine enables watchdog interrupts.

RETURNS

N/A

SEE ALSO

sysLib, sysWdtConnect( ), sysWdtDisable( ), sysWdtRateSet( )


evb403 : Routines

sysWdtDisable( )

NAME

sysWdtDisable( ) - turn off watchdog interrupts

SYNOPSIS

void sysWdtDisable (void)

DESCRIPTION

This routine disables watchdog interrupts. This routine does not disable critical interrupts.

RETURNS

N/A

SEE ALSO

sysLib, sysWdtEnable( )


evb403 : Routines

sysWdtRateGet( )

NAME

sysWdtRateGet( ) - get the watchdog timer rate

SYNOPSIS

int sysWdtRateGet (void)

DESCRIPTION

This routine returns the interrupt rate of the watchdog timer.

RETURNS

The number of watchdog interrupts per second.

SEE ALSO

sysLib, sysWdtEnable( ), sysWdtRateSet( )


evb403 : Routines

sysWdtRateSet( )

NAME

sysWdtRateSet( ) - set the watchdog timer rate

SYNOPSIS

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

DESCRIPTION

This routine sets the interrupt rate of the watchdog timer. It does not enable watchdog interrupts.

RETURNS

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

SEE ALSO

sysLib, sysWdtEnable( ), sysWdtRateGet( )


evb403 : Routines

sysTimestampConnect( )

NAME

sysTimestampConnect( ) - connect a user routine to a timestamp timer interrupt

SYNOPSIS

STATUS sysTimestampConnect
    (
    FUNCPTR routine,          /* routine called at each timestamp timer */
                              /* interrupt */ 
    int     arg               /* argument with which to call routine */
    )

DESCRIPTION

This routine specifies the user interrupt routine to be called at each timestamp timer interrupt. In this case, however, the timestamp timer interrupt is not used since the on-chip timer is also used by the system clock.

RETURNS

OK, or ERROR if sysTimestampInt( ) interrupt handler is not used.

SEE ALSO

sysLib


evb403 : Routines

sysTimestampEnable( )

NAME

sysTimestampEnable( ) - initialize and enable a timestamp timer

SYNOPSIS

STATUS sysTimestampEnable (void)

DESCRIPTION

This routine disables the timestamp timer interrupt and initializes the counter registers. If the timestamp timer is already running, this routine merely resets the timer counter.

This routine does not intialize the timer rate. The rate of the timestamp timer should be set explicitly in the BSP by sysHwInit( ).

RETURNS

OK, or ERROR if the timestamp timer cannot be enabled.

SEE ALSO

sysLib


evb403 : Routines

sysTimestampDisable( )

NAME

sysTimestampDisable( ) - disable a timestamp timer

SYNOPSIS

STATUS sysTimestampDisable (void)

DESCRIPTION

This routine disables the timestamp timer. Interrupts are not disabled; however, because the tick counter does not increment after the timestamp timer is disabled, interrupts no longer are generated.

RETURNS

OK, or ERROR if the timestamp timer cannot be disabled.

SEE ALSO

sysLib


evb403 : Routines

sysTimestampPeriod( )

NAME

sysTimestampPeriod( ) - get a timestamp timer period

SYNOPSIS

UINT32 sysTimestampPeriod (void)

DESCRIPTION

This routine specifies the period of the timestamp timer, in ticks. The period, or terminal count, is the number of ticks to which the timestamp timer counts before rolling over and restarting the counting process.

RETURNS

The period of the timestamp timer in counter ticks.

SEE ALSO

sysLib


evb403 : Routines

sysTimestampFreq( )

NAME

sysTimestampFreq( ) - get a timestamp timer clock frequency

SYNOPSIS

UINT32 sysTimestampFreq (void)

DESCRIPTION

This routine specifies the frequency of the timer clock, in ticks per second. The rate of the timestamp timer should be set explicitly in the BSP by sysHwInit( ).

RETURNS

The timestamp timer clock frequency, in ticks per second.

SEE ALSO

sysLib


evb403 : Routines

sysTimestamp( )

NAME

sysTimestamp( ) - get a timestamp timer tick count

SYNOPSIS

UINT32 sysTimestamp (void)

DESCRIPTION

This routine returns the current value of the timestamp timer tick counter. The tick count can be converted to seconds by dividing by the return of sysTimestampFreq( ).

This routine should be called with interrupts locked. If interrupts are not locked, sysTimestampLock( ) should be used instead.

RETURNS

The current timestamp timer tick count.

SEE ALSO

sysLib, sysTimestampFreq( ), sysTimestampLock( )


evb403 : Routines

sysTimestampLock( )

NAME

sysTimestampLock( ) - lock an interrupt and get a timestamp timer tick count

SYNOPSIS

UINT32 sysTimestampLock (void)

DESCRIPTION

This routine locks interrupts when stop the tick counter must be stopped in order to read it or when two independent counters must be read. It then returns the current value of the timestamp timer tick counter.

The tick count can be converted to seconds by dividing by the return of sysTimestampFreq( ).

If interrupts are already locked, sysTimestamp( ) should be used instead.

RETURNS

The current timestamp timer tick count.

SEE ALSO

sysLib, sysTimestamp( )


evb403 : Routines

sysSerialHwInit( )

NAME

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

SYNOPSIS

void sysSerialHwInit (void)

DESCRIPTION

This routine initializes the BSP serial device descriptors and puts the devices in a quiescent state. It is called from sysHwInit( ) with interrupts locked.

RETURNS

N/A

SEE ALSO

sysLib, sysHwInit( )


evb403 : 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 cannot be connected in sysSerialHwInit( ) because the kernel memory allocator is not initialized at that point, and intConnect( ) calls malloc( ).

RETURNS

N/A

SEE ALSO

sysLib, sysHwInit2( )


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

RETURNS

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

SEE ALSO

sysLib


evb403 : 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 "IBM EVB403 - PowerPC 403XX". Where XX is either GA, GC, or GCX.

SEE ALSO

sysLib


evb403 : Routines

sysBspRev( )

NAME

sysBspRev( ) - return the BSP version and revision number

SYNOPSIS

char * sysBspRev (void)

DESCRIPTION

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.

RETURNS

A pointer to the BSP version/revision string.

SEE ALSO

sysLib


evb403 : Routines

sysHwInit( )

NAME

sysHwInit( ) - initialize the system hardware

SYNOPSIS

void sysHwInit (void)

DESCRIPTION

This routine initializes various features of the IBM 403 EVB board. This routine clears and turns off the external interrupts. It is called from usrInit( ) in usrConfig.c.

NOTE

This routine should not be called directly by the user application.

RETURNS

N/A

SEE ALSO

sysLib


evb403 : Routines

sysHwInit2( )

NAME

sysHwInit2( ) - initialize additional system hardware

SYNOPSIS

void sysHwInit2 (void)

DESCRIPTION

This routine connects system interrupts and configures any required features not configured by sysHwInit( ).

RETURNS

N/A

SEE ALSO

sysLib


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

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.

NOTE

Do not adjust LOCAL_MEM_SIZE to reserve memory for application use. See sysMemTop( ) for more information on reserving memory.

RETURNS

The address of the top of physical memory.

SEE ALSO

sysLib, sysMemTop( )


evb403 : 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


evb403 : 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 by bus errors at interrupt level. However, in special circumstances, the user may wish to introduce a startType to enable special boot ROM facilities.

RETURNS

Does not return.

SEE ALSO

sysLib


evb403 : 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, always 0 (zero).

SEE ALSO

sysLib, sysProcNumSet( )


evb403 : Routines

sysProcNumSet( )

NAME

sysProcNumSet( ) - set the processor number

SYNOPSIS

void sysProcNumSet
    (
    int procNum               /* processor number (ignored 403 EVB) */
    )

DESCRIPTION

This routine sets the processor number for the CPU board. Processor numbers should be unique on a single backplane.

NOTE

This routine has no effect, since there is no VMEbus.

RETURNS

N/A

SEE ALSO

sysLib, sysProcNumGet( ),


evb403 : Routines

sysEnetAddrGet( )

NAME

sysEnetAddrGet( ) - get the hardware Ethernet address

SYNOPSIS

STATUS sysEnetAddrGet
    (
    int     unit,
    UINT8 * addr
    )

DESCRIPTION

This routine determines the unique Ethernet address for the CPU board and copies it to addr, such that the low-order byte is addr[0] and the high-order byte is addr[5]. The memory area pointed to by addr is six bytes.

RETURNS

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

SEE ALSO

sysLib


evb403 : Routines

sysIntLockLevelSet( )

NAME

sysIntLockLevelSet( ) - set the current interrupt lock-out level

SYNOPSIS

int sysIntLockLevelSet
    (
    int newLvl                /* new interrupt level */
    )

DESCRIPTION

This routine sets the current interrupt lock-out level.

NOTE

This routine has no effect, since the facility is currently not implemented.

RETURNS

ERROR, always.

SEE ALSO

sysLib


evb403 : Routines

sysLanIntEnable( )

NAME

sysLanIntEnable( ) - enable the LAN interrupt

SYNOPSIS

STATUS sysLanIntEnable
    (
    int intLevel              /* interrupt level to enable */
    )

DESCRIPTION

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.

RETURNS

OK, or ERROR if network support not included.

SEE ALSO

sysLib, sysLanIntDisable( )


evb403 : Routines

sysLanIntDisable( )

NAME

sysLanIntDisable( ) - disable the LAN interrupt

SYNOPSIS

STATUS sysLanIntDisable
    (
    int intLevel              /* interrupt level to enable */
    )

DESCRIPTION

This routine disables interrupts for the on-board LAN chip.

RETURNS

OK, or ERROR if network support not included.

SEE ALSO

sysLib, sysLanIntEnable( )


evb403 : Routines

sysInByte( )

NAME

sysInByte( ) - read one byte from an I/O address

SYNOPSIS

UCHAR sysInByte
    (
    ULONG address             /* I/O address to read the byte from */
    )

DESCRIPTION

This routine reads a single byte from a specified I/O address.

RETURNS

The byte from the specified address.

SEE ALSO

sysLib


evb403 : Routines

sysOutByte( )

NAME

sysOutByte( ) - write one byte to an I/O address

SYNOPSIS

void sysOutByte
    (
    ULONG address,            /* I/O address to write the byte to */
    UCHAR data                /* byte to write */
    )

DESCRIPTION

This routine writes a single byte to a specified I/O address.

RETURNS

N/A

SEE ALSO

sysLib