BSP Reference : mv2304

sysLib [mv2304]

NAME

sysLib [mv2304] - Motorola MVME2600 board series system-dependent library

ROUTINES

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)

DESCRIPTION

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 library

    sl82565IntrCtl.c - interrupt controller driver
         or
    ravenMpic.c - raven Mpic / W83C553 PIB/IBC Interrupt Controller

INCLUDE FILES

sysLib.h

SEE ALSO

sysLib, VxWorks Programmer's Guide: Configuration


mv2304 : Routines

pciConfigLibInit( )

NAME

pciConfigLibInit( ) - initialize the configuration access-method and addresses

SYNOPSIS

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

DESCRIPTION

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.

RETURNS

OK, or ERROR if a mechanism is not 0, 1, or 2.

SEE ALSO

sysLib


mv2304 : Routines

pciFindDevice( )

NAME

pciFindDevice( ) - find the nth device with the given device & vendor ID

SYNOPSIS

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

DESCRIPTION

This routine finds the nth device with the given device & vendor ID.

RETURNS

OK, or ERROR if the deviceId and vendorId didn't match.

SEE ALSO

sysLib


mv2304 : Routines

pciFindClass( )

NAME

pciFindClass( ) - find the nth occurence of a device by PCI class code.

SYNOPSIS

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

DESCRIPTION

This routine finds the nth device with the given 24-bit PCI class code (class subclass prog_if).

RETURNS

OK, or ERROR if the class didn't match.

SEE ALSO

sysLib


mv2304 : Routines

pciDevConfig( )

NAME

pciDevConfig( ) - configure a device on a PCI bus

SYNOPSIS

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

DESCRIPTION

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.

NOTE

This routine is designed for Type 0 PCI Configuration Headers ONLY. It is NOT usable for configuring, for example, a PCI-to-PCI bridge.

RETURNS

OK always.

SEE ALSO

sysLib


mv2304 : Routines

pciConfigBdfPack( )

NAME

pciConfigBdfPack( ) - pack parameters for the Configuration Address Register

SYNOPSIS

int pciConfigBdfPack
    (
    int busNo,    /* bus number */
    int deviceNo, /* device number */
    int funcNo    /* function number */
    )

DESCRIPTION

This routine packs three parameters into one integer for accessing the Configuration Address Register

RETURNS

packed integer encoded version of bus, device, and function numbers.

SEE ALSO

sysLib


mv2304 : Routines

pciConfigInByte( )

NAME

pciConfigInByte( ) - read one byte from the PCI configuration space

SYNOPSIS

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

DESCRIPTION

This routine reads one byte from the PCI configuration space

RETURNS

OK, or ERROR if this library is not initialized

SEE ALSO

sysLib


mv2304 : Routines

pciConfigInWord( )

NAME

pciConfigInWord( ) - read one word from the PCI configuration space

SYNOPSIS

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

DESCRIPTION

This routine reads one word from the PCI configuration space

RETURNS

OK, or ERROR if this library is not initialized

SEE ALSO

sysLib


mv2304 : Routines

pciConfigInLong( )

NAME

pciConfigInLong( ) - read one longword from the PCI configuration space

SYNOPSIS

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

DESCRIPTION

This routine reads one longword from the PCI configuration space

RETURNS

OK, or ERROR if this library is not initialized

SEE ALSO

sysLib


mv2304 : Routines

pciConfigOutByte( )

NAME

pciConfigOutByte( ) - write one byte to the PCI configuration space

SYNOPSIS

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

DESCRIPTION

This routine writes one byte to the PCI configuration space.

RETURNS

OK, or ERROR if this library is not initialized

SEE ALSO

sysLib


mv2304 : Routines

pciConfigOutWord( )

NAME

pciConfigOutWord( ) - write one 16-bit word to the PCI configuration space

SYNOPSIS

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

DESCRIPTION

This routine writes one 16-bit word to the PCI configuration space.

RETURNS

OK, or ERROR if this library is not initialized

SEE ALSO

sysLib


mv2304 : Routines

pciConfigOutLong( )

NAME

pciConfigOutLong( ) - write one longword to the PCI configuration space

SYNOPSIS

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

DESCRIPTION

This routine writes one longword to the PCI configuration space.

RETURNS

OK, or ERROR if this library is not initialized

SEE ALSO

sysLib


mv2304 : Routines

pciConfigModifyLong( )

NAME

pciConfigModifyLong( ) - Perform a masked longword register update

SYNOPSIS

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

DESCRIPTION

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.

RETURNS

OK if operation succeeds, ERROR if operation fails.

SEE ALSO

sysLib


mv2304 : Routines

pciConfigModifyWord( )

NAME

pciConfigModifyWord( ) - Perform a masked longword register update

SYNOPSIS

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

DESCRIPTION

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.

RETURNS

OK if operation succeeds. ERROR if operation fails.

SEE ALSO

sysLib


mv2304 : Routines

pciConfigModifyByte( )

NAME

pciConfigModifyByte( ) - Perform a masked longword register update

SYNOPSIS

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

DESCRIPTION

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.

RETURNS

OK if operation succeeds, ERROR if operation fails.

SEE ALSO

sysLib


mv2304 : Routines

pciSpecialCycle( )

NAME

pciSpecialCycle( ) - generate a special cycle with a message

SYNOPSIS

STATUS pciSpecialCycle
    (
    int    busNo,  /* bus number */
    UINT32 message /* data driven onto AD[31:0] */
    )

DESCRIPTION

This routine generates a special cycle with a message.

RETURNS

OK, or ERROR if this library is not initialized

SEE ALSO

sysLib


mv2304 : 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. Polled mode serial operations are possible, but not interrupt mode operations which are enabled by sysSerialHwInit2( ).

RETURNS

N/A

SEE ALSO

sysLib, sysHwInit( ), sysSerialHwInit2( )


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


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


mv2304 : Routines

sysSerialReset( )

NAME

sysSerialReset( ) - reset all serial devices to a quiescent state

SYNOPSIS


void sysSerialReset (void)

DESCRIPTION

This routine resets all serial devices to a quiescent state. It is called by sysToMonitor( ).

RETURNS

N/A

SEE ALSO

sysLib, sysToMonitor( )


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

RETURNS

OK, or ERROR if access is outside the non-volatile RAM range.

SEE ALSO

sysLib, sysNvRamSet( )


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

RETURNS

OK, or ERROR if access is outside the non-volatile RAM range.

SEE ALSO

sysLib, sysNvRamGet( )


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


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


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


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


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


mv2304 : Routines

sysScsiInit( )

NAME

sysScsiInit( ) - initialize an on-board SCSI port

SYNOPSIS

 
STATUS sysScsiInit ()

DESCRIPTION

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.

RETURNS

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.

SEE ALSO

sysLib


mv2304 : Routines

inOrderExecute( )

NAME

inOrderExecute( ) - enforce in-order execution of PowerPC accesses

SYNOPSIS


void inOrderExecute ()

DESCRIPTION

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.

RETURNS

N/A.

SEE ALSO

sysLib


mv2304 : Routines

sysScsiConfig( )

NAME

sysScsiConfig( ) - system SCSI configuration

SYNOPSIS


STATUS sysScsiConfig (void)

DESCRIPTION

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.

NOTE

The variable pSbdFloppy is global to allow the above calls to be made from the VxWorks shell, for example:

    -> dosFsMkfs "/fd0/", pSbdFloppy
If a disk is new, use diskFormat( ) to format it.

SEE ALSO

sysLib


mv2304 : Routines

sysScsiInByte( )

NAME

sysScsiInByte( ) - BSP-specific byte input routine

SYNOPSIS

UINT8 sysScsiInByte
    (
    UINT32 adr /* address of where to read byte */
    )

DESCRIPTION

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.

RETURNS

unsigned byte

SEE ALSO

sysLib


mv2304 : Routines

sysScsiOutByte( )

NAME

sysScsiOutByte( ) - BSP-specific byte output routine

SYNOPSIS

void sysScsiOutByte
    (
    UINT32 adr, /* address of where to write byte */
    UINT8  val  /* value of byte to write */
    )

DESCRIPTION

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.

RETURNS

N/A.

SEE ALSO

sysLib


mv2304 : Routines

sysUniverseReset( )

NAME

sysUniverseReset( ) - reset the Universe VME chip

SYNOPSIS


void sysUniverseReset (void)

DESCRIPTION

This routine performs the reseting of the Universe chip. All functions and VME mapping are disabled.

RETURNS

N/A

SEE ALSO

sysLib


mv2304 : Routines

sysUniverseInit( )

NAME

sysUniverseInit( ) - initialize registers of the Universe chip

SYNOPSIS


STATUS sysUniverseInit (void)

DESCRIPTION

This routine initializes registers of the Universe VME-to-PCI bridge and maps access to the VMEbus memory space.

NOTE

The sysProcNumSet( ) routine maps the master node's local memory on the VMEbus.

RETURNS

OK, always.

SEE ALSO

sysLib


mv2304 : Routines

sysIntDisable( )

NAME

sysIntDisable( ) - disable a bus interrupt level

SYNOPSIS

STATUS sysIntDisable
    (
    int intLevel /* interrupt level to disable (1-7) */
    )

DESCRIPTION

This routine disables reception of a specified VMEbus interrupt level.

NOTE

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.

RETURNS

OK, or ERROR if intLevel is not in the range 1 - 7.

SEE ALSO

sysLib, sysIntEnable( )


mv2304 : Routines

sysIntEnable( )

NAME

sysIntEnable( ) - enable a bus interrupt level

SYNOPSIS

STATUS sysIntEnable
    (
    int intLevel /* interrupt level to enable (1-7) */
    )

DESCRIPTION

This routine enables reception of a specified VMEbus interrupt level.

NOTE

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.

RETURNS

OK, or ERROR if intLevel is not in the range 1 - 7.

SEE ALSO

sysLib, sysIntDisable( )


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

RETURNS

NULL.

SEE ALSO

sysLib, sysBusIntGen( )


mv2304 : Routines

sysBusIntGen( )

NAME

sysBusIntGen( ) - generate a bus interrupt

SYNOPSIS

STATUS sysBusIntGen
    (
    int level, /* interrupt level to generate */
    int vector /* interrupt vector for interrupt */
    )

DESCRIPTION

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.

RETURNS

OK, or ERROR if level or vector are out of range or if an interrupt is already in progress.

SEE ALSO

sysLib, sysBusIntAck( )


mv2304 : Routines

sysUnivIntEnable( )

NAME

sysUnivIntEnable( ) - enable Universe-supported interrupt(s)

SYNOPSIS

STATUS sysUnivIntEnable
    (
    int univIntType /* interrupt type */
    )

DESCRIPTION

This routine enables the specified type(s) of interrupt supported by the Universe VME-to-PCI bridge.

RETURNS

OK, or ERROR if invalid interrupt type(s).

SEE ALSO

sysLib, sysUnivIntDisable( )


mv2304 : Routines

sysUnivIntDisable( )

NAME

sysUnivIntDisable( ) - disable Universe-supported interrupt(s)

SYNOPSIS

STATUS sysUnivIntDisable
    (
    int univIntType /* interrupt type */
    )

DESCRIPTION

This routine disables the specified type(s) of interrupt supported by the Universe VME-to-PCI bridge.

RETURNS

OK, or ERROR if invalid interrupt type(s).

SEE ALSO

sysLib, sysUnivIntEnable( )


mv2304 : Routines

sysUnivIntLevelSet( )

NAME

sysUnivIntLevelSet( ) - set a Universe-supported interrupt level

SYNOPSIS

int sysUnivIntLevelSet
    (
    int univIntLvl /* Universe interrupt level */
    )

DESCRIPTION

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_INT
If the level specified is -1, the level is not changed, just the current level is returned.

RETURNS

previous interrupt level.

SEE ALSO

sysLib, sysUnivIntDisable( ), sysUnivIntEnable( )


mv2304 : Routines

sysUnivIntConnect( )

NAME

sysUnivIntConnect( ) - connect an interrupt handler for an interrupt type

SYNOPSIS

STATUS sysUnivIntConnect
    (
    int         univIntType, /* the interrupt type to connect with */
    VOIDFUNCPTR routine,     /* routine to be called */
    int         parameter    /* parameter to be passed to routine */
    )

DESCRIPTION

This routine connects an interrupt handler for a specified interrupt type to the system vector table of the Universe VME-to-PCI bridge.

RETURNS

OK, or ERROR if any argument is invalid or memory cannot be allocated.

SEE ALSO

sysLib


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

The mailbox interrupt is SIG1.

RETURNS

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

SEE ALSO

sysLib, intConnect( ), sysMailboxEnable( )


mv2304 : Routines

sysMailboxEnable( )

NAME

sysMailboxEnable( ) - enable the mailbox interrupt

SYNOPSIS

STATUS sysMailboxEnable
    (
    char * mailboxAdrs /* address of mailbox (ignored) */
    )

DESCRIPTION

This routine enables the mailbox interrupt.

NOTE

The mailbox interrupt is SIG1.

RETURNS

OK, always.

SEE ALSO

sysLib, sysMailboxConnect( ), sysMailboxDisable( )


mv2304 : Routines

sysMailboxDisable( )

NAME

sysMailboxDisable( ) - disable the mailbox interrupt

SYNOPSIS

STATUS sysMailboxDisable
    (
    char * mailboxAdrs /* address of mailbox (ignored) */
    )

DESCRIPTION

This routine disables the mailbox interrupt.

NOTE

The mailbox interrupt is SIG1.

RETURNS

OK, always.

SEE ALSO

sysLib, sysMailboxConnect( ), sysMailboxEnable( )


mv2304 : Routines

sysUnivVERRClr( )

NAME

sysUnivVERRClr( ) - Universe VMEbus Error Clear routine

SYNOPSIS


void sysUnivVERRClr (void)

DESCRIPTION

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.

RETURNS

N/A

SEE ALSO

sysLib


mv2304 : Routines

sysUnivLevelDecode( )

NAME

sysUnivLevelDecode( ) - decode highest pending priority Universe interrupt

SYNOPSIS

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

DESCRIPTION

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.

RETURNS

highest pending interrupt priority level bit mask

SEE ALSO

sysLib, register and bit field defs in universe.h


mv2304 : Routines

sysUnivVmeIntr( )

NAME

sysUnivVmeIntr( ) - Raven VMEbus interrupt handler

SYNOPSIS


void sysUnivVmeIntr (void)

DESCRIPTION

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.

RETURNS

N/A

SEE ALSO

sysLib


mv2304 : Routines

sysBusRmwEnable( )

NAME

sysBusRmwEnable( ) - enable Read-Modify-Write (RMW) cycle on VMEbus

SYNOPSIS

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

DESCRIPTION

NOTE

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.

RETURNS

N/A

SEE ALSO

sysLib


mv2304 : Routines

sysBusRmwDisable( )

NAME

sysBusRmwDisable( ) - Disable Read-Modify-Write (RMW) cycle on the VMEbus.

SYNOPSIS


void sysBusRmwDisable ()

DESCRIPTION

Disable Read-Modify-Write (RMW) cycle on the VMEbus.

RETURNS

N/A

SEE ALSO

sysLib


mv2304 : Routines

sysMpicInit( )

NAME

sysMpicInit( ) - initialize the MPIC in the Raven

SYNOPSIS

STATUS sysMpicInit (void)

DESCRIPTION

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

RETURNS

OK always

SEE ALSO

sysLib


mv2304 : Routines

sysMpicIntHandler( )

NAME

sysMpicIntHandler( ) - handle an interrupt received at the Mpic

SYNOPSIS


void sysMpicIntHandler (void)

DESCRIPTION

This routine will process interrupts received from PCI or ISA devices as these interrupts arrive via the MPIC. This routine supports MPIC interrupt nesting.

RETURNS

N/A

SEE ALSO

sysLib


mv2304 : Routines

sysIbcInit( )

NAME

sysIbcInit( ) - Initialize the IBC

SYNOPSIS


STATUS sysIbcInit (void)

DESCRIPTION

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.

RETURNS

OK always

SEE ALSO

sysLib


mv2304 : Routines

sysIbcIntEnable( )

NAME

sysIbcIntEnable( ) - enable a IBC interrupt level

SYNOPSIS

void sysIbcIntEnable
    (
    int intNum /* interrupt level to enable */
    )

DESCRIPTION

This routine enables a specified IBC interrupt level.

RETURNS

N/A

SEE ALSO

sysLib


mv2304 : Routines

sysIbcIntDisable( )

NAME

sysIbcIntDisable( ) - disable a IBC interrupt level

SYNOPSIS

void sysIbcIntDisable
    (
    int intNum /* interrupt level to disable */
    )

DESCRIPTION

This routine disables a specified IBC interrupt level.

RETURNS

N/A

SEE ALSO

sysLib


mv2304 : Routines

sysIbcIntHandler( )

NAME

sysIbcIntHandler( ) - handler of the sl82565 IBC interrupt.

SYNOPSIS


void sysIbcIntHandler (void)

DESCRIPTION

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.

RETURNS

N/A

SEE ALSO

sysLib


mv2304 : Routines

sysIbcIntLevelSet( )

NAME

sysIbcIntLevelSet( ) - set the interrupt priority level

SYNOPSIS

void sysIbcIntLevelSet
    (
    int intNum /* interrupt level to implement */
    )

DESCRIPTION

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)

RETURNS

N/A

SEE ALSO

sysLib


mv2304 : Routines

sysAuxClkInit( )

NAME

sysAuxClkInit( ) - raven aux. clock initialization routine

SYNOPSIS

 
STATUS sysAuxClkInit (void)

DESCRIPTION

This routine should be called before calling any other routine in this module.

RETURNS

OK, or ERROR.

SEE ALSO

sysLib


mv2304 : 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 with which to call routine */
    )

DESCRIPTION

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

RETURNS

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

SEE ALSO

sysLib, intConnect( ), sysAuxClkEnable( )


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


mv2304 : 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, sysAuxClkDisable( )


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


mv2304 : 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 is not supported, since the auxiliary clock always runs at the same rate as the system clock.

RETURNS

OK or ERROR.

SEE ALSO

sysLib, sysAuxClkEnable( ), sysAuxClkRateGet( )


mv2304 : 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. The returned string depends on the board model and CPU version being used, for example, "Motorola MVME2600 - MPC 604e".

RETURNS

A pointer to the string.

SEE ALSO

sysLib


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


mv2304 : Routines

sysHwInit( )

NAME

sysHwInit( ) - initialize the system hardware

SYNOPSIS


void sysHwInit (void)

DESCRIPTION

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.

NOTE

This routine should not be called directly by the user application. It cannot be used to initialize interrupt vectors.

RETURNS

N/A

SEE ALSO

sysLib


mv2304 : 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 no 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( )


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


mv2304 : 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 some circumstances, the user may wish to introduce a startType to enable special boot ROM facilities.

RETURNS

Does not return.

SEE ALSO

sysLib


mv2304 : Routines

sysHwInit2( )

NAME

sysHwInit2( ) - initialize additional system hardware

SYNOPSIS


void sysHwInit2 (void)

DESCRIPTION

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

RETURNS

N/A

SEE ALSO

sysLib


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


mv2304 : 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. It also maps local resources onto the VMEbus.

RETURNS

N/A

SEE ALSO

sysLib, sysProcNumGet( )


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

RETURNS

OK, or ERROR if the address space is unknown or the mapping is not possible.

SEE ALSO

sysLib, sysBusToLocalAdrs( )


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

RETURNS

OK, or ERROR if the address space is unknown or the mapping is not possible.

SEE ALSO

sysLib, sysLocalToBusAdrs( )


mv2304 : Routines

sysBusTas( )

NAME

sysBusTas( ) - test and set a specified location

SYNOPSIS

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

DESCRIPTION

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

NOTE

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.

RETURNS

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

SEE ALSO

sysLib, vxTas( ), sysBusTasClear( )


mv2304 : Routines

sysBusTasClear( )

NAME

sysBusTasClear( ) - clear a location set by sysBusTas( )

SYNOPSIS

void sysBusTasClear
    (
    volatile char * adrs /* Address of semaphore to be cleared */
    )

DESCRIPTION

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.

RETURNS

N/A

SEE ALSO

sysLib, sysBusTas( )


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


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


mv2304 : Routines

sysNvRead( )

NAME

sysNvRead( ) - read one byte from NVRAM

SYNOPSIS

UCHAR sysNvRead
    (
    ULONG offset /* NVRAM offset to read the byte from */
    )

DESCRIPTION

This routine reads a single byte from a specified offset in NVRAM.

RETURNS

The byte from the specified NVRAM offset.

SEE ALSO

sysLib


mv2304 : Routines

sysNvWrite( )

NAME

sysNvWrite( ) - write one byte to NVRAM

SYNOPSIS

void sysNvWrite
    (
    ULONG offset, /* NVRAM offset to write the byte to */
    UCHAR data    /* datum byte */
    )

DESCRIPTION

This routine writes a single byte to a specified offset in NVRAM. The MVME2600 uses a 48T18 device w/fast write times, no wait.

RETURNS

N/A

SEE ALSO

sysLib


mv2304 : Routines

sysCpuCheck( )

NAME

sysCpuCheck( ) - confirm the CPU type

SYNOPSIS


void sysCpuCheck (void)

DESCRIPTION

This routine validates the cpu type. If the wrong cpu type is discovered a message is printed using the serial channel in polled mode.

RETURNS

N/A.

SEE ALSO

sysLib


mv2304 : Routines

sysRavenErrClr( )

NAME

sysRavenErrClr( ) - Clear error conditions in Raven

SYNOPSIS


void sysRavenErrClr (void)

DESCRIPTION

This routine clears any existing errors in the Motorola Raven PCI Host Bridge Controller.

RETURNS

N/A

SEE ALSO

sysLib


mv2304 : Routines

sysPciExtRavenInit( )

NAME

sysPciExtRavenInit( ) - initialize the extended portion of the Raven PCI header

SYNOPSIS

STATUS sysPciExtRavenInit
    (
    int busNo,    /* bus number */
    int deviceNo, /* device number */
    int funcNo    /* function number */
    )

DESCRIPTION

This routine initializes the extended portion of the PCI header for the Motorola Raven ISA Bridge Controller (IBC).

RETURNS

OK, or ERROR if...

SEE ALSO

sysLib, sysPciExtIbcInit( )


mv2304 : Routines

sysGetBusSpd( )

NAME

sysGetBusSpd( ) - get the speed of the 60x processor bus

SYNOPSIS


int sysGetBusSpd (void)

DESCRIPTION

This routine returns the speed (in MHz) of the 60x system bus.

RETURNS

The bus speed (inMHz).

SEE ALSO

sysLib


mv2304 : Routines

sysDec21x40EnetAddrGet( )

NAME

sysDec21x40EnetAddrGet( ) - retrive ethernet address.

SYNOPSIS

STATUS sysDec21x40EnetAddrGet
    (
    int    unit,
    char * enetAdrs
    )

DESCRIPTION

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.

RETURNS

ERROR, always since this board always has a valid standard ethernet address ROM.

SEE ALSO

sysLib


mv2304 : Routines

sysProbeErrClr( )

NAME

sysProbeErrClr( ) - clear errors associated with probing an address on a bus.

SYNOPSIS


void sysProbeErrClr (void)

DESCRIPTION

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.

RETURNS

N/A

SEE ALSO

sysLib


mv2304 : Routines

sysVmeProbe( )

NAME

sysVmeProbe( ) - probe a VME bus address

SYNOPSIS

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

DESCRIPTION

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.

NOTE

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

RETURNS

OK or ERROR if address cannot be probed

SEE ALSO

sysLib


mv2304 : Routines

sysPciProbe( )

NAME

sysPciProbe( ) - probe a PCI bus address

SYNOPSIS

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

DESCRIPTION

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.

RETURNS

OK or ERROR if address cannot be probed

SEE ALSO

sysLib


mv2304 : Routines

sysBusProbe( )

NAME

sysBusProbe( ) - probe a bus address based on bus type.

SYNOPSIS

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

DESCRIPTION

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.

RETURNS

ERROR if local bus is being probed, OK if VME or PCI bus.

SEE ALSO

sysLib


mv2304 : Routines

sysGetMpuSpd( )

NAME

sysGetMpuSpd( ) - get the speed of the MPC750 processor.

SYNOPSIS


UINT sysGetMpuSpd(void)

DESCRIPTION

This routine returns the speed (in MHz) of the 60x processor

RETURNS

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.

SEE ALSO

sysLib


mv2304 : Routines

sysUsDelay( )

NAME

sysUsDelay( ) - delay at least the specified amount of time (in microseconds)

SYNOPSIS

void sysUsDelay
    (
    UINT32 delay /* length of time in microsec to delay */
    )

DESCRIPTION

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.

NOTE

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.

RETURNS

N/A

SEE ALSO

sysLib