02.03.2014 Views

BSP Developer's Guide

BSP Developer's Guide

BSP Developer's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

I<br />

Writing a SCSI-2 Device Driver<br />

*/<br />

LOCAL STATUS xxxWideXferParamsSet<br />

(<br />

SCSI_CTRL *pScsiCtrl, /* ptr to controller info */<br />

UINT8 xferWidth /* wide data transfer width */<br />

)<br />

{<br />

}<br />

Example I-3<br />

Template: Advanced I/O Processor Driver<br />

; xxxInit.n Script I/O processor assembly code for xxxLib Driver<br />

;<br />

; Copyright 1989-1996 Wind River Systems, Inc.<br />

;<br />

;/*<br />

;Modification history<br />

;--------------------<br />

;01a,28jun95,jds Created. Adapted from ncr710init.n<br />

;<br />

;<br />

;INTERNAL<br />

;This file contains the assembly level SCSI scripts instructions which are<br />

;used in conjunction with a higher level controller driver. To operate in<br />

;SCSI SCRIPTS mode the SCSI I/O Processor requires only a SCRIPTS start<br />

;address and a signal to begin operation. At that point, the processor<br />

;begins fetching instructions from external memory and then executes them.<br />

;The start address is written to the DMA SCRIPTS Pointer (DSP) register,<br />

;which acts like a typical program counter. All SCRIPT instructions are<br />

;fetched from external memory. The SCSI I/O Processor fetches and executes<br />

;its own instructions by becoming a bus master on the host bus. Instructions<br />

;are executed until a SCSI SCRIPTS interrupt instruction is encountered or<br />

;until an unexpected interrupt causes an interrupt to the external<br />

;processor. Once an interrupt is generated, the SCSI I/O Processor halts all<br />

;operations until the interrupt is serviced. The further execution of<br />

;SCRIPTS is then controlled by the SCSI controller driver which decides<br />

;at which entry point should the SCRIPT processor start executing.<br />

;<br />

;There are four SCRIPT entry points which could be used by the controller<br />

;driver. Execution thereafter is a function of the logic flow within the<br />

;SCRIPTS and cannot be controlled by the driver. Thus, controll is<br />

;transferred to the SCRIPTS processor by the controller driver at well known<br />

;entry points and this control is returned to the controller driver by the<br />

;SCRIPTS by generating a SCRIPTS interrupt. The four SCRIPTS entry points<br />

;are described below:<br />

;<br />

;1) xxxWait<br />

; If the SCSI controller is not connected to the bus, this entry point is<br />

; used. The SCRIPTS processor waits for selection or re-selection by a SCSI<br />

; target device (which acts as an initiator during selection), or can be<br />

; interrupted by a new command from the host. This is done by signalling<br />

; the processor via register bits. Thus this entry point puts the SCRIPTS<br />

; processor into a passive mode.<br />

I<br />

351

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!