VxWorks Reference Manual : Libraries

ncr710Lib

NAME

ncr710Lib - NCR 53C710 SCSI I/O Processor (SIOP) library (SCSI-1)

ROUTINES

ncr710CtrlCreate( ) - create a control structure for an NCR 53C710 SIOP
ncr710CtrlInit( ) - initialize a control structure for an NCR 53C710 SIOP
ncr710SetHwRegister( ) - set hardware-dependent registers for the NCR 53C710 SIOP
ncr710Show( ) - display the values of all readable NCR 53C710 SIOP registers

DESCRIPTION

This is the I/O driver for the NCR 53C710 SCSI I/O Processor (SIOP). It is designed to work with scsi1Lib. It also runs in conjunction with a script program for the NCR 53C710 chip. This script uses the NCR 53C710 DMA function for data transfers. This driver supports cache functions through cacheLib.

USER-CALLABLE ROUTINES

Most of the routines in this driver are accessible only through the I/O system. Three routines, however, must be called directly: ncr710CtrlCreate( ) to create a controller structure, and ncr710CtrlInit( ) to initialize it. The NCR 53C710 hardware registers need to be configured according to the hardware implementation. If the default configuration is not proper, the routine ncr710SetHwRegister( ) should be used to properly configure the registers.

INCLUDE FILES

ncr710.h, ncr710_1.h, ncr710Script.h, ncr710Script1.h

SEE ALSO

ncr710Lib, scsiLib, scsi1Lib, cacheLib, NCR 53C710 SCSI I/O Processor Programming Guide, VxWorks Programmer's Guide: I/O System


Libraries : Routines

ncr710CtrlCreate( )

NAME

ncr710CtrlCreate( ) - create a control structure for an NCR 53C710 SIOP

SYNOPSIS

NCR_710_SCSI_CTRL *ncr710CtrlCreate
    (
    UINT8 * baseAdrs, /* base address of the SIOP */
    UINT    freqValue /* clock controller period (nsec* 100) */
    )

DESCRIPTION

This routine creates an SIOP data structure and must be called before using an SIOP chip. It should be called once and only once for a specified SIOP. Since it allocates memory for a structure needed by all routines in ncr710Lib, it must be called before any other routines in the library. After calling this routine, ncr710CtrlInit( ) should be called at least once before any SCSI transactions are initiated using the SIOP.

A detailed description of the input parameters follows:

baseAdrs
the address at which the CPU accesses the lowest register of the SIOP.

freqValue
the value at the SIOP SCSI clock input. This is used to determine the clock period for the SCSI core of the chip and the synchronous divider value for synchronous transfer. It is important to have the right timing on the SCSI bus. The freqValue parameter is defined as the SCSI clock input value, in nanoseconds, multiplied by 100. Several freqValue constants are defined in ncr710.h as follows:
    NCR710_1667MHZ  5998    /* 16.67Mhz chip */
    NCR710_20MHZ    5000    /* 20Mhz chip    */
    NCR710_25MHZ    4000    /* 25Mhz chip    */
    NCR710_3750MHZ  2666    /* 37.50Mhz chip */
    NCR710_40MHZ    2500    /* 40Mhz chip    */
    NCR710_50MHZ    2000    /* 50Mhz chip    */
    NCR710_66MHZ    1515    /* 66Mhz chip    */
    NCR710_6666MHZ  1500    /* 66.66Mhz chip */

RETURNS

 A pointer to the NCR_710_SCSI_CTRL structure, or NULL if memory  is insufficient or parameters are invalid.

SEE ALSO

ncr710Lib


Libraries : Routines

ncr710CtrlInit( )

NAME

ncr710CtrlInit( ) - initialize a control structure for an NCR 53C710 SIOP

SYNOPSIS

STATUS ncr710CtrlInit
    (
    NCR_710_SCSI_CTRL * pSiop,         /* ptr to SIOP struct */
    int                 scsiCtrlBusId, /* SCSI bus ID of this SIOP */
    int                 scsiPriority   /* priority of task when doing SCSI */
    )

DESCRIPTION

This routine initializes an SIOP structure, after the structure is created with ncr710CtrlCreate( ). This structure must be initialized before the SIOP can be used. It may be called more than once; however, it should be called only while there is no activity on the SCSI interface.

Before returning, this routine pulses RST (reset) on the SCSI bus, thus resetting all attached devices.

The input parameters are as follows:

pSiop
a pointer to the NCR_710_SCSI_CTRL structure created with ncr710CtrlCreate( ).

scsiCtrlBusId
the SCSI bus ID of the SIOP, in the range 0 - 7. The ID is somewhat arbitrary; the value 7, or highest priority, is conventional.

scsiPriority
the priority to which a task is set when performing a SCSI transaction. Valid priorities are 0 to 255. Alternatively, the value -1 specifies that the priority should not be altered during SCSI transactions.

RETURNS

 OK, or ERROR if parameters are out of range.

SEE ALSO

ncr710Lib


Libraries : Routines

ncr710SetHwRegister( )

NAME

ncr710SetHwRegister( ) - set hardware-dependent registers for the NCR 53C710 SIOP

SYNOPSIS

STATUS ncr710SetHwRegister
    (
    SIOP *           pSiop,  /* pointer to SIOP info */
    NCR710_HW_REGS * pHwRegs /* pointer to NCR710_HW_REGS info */
    )

DESCRIPTION

This routine sets up the registers used in the hardware implementation of the chip. Typically, this routine is called by the sysScsiInit( ) routine from the board support package.

The input parameters are as follows:

pSiop
a pointer to the NCR_710_SCSI_CTRL structure created with ncr710CtrlCreate( ).

pHwRegs
a pointer to a NCR710_HW_REGS structure that is filled with the logical values 0 or 1 for each bit of each register described below.

This routine includes only the bit registers that can be used to modify the behavior of the chip. The default configuration used during ncr710CtlrCreate( ) and ncr710CrtlInit( ) is {0,0,0,0,1,0,0,0,0,0,0,0,0,1,0}.

    typedef struct
        {
        int ctest4Bit7;    /* host bus multiplex mode */
        int ctest7Bit7;    /* disable/enable burst cache capability */
        int ctest7Bit6;    /* snoop control bit1 */
        int ctest7Bit5;    /* snoop control bit0 */
        int ctest7Bit1;    /* invert tt1 pin (sync bus host mode only) */
        int ctest7Bit0;    /* enable differential SCSI bus capability */
        int ctest8Bit0;    /* set snoop pins mode */
        int dmodeBit7;     /* burst length transfer bit 1 */
        int dmodeBit6;     /* burst length transfer bit 0 */
        int dmodeBit5;     /* function code bit FC2 */
        int dmodeBit4;     /* function code bit FC1 */
        int dmodeBit3;     /* program data bit (FC0) */
        int dmodeBit1;     /* user-programmable transfer type */
        int dcntlBit5;     /* enable ACK pin */
        int dcntlBit1;     /* enable fast arbitration on host port */
        } NCR710_HW_REGS;
For a more detailed description of the register bits, see the NCR 53C710 SCSI I/O Processor Programming Guide.

NOTE

* Because this routine writes to the NCR 53C710 chip registers, it cannot be used when there is any SCSI bus activity.

RETURNS

OK, or ERROR if an input parameter is NULL.

SEE ALSO

ncr710Lib, ncr710CtlrCreate( ), NCR 53C710 SCSI I/O Processor Programming Guide


Libraries : Routines

ncr710Show( )

NAME

ncr710Show( ) - display the values of all readable NCR 53C710 SIOP registers

SYNOPSIS

STATUS ncr710Show
    (
    SCSI_CTRL * pScsiCtrl /* ptr to SCSI controller info */
    )

DESCRIPTION

This routine displays the state of the NCR 53C710 SIOP registers in a user-friendly manner. It is useful primarily for debugging. The input parameter is the pointer to the SIOP information structure returned by the ncr710CtrlCreate( ) call.

NOTE

The only readable register during a script execution is the Istat register. If this routine is used during the execution of a SCSI command, the result could be unpredictable.

EXAMPLE

    -> ncr710Show
    NCR710 Registers 
    ---------------- 
    0xfff47000: Sien    = 0xa5 Sdid    = 0x00 Scntl1  = 0x00 Scntl0  = 0x04
    0xfff47004: Socl    = 0x00 Sodl    = 0x00 Sxfer   = 0x80 Scid    = 0x80
    0xfff47008: Sbcl    = 0x00 Sbdl    = 0x00 Sidl    = 0x00 Sfbr    = 0x00
    0xfff4700c: Sstat2  = 0x00 Sstat1  = 0x00 Sstat0  = 0x00 Dstat   = 0x80
    0xfff47010: Dsa     = 0x00000000
    0xfff47014: Ctest3  = ???? Ctest2  = 0x21 Ctest1  = 0xf0 Ctest0  = 0x00
    0xfff47018: Ctest7  = 0x32 Ctest6  = ???? Ctest5  = 0x00 Ctest4  = 0x00
    0xfff4701c: Temp    = 0x00000000
    0xfff47020: Lcrc    = 0x00 Ctest8  = 0x00 Istat   = 0x00 Dfifo   = 0x00
    0xfff47024: Dcmd/Ddc= 0x50000000
    0xfff47028: Dnad    = 0x00066144
    0xfff4702c: Dsp     = 0x00066144
    0xfff47030: Dsps    = 0x00066174
    0xfff47037: Scratch3= 0x00 Scratch2= 0x00 Scratch1= 0x00 Scratch0= 0x0a
    0xfff47038: Dcntl   = 0x21 Dwt     = 0x00 Dien    = 0x37 Dmode   = 0x01
    0xfff4703c: Adder   = 0x000cc2b8

RETURNS

OK, or ERROR if pScsiCtrl and pSysScsiCtrl are both NULL.

SEE ALSO

ncr710Lib, ncr710CtrlCreate( )