Emerson MVME147 User Manual

Introduction

The MVME147 MPU VMEmodule contains a port to the Small Computer Systems Interface (SCSI) bus. The hardware interface is the WD33C93 SCSI interface controller.
To relieve you of having to follow SCSI bus protocol, the SCSI firmware allows you to pass commands to the bus through high level command packets. Standard command packets are furnished, as well as custom SCSI sequence packets that you may easily modify to f it particular applications. With this method, the firmware interface can greatly speed up your software development cycle.
The SCSI firmware resides in two 128K x 8 EPROMs and is co-resident with MVME147Bug, the debug monitor for the MVME147 MPU VMEmodule.

Features

The SCSI firmware offers the following features: Custom SCSI sequence packets that allow creation of customized
functions
TARGET role Multitasking -- up to 64 concurrent peripheral devices High level support of SCSI devices Interrupt mode allows real-time applications Polled mode -- non-interrupt operation DMA with memory/scatter/gather Multiple-user interface allows concurrent operation through independent
drivers
Six entry points Thirty-one "canned" or standard function packets

GENERAL INFORMATION

1

Modes of Operation

When using the SCSI firmware, you have a choice of two modes of operation:
Interrupt mode and polled mode.
1
GENERAL INFORMATION
Interrupt mode is the most processor-efficient mode of operation. Multitasking is allowed for TARGETs that support arbitration, reselection,
and the message-out phase. When using the interrupt mode, you must specify the interrupt level in the
packet description (refer to the packet descriptions in Chapter 7). The processor is returned to the caller; i.e., the driver in most applications,
whenever the SCSI bus is slowed down (between phases), or whenever the TARGET disconnects with a pending reselection; this allows commands on the bus to be overlapped.
Polled mode is a slow, processor-inefficient mode of operation. Provided for the user who cannot tolerate interrupts. This mode is selected by specifying level 0 in the user packets. Only a single thread is provided on the SCSI bus. When you branch to the command entry, the processor stays in the SCSI
firmware until the command is finished or until interaction is required (refer to the MVME147 SCSI Firmware E ntry Points section that follows to perform a command in this mode).
Exceptions; e.g., bus parity errors are checked by polling the registers in the WD33C93. This checking method is slow.
Therefore, this non-interrupt polled mode is recommended only for applications that cannot tolerate interrupts.

MVME147 SCSI Firmware Entry Points

The SCSI firmware provides six entry points via the branch table located in the non-volatile RAM and contains jump instructions to the SCSI firmware in the debugger EPROMs. You are advised to use the non-volatile RAM entry addresses instead of the ROM addresses because in future debugger releases the SCSI firmware may move within the EPROMs. The branch table offsets are:
1. $FFFE077C (command entry)
2. $FFFE0782 (reactivation entry)
3. $FFFE0788 (interrupt entry)
4. $FFFE078E (FUNNEL command entry)
5. $FFFE0794 (come-again entry)
1-2
Note
Note
MVME147 SCSI Firmware Entry Points
1
6. $FFFE079A (RTE entry)
Within the SCSI firmware, which can stand alone without the debug monitor, the first six longwords are the branch table entries referenced above. The hex offsets provided reside within the non-volatile RAM.
The following are descriptions of the six entry points. For more detailed descriptions of their use, refer to the Interface Rules for Multiple Callers section in Chapter 5.
$FFFE077C: COMMAND ENTRY
Branches to FUNNEL entry.
$FFFE0782: REACTIVATION ENTRY
Branches to FUNNEL entry. All preprocessed commands are activated in the interrupt service routine through software interrupt.
$FFFE0788: INTERRUPT ENTRY
This entry point is used as the interrupt service routine address for vectors on the MVME147 module. Vector $45 (offset $114 from VB R) is the WD33 C93 in terrupt vector used by the SCSI firmware. Vector $46 (offset $118 from VBR) is the DMA channel interrupt vector and vector $4B (offset $12C from VBR) is the software interrupt vector used by the SCSI firmware to service queued commands.
The SCSI firmware initializes these vectors.
The following intermediate return resumes with an interrupt which gives control to the interrupt entry:
$02: WAIT FOR INTERRUPT (OPEN)
Intermediate status indicating that an WD33C93 interrupt brings the processor control back to the SCSI firmware. The MVME147 can accept more commands if it is currently disconnected from the SCSI bus (refer to the SCSI Firmware
1-3
1
GENERAL INFORMATION
Interrupt Structure paragraph in Chapter 4) or SCSI bus activity is slowed down. Additional commands may be sent to the SCSI firmware for a different peripheral device.
$FFFE078E: FUNNEL COMMAND ENTRY
This entry point is used by applications that require multiple interfaces to the SCSI firmware. Unlike the single user command entry, you may issue commands anytime the firmware does not require an RTE to be performed. If an RTE is required, and you wish to send a command at the same time, you may accomplish both by using the RT E entry (described below). The use of the FUNNEL command entry causes the FUNNEL module to examine the state of the SCSI bus, determine if the bus is currently in use, and send the command to the bus if it is not in use. If the bus is currently in use, the FUNNEL module checks if the device is not busy so it can preprocess or queue the command and return to the caller with an intermediate status of $A002. This preprocessed or queued command is processed and sent to the SCSI bus when the bus is free.
$FFFE0794: COME-AGAIN ENTRY
Branches to FUNNEL entry. All the queued commands are serviced in the interrupt service routine through software interrupt.
$FFFE079A: RTE ENTRY
The SCSI firmware notifies the user/caller that an RTE instruction needs to be executed by the RTE bit (13) of the returned status word. If this bit is 0, an RTE is required; if this bit is 1, an RTE is not required (the SCSI firmware does not execute the RTE instruction so as not to preempt a task in a VERSAdos or SYSTEM V/68 environment). SCSI firmware users may inherit an RTE from another caller because of the multiple caller interface. When an RTE is inherited from another caller, the use of the RTE entry may be required to send down a new command before executing an RTE instruction.

Equipment Supported

The following list shows the cont roller type assignments for SCSI controllers explicitly supported by the SCSI firmware, and the drives supported by each. /f3Note, however, that Motorola does not n ecessarily endorse or r ecommend
1-4
Equipment Supported
any particular controller, nor does Motorola ass ume responsibility for the operation of equipment manufactured by non-Motorola companies. Refer to Appendix A for information on how to use this firmware program.
1
CONTROLLE
R
CODE TYPE
0D Floppy TEAC FD235J 2
0E Winchester Televideo
0F Winchester Common
10 Winchester Seagate WREN
11 Winchester M icropolis 1375 900475-11-2B 1,2
12 Streaming Archive Viper
DEVICE P ART
MANUFACTUR
ER/MODEL
1002921-1B 1,2,3
7000/7400/3500 Floppy Tape
Command Set Floppy
77774620 1,2
III 94161
Winchester Seagate WREN
IIIHH 94211
Winchester Seagate SWIFT
94351-126
Winchester Seagate SWIFT
94351-201
2060s Tape
Streaming Archive Viper
2150s Tape
Streaming Tanberg 3620
(8533) 60Mb Tape
Streaming Tanberg 3640
(8534) 120M b Tape
75912134 1,2
22100-007 1,2
22300-004 1,2
NUMBER NOTES
1,2,3
1,2
1,2
6
6
1-5
1
GENERAL INFORMATION
CONTROLLE
R
CODE TYPE
CONTROLLE
R
CODE TYPE
13 Winchester Seagate WREN
14 Winchester Seagate ST
16 1/2" Tape Kennedy
17 Winchester Synchronous
DEVICE P ART
Streaming Tanberg 3660
Tape
Cassette TEAC MT-
Tape
DEVICE P ART
Winc hester Seagate WREN V
Winches ter Ma xt or 43 80S 2 Winches ter Ma xt or 87 60S 2
Winchester Seagate ST
Winchester Seagate ST
Winchester Seagate ST
Winchester Miniscribe 1,2
1/2" Tape HP 88780A 2
MANUFACTUR
ER/MODEL
(8535) 150M b
2ST/45S2
MANUFACTUR
ER/MODEL
IV 94171
94181
157N/M
125N/M
1096N
296N/M
9612/9662
Common Command Set
NUMBER NOTES
6
2
NUMBER NOTES
77777000 1,2
77777750 2
1,2,5
1,2,5
1,2,5
1,2,5
U92-9662-0004 2
2
1-6
Equipment Supported
1
CONTROLLE
R
CODE TYPE
18 8mm Tape Exabyte EXB-
DEVICE P ART
Floppy 2,3
Devices Supported Under Common Command Set
Winchester Televideo
Floppy Televideo
Winchester Seagate WREN
Winchester Seagate WREN
Winchester Micropolis 1375 900475-11-2B 1,2 Winchester Seagate WREN
Winc hester Seagate WREN V
Winchester Seagate SWIFT
Winchester Seagate SWIFT
Winches ter Ma xt or 43 80S 2 Winches ter Ma xt or 87 60S 2,4
Devices Supported Under Synchronous Common Command Set
Winc hester Seagate WREN V
Winches ter Ma xt or 43 80S 2,4 Winches ter Ma xt or 87 60S 2,4
MANUFACTUR
ER/MODEL
8200
7000/7400/3500
7000/7400/3500
III 94161
IIIHH 94211
IV 94171
94181
94351-126
94351-201
94181
NUMBER NOTES
820010-009 2
1,2
1002921-1B 1,2,3
77774620 1,2
1,2
77777000 1,2,4
77777750 2,4
75912134 1,2
1,2
77777750 2,4
NO TE:
1. Supported in firmware revision 1.0 and later.
2. Supported in firmware revision 2.0 and later.
1-7
1
GENERAL INFORMATION
3. Common Command Set for floppy matches SCSI II rather than revision 17B.
4. Under Common Command Set the cache is not enabled on these devices.
5. Seagate /M means Motorola proprietary.
6. Firmware assembly order number is: 966096. Order number for tape drives is (85xx) as shown with drive type. Order from: Tanberg Data A/S, Data Storage Division, P.O. Box 9, Korsvoll N-0808, Osl o 8, Norwa y, Phone +47 2 18 90 90 or Tanberg Data Tech. Center, 1077 Business Center Circle, Newbury Park, CA 91320, Pho n e +1 (80 5) 37 5- 2 50 0 .

Related Documentation

The publications listed in the following table may provide additional helpful information. If not shipped with this product, they may be purchased from Motorola’s Literature Distribution Center, 616 West 24th Street, Tempe, AZ 85282; telephone (602) 994-6561. Non-Motorola documents may be obtained from the sources listed.
MOTOROLA
DOCUMENT TITLE PUBLICATION NUMBER
MVME147 MPU VMEmodule User’s Manual MVME147 MVME147S MPU VMEmodule User’s
Manual MVME147Bug Debugging Package User’s
Manual MVME712A/MVME712AM/MVME712B
Transition Module and MVME147P2 Adapter Board User’s Manual MVME712M Transition Module and
MVME147P2 Adapter Board User’s Manual
MVME147S
MVME147BUG
MVME712A
MVME712M
1-8
DOCUMENT TITLE PUBLICATION NUMBER
M68000 16/32-Bit Microprocessor Programmer’s
Reference Manual M68000 Family VERSAdos System Facilities M68KVSF Reference Manual VERSAdos to VME Hardware and Software MVMEDOS Configuration User’s Manual
M68000UM
NOTE: Although not shown in the abo v e list, each Motorola
Computer Group manual publication number is suffixed with characters which represent the revision level of the document, such as /D2 (the second revision of a manual); supplement bears the same number as the manual but has a suffix such as /A1 (the first supplement to the manual).
The following publications are available from the sources indicated.

Manual Terminology

1
MOTOROLA
SCSI Guide Book; Adaptive Data Systems, Inc., 2627 Pomona Boulevard, Pomona, CA 91768
SCSI Small Computer Systems Interface; draft X3T9.2/82-2, Revision 14; Computer and business Equipment Manufacturers Association, 311 First Street, N.W., Suite 500, Washington, D.C. 20001
WD33C92 and WD33C93 SCSI Bus Interface Controller Data Manual; Western Digital, 2445 McCabe Way, Irvine, CA 92714.
Common Command Set (CCS) of the Small Computer System Interface ( SCSI) X3T9.2/85-52 - Revision 4B; Computer and Business Equipment Manufacturer’ s Association, 311 First Street, N.W., Suite 500, Washington D.C. 20001
Manual Terminology
Throughout this manual, a convention has been maintained whereby data and address parameters are preceded by a character which specifies the numeric format as follows:
1-9
1
GENERAL INFORMATION
$ dollar specifies a hexadecimal
number % percent specifies a binary number & ampersand specifies a decimal number
Unless otherwise specified, all address references are in hexadecimal throughout this manual.
An asterisk (*) following the signal name for signals which are level significant denotes that the signal is true or valid when the signal is low.
An asterisk (*) following the signal name for signals which are edge significant denotes that the actions initiated by that signal occur on high to low transition.
In this manual, assertion and negation are used to specify forcing a signal to a particular state. In particular, assertion and assert refer to a signal that is active or true; negation and negate indicate a signal that is inactive or false. These terms are used independently of the voltage level (high or low) that they represent.
1-10

Introduction

The SCSI firmware requests "canned" functions from SCSI disk controllers and from SCSI tape controllers. Some of these functions are disk read and write,
disk format, tape read and write, and tape positioning operations. The "canned" functions are only provided for the supported SCSI devices that are listed in the Equipment Support ed section in Chapter 1.
If you want to perform a function that is not "canned", or you want to communicate with SCSI devices that are not supported by the SCSI firmware, you do not have to rewrite the SCSI firmware. Any SCSI operation may be performed through the use of the custom SCSI packet.
A custom SCSI packet may be used for a variety of needs. Following are some typical needs:
1. You need to perform a command on a suppor ted SCSI disk controller that
is not "canned" in the SCSI firmware. (For example, an offline COPY command is not supported directly by the SCSI firmware. You may perform this COPY command through the custom SCSI packet.)
2. You wish to interface the MVME147 module to a SCSI optical disk
controller.
3. You wish to request linked commands from a disk controller.

CUSTOM SCSI PACKETS

2
There are three classes of custom SCSI packets, described in the following sections. They are:
Initiator role custom packet TARGET enable custom packet TARGET sequence custom packet

Initiator Role Custom Packet

The initiator role custom packet is shown in the following table.
Even Byte \ Odd Byte \
2
CUSTOM SCSI PACKETS
FC B8 74 30 +$00 Controller LUN Device LUN +$02 Status Byte 0 Status Byte 1 (No te 1) +$04 Script Pointer (MSW) +$06 Script Pointer (LSW) +$08 Command Table Pointer (MSW) (Note 2) +$0A Command Table Pointer (LSW) (Note 2) +$0C 0000 +$0E Flag = 0 0 0 0 +$10 Scatter/Gather Count +$12 0000 +$14 0 0 Function Code (1C) +$16 Interrupt Level Vector Number +$18 Status Byte 2 Status Byte 3 (No te 1) +$1A 0 0 Retry Count
$00 00000xxx Controller logical unit
number
$01 00000xxx Device logical unit
number
$02 xxxxxxxx Status from SCSI
firmware (byte 0) (Note 1)
$03 xxxxxxxx Status from SCSI
firmware (byte 1)
(Note 1) $04 xxxxxxxx xxxxxxxx Script pointer (MSW) $06 xxxxxxxx xxxxxxxx Script pointer (LSW) $08 xxxxxxxx xxxxxxxx Command table
pointer (MSW) (Note
2)
$0A xxxxxxxx xxxxxxxx Command table
pointer (LSW) (Note
2)
$0C 00000000 00000000 Reserved
2-2
Initiator Role Custom Packet
$0E 00000000 Initiator role
(TARGET enable/sequence bit
undefined) $0F 00000000 Reserved $10 xxxxxxxx xxxxxxxx Scatter/gather entry
count. No retry
on firmware if
scatter/gather DMA
is used
because command
scatter/gath er ta ble
could
be modified after the
command is complete
if disconnect/reselect
occurred. $12 00000000 00000000 Reserved $14 00000000 Reserved $15 00011100 SCSI function ($1C =
custom SCSI ) $16 00000xxx Interrupt level (7 to
0)(0 = polled mode)
$17 xxxxxxxx Vector number to use
upon return $18 xxxxxxxx Status from SCSI
firmware (byte 2)
(Note 1) $19 xxxxxxxx Status from SCSI
firmware (byte 3)
(Note 1) $1A 00000000 Reserved $1B 0000xxxx Retry count --
number of SCSI
command
retries (refer to
scatter/gathe r r etry
count
above)
2
2-3
2
CUSTOM SCSI PACKETS
NOTES:
1. Refer to Chapter 3.
2. Command Table = 384 bytes RAM work area.
This first class is used for command execution and/or message passing through the MVME147 SCSI firmware while the module is playing the initiator role. According to SCSI definition, an initiator is a SCSI device (usually a host system) which requests an operation to be performed by another SCSI device; a TARGET is a SCSI device which performs an operation requested by an initiator. Initiator role custom packets request operations to be performed by other SCSI devices. For the initiator role, certain data structures are needed by the SCSI firmware. These are:
1. SCRIPT: A "script" is a sequence of SCSI bus phases that the initiator expects the TARGET to perform when executing a requested command. For example, a disk read (under SCSI rules) would typically require the following SCSI bus phases:
MESSAGE-OUT: The IDENTIFY message is sent from the initiator to the TARGET. This message contains the identification of the desired logical unit of the selected disk controller that the initiator wishes to read. The message also indicates whether the initiator is capable of reselection.
COMMAND: The Command Descriptor Block (CDB) is sent during the command phase to specify the block number to read, the logical unit to read from, the number of blocks to read, and whether the command is linked.
DATA-IN: The actual data is transferred from the TARGET to the initiator during the data-in phase.
STATUS: The disk controller sends the status of the command that was executed during this phase.
MESSAGE-IN: During this phase, the disk controller sends a message describing the execution of the command it just executed. The linked command information would appear in the message sent during this phase, for example.
BUS DISCONNECT: After a disk controller sends a command complete message, it disconnects from the SCSI bus by releasing the BSY* signal.
The justification for a script is as follows. On the SCSI bus, the TARGET is always the SCSI device that dictates the sequence of bus phases that occurs during a communication with th e initiator (this communication is
2-4
Initiator Role Custom Packet
commonly called a "thread"). The script allows the SCSI firmware to follow the TARGET bus sequences and also allows the firmware to resume a disconnected thread once a disconnect/ rese lect occurs. Because the SBC allows "multithreading" of SCSI commands on the SCSI bus, a script is necessary to resume any disconnected threads. Without a script, the SCSI firmware would not have any way to check whether the TARGET performed the command that was requested through the CDB.
The following table gives the possible SCSI bus phases.
2
PHASE
Bus Free No activity on the bus. SEL* and BSY* are not
Arbitration SCSI devices arbitrate for the use of the bus by
(Re)Selection One SCSI device selects another device by
Information Transfer Phases: Command initiator
to TARGET
Status TARGET
Data in
Data out
Message in
DIRECTION NOTES
activated.
activating BSY* and their ID.
activating SEL* along with its ID and th e ID for the other device.
A command tells the TARGET what is requested by the initiator. The CDB is passed during this phase.
The status of a particular command is passed to
to initiator TARGET
to initiator
initiator to TARGET
TARGET to initiator
initiator. Examples: good, busy, check. Data is transferred from the TARGET to the
initiator as a result of a data phase requested in the CDB.
Data is transferred from the initiator to the T A RGE T a s a result of a data pha se r equested in the CDB.
Messages are sent to the initiator to send bus, command, and controller information. Examples: command complete, save data pointer, restore data pointer, message reject.
2-5
2
CUSTOM SCSI PACKETS
PHASE
Message out
DIRECTION NOTES
initiator to TARGET
Messages are sent to the TARGET to send bus, command, and controller information. Examples: identify, initiator detected error, abort, device reset.
Scripts only specify the information transfer phases. The bus free, arbitration, and selection phases do not need to be specified in a script. The script codes that are understood by the MVME147 SCSI firmware are listed in the following table. (Note that TARGET role scripts are described in the Target Sequence Custom Packet section in this chapter.
CODE
$00 END OF SCRIPT Init iator
DISCONNECT TARGET $04 COMMA N D PHASE Initi ator and TARGET $08 DATA-OUT PHASE Initiator and TARGET
$0C DATA-IN PHASE Initiator and TARGET
$10 STATUS PHASE Initiator and TARGET $14 MESSAGE-OUT PHASE Initiator and TARGET $18 MESSAGE-IN PHASE Initiator and TARGET
$1C END OF SCRIPT TARGET
NOT DEFINED Initiator $20 TARGET WAIT, TARGET
NO DISCONNECT $24 TARGET WAIT, TARGET
DISCONNECT $28 TARGET WAIT, TARGET
NO DISCONNECT
DATA RECEIVED
$2C TARGET WAIT, TARGET
DISCONNECT
DATA RECEIVED
BUS PHASES ROLE
2-6
Initiator Role Custom Packet
If you suspect data integrity error, you can set up the SCSI script to execute the data phase and then disconnect from the bus (script code 0x2c) or just return as an intermediate return without disconnect from the bus (script code 0x28). Firmware executes the data phase and then returns the firmware parity error status, if any, command packet, and command table back to you.
You can examine the data as well as the firmware status to decide what SCSI status should be returned to initiator. After the status is determined, a new TARGET sequence command packet needs to be sent to firmware with status, message (for message-in phase), and proper scripts to complete the SCSI bus command.
For the previous disk read example, the script would be: $14,$04,$0C,$10,$18,$00.
The above sequence of codes may be written anywhere in the MVME147­accessible space. It may even be ROMed. The script pointer in the custom SCSI packet is the address of the first entry of the script. In the example, it would point to the $14. Therefore, the message-out phase should always be the first phase in any initiator script.
2. COMMAND TABLE (384 bytes of RAM). The second data structure required by the SCSI firmware for the execution of a custom SCSI packet is a Command Table.
2
For unsupported controllers, the control of certain functions (parity checking, DMA, linked commands, SCSI rules, DMA scatter/gather, SYNC/ASYNC transfer) is dictated to the firmware through the status/flag byte of the Command Table.
The CDB is one of the pieces of the command table. The user of the initiator role custom SCSI packet loads the CDB to be passed to the SCSI target that is to be selected. The initiator role custom SCSI packet has a Command Table pointer which is the address of the first word of this data structure. Unlike the script, the Command Table must be in MVME147-accessible RAM because the firmware writes to portions of the table. All the user accessible pieces of the Command Table are shown in the following table.
Even Byte \ Odd Byte \
2-7
2
CUSTOM SCSI PACKETS
FC B8 74 30 +$00 Status/Flag Byte Retry Count (00) +$02 Link Pointer (MSW) +$04 Link Pointer (LSW) +$06 Command Length +$08 SCSI Command Descriptor Block (CDB) +$0A SCSI Command Descriptor Block (CDB) +$0C SCSI Command Descriptor Block (CDB) +$0E SCSI Command Descriptor Block (CDB) +$10 SCSI Command Descriptor Block (CDB) +$12 SCSI Command Descriptor Block (CDB) +$14 SCSI Status Initiator SCSI Address (0 t o 7) +$16 Data Length (MSW) +$18 Data Length (LSW) +$1A Data Pointer (MSW) (Note 1) +$1C Data Pointer (LSW) (Note 1) +$1E Me ssa ge-In Length +$20 Message-In Pointer (MSW) +$22 Message-In Pointer (LSW) +$24 Message-Out Length +$26 Message-Out Pointer (MSW) +$28 Message-Out Pointer (LSW) +$2A Reserved +$2C Reserved
. . .
+$60 Sector Number in Error (MSW) +$62 Sector Number in Error (LSW) +$64 SCSI Con troller Status 0 0 +$66 T ransfer Address
2-8
Initiator Role Custom Packet
Even Byte \ Odd Byte \
FC B8 74 30 +$68 T ransfer Address +$6A 0000 +$6C 0000 +$6E 0000 +$70 0000 +$72 Command Offset +$74 Sense Data Block
. . .
+$9E Sense Data Block
2
$00 xxxxxxxx Status/flag byte
0....... Lnk -- link flag bit
disabled
1....... Lnk -- link command
tables, support linked commands
.0...... Parity disabled
.1...... Parity enabled --
MVME147 checks SCSI
bus parity
..0..... DMA on
..1..... DMA off flag --
disable DMA for data out/in
...0.... CSCSI -- custom
sequence flag: checks
2-9
2
CUSTOM SCSI PACKETS
status (Note 2)
...1.... CSCSI -- does not
check SCSI status (Note 2)
....0... SCSI firmware uses
SCSI rules (Note 3)
....1... SASI mode flag --
firmware uses SASI rules (Note 3)
.....1.. SG -- scatter/gather
enable, use data points to
scatter/gather table. During
custom SCSI packet, you have to set this
bit if scatter/ gather DMA operation is
required
.....0.. SG -- scatter/gather
disable
2-10
......1. SYNC -- synchronous
transfers enable On INITIATOR role,
SCSI firmware initiates synchronous
data transfer request. On TARGET role,
SCSI firmware initiates synchronous
data transfer request IF initiator
DOES NOT do so before first data
phase.
Initiator Role Custom Packet
......0. ASYNC --
asynchronous transfers enable
$01 00000000 Retry count (must be
00)
$02 xxxxxxxx xxxxxxxx Link pointer (MSW) --
for linked commands. Valid only if link flag
bit = 1
$04 xxxxxxxx xxxxxxxx Link pointer (LSW) $06 xxxxxxxx xxxxxxxx Command length --
length of the CDB (in bytes)
$08 xxxxxxxx xxxxxxxx SCSI command
descriptor block (CDB)
SCSI draft revision 17B allows 12 bytes
maximum length (Note 4)
$0A xxxxxxxx xxxxxxxx SCSI (CDB) $0C xxxxxxxx xxxxxxxx SCSI (CDB) $0E xxxxxxxx xxxxxxxx SCSI (CDB) $10 xxxxxxxx xxxxxxxx SCSI (CDB) $12 xxxxxxxx xxxxxxxx SCSI (CDB) $14 xxxxxxxx SCSI status
On INITIATOR role, this is the copy of status on
$64. On T ARGET role, you
can set SCSI status here.
Bit 0(LSB), 5 and 6 is vendor unique. Bit 7
is reserved. The status set here is ORed with
2
2-11
2
CUSTOM SCSI PACKETS
the firmware status ($64) and sent to initiator.
If you determine to use bit 1-4, such as data
parity error, the firmware non-zero status on
bit 1-4 has higher priority. You should load
this byte with the appropriate status and set
up the SCSI script for status phase before the
target sequence packet is sent.
$15 xxxxxxxx Initiator SCSI addr ess
in TARGET mode (0 to 7)
(only used in TARGET mode)
$16 xxxxxxxx xxxxxxxx Data length (MSW) --
number of bytes expected during data-
in or data-out phase
$18 xxxxxxxx xxxxxxxx Data length (LSW)
$1A xxxxxxxx xxxxxxxx Data pointer (MSW) -
- to memory area where firmwar e reads
(data out) or writes (data-in) (contiguous
buffer)
$1C xxxxxxxx xxxxxxxx Data pointer (LSW)
2-12
Initiator Role Custom Packet
$1E xxxxxxxx xxxxxxxx Message-in length --
bytes expected during message-in
(max=258 for extended
messages)
$20 xxxxxxxx xxxxxxxx Message-in pointer
(MSW) -- to RAM buffer where
firmware stores received
messages
$22 xxxxxxxx xxxxxxxx Message-in pointer
(LSW)
$24 xxxxxxxx xxxxxxxx Message-out length --
bytes expected to be transferred in
message-out phase, has to be non-zero if
message-out phase is required (max=258
for extended messages)
$26 xxxxxxxx xxxxxxxx Message-out pointer
(MSW) -- to RAM buffer where
firmware takes messages to
transfer to TARGET
$28 xxxxxxxx xxxxxxxx Message-out pointer
(LSW)
$2A xxxxxxxx xxxxxxxx Reserved $2C xxxxxxxx Reserved
.. .. ..
$60 xxxxxxxx xxxxxxxx Sector number in
error (MSW)
2
2-13
2
CUSTOM SCSI PACKETS
$62 xxxxxxxx xxxxxxxx Sector number in
error (LSW)
$64 xxxxxxxx Initiator role - Status
byte from SCSI controller
(unchanged) TARGET r ole -
firmware determined SCSI
status $65 xxxxxxxx Reserved $66 xxxxxxxx xxxxxxxx Trans fer address -- for
a read or writ e.
This is the address of
the next byte to be
transferred. $68 xxxxxxxx xxxxxxxx Trans fer address -- for
a read or writ e.
This is the memory
address of the next
byte to be transfe rred.
. .
. .
$72 xxxxxxxx Command error
status byte (valid
following
a command error
$0B) -- SCSI
command in
error. $73 xxxxxxxx Offset within packet. $74 xxxxxxxx xxxxxxxx Sense data block
(controller-
dependent).
This is the
information returned
by the
2-14
Initiator Role Custom Packet
controller follow ing a check status and
a request sense data command. Valid
informatio n if bit 14 (additional status)
is set. This block is
firmware private area and only
used on the INITIATOR role.
. .
$9E xxxxxxxx xxxxxxxx Sense data block
. .
2
NOTE S:
1. Points to scatter/gather table if scatter/gather bit = 1 in byte 0.
2. If = 0 and if status is "check", SCSI firmware interprets returned SCSI status, and sends a request sense command to t he con troller; if status is = busy, infinite retries are performed. If = 1, SCSI firmware does not read the SCSI status from the command table, and returned status word in the packet reflects only firmware status.
3. Must be 0. MVME147 SCSI firmware ONLY supports SCSI devices.
4. In TARGET mode, the CDBs is received from the SCSI bus and it will be returned to the user without any modif ication with CDB length. When a target LUN is not enabled or when ’target device reset’ or ’abort’ message is received, the CDB received by the target role firmware will not be returned to the user. Instead, a error code will be returned.
Example: Sending linked commands to a disk controller You intend to implement a read-modify-write function for your particular
operating system. The benefit of linking commands on the SCSI bus is a better utilization of bus bandwidth. When two commands are linked, the TARGET does not disconnect between commands. After the message-in phase completes one command, the TARGET switches to command phase for the second command. The arbitration and selection phases are eliminated for the
2-15
2
CUSTOM SCSI PACKETS
second command. The following linked command example may be performed on the Archive 2150 disk controller (it supports linked commands). The SCSI firmware does not support linked command with flag.
PACKET FOR THE LINKED COMMAND EXAMPLE:
PACKET DC.W $0400 CONTROLLER LEVEL=4, DEVICE LUN=0 DS.W 1 RETURNED STATUS WORD (BYTES 0 AND 1)+2 DC.L LSCRIPT SCRIPT POINTER +4 DC.L CT1 COMMAND TABLE POINTER +8 DC.W 0 RESERVED +C DC.W 0 INITIATOR ROLE CUSTOM SEQUENCE +E DC.W 0 RESERVED +10 DC.W 0 RESERVED +12 DC.W $001C FUNCTION CODE=CUSTOM SCSI SEQUENCE +14 DC.W $0260 INTERRUPT LEVEL 2, VECTOR $60 +16 DS.W 1 STATUS BYTES 2 AND 3 +18 DC.W 3 RETRY COUNT=3 +1A
SCRIPT for a READ followed by a WRITE:
2-16
LSCRIPT DC.B $14 MESSAGE OUT (IDENTIFY) DC.B $04 COMMAND (READ) DC.B $0C DATA IN DC.B $10 STATUS DC.B $18 MESSAGE IN DC.B $04 COMMAND (WRITE) DC.B $08 DATA OUT DC.B $10 STATUS DC.B $18 MESSAGE IN DC.B $00 END OF SCRIPT
(LINKED COMMANDS REQUIRE AS MANY COMMAND TABLES AS THERE ARE PIECES OF THE LINKED COMMAND. I.E. FOR A READ/WRITE LINKED COMMAND, 2 TABLES ARE REQUIRED)
Initiator Role Custom Packet
*****************************COMMAND TABLE FOR THE FIRST COMMAND************** CT1 DC.B %11000000 * X LINK FLAG ON * X PARITY CHECKING ENABLED * X DMA ENABLED * X CUSTOM SEQ. FLAG=> FIRMWARE CHECKS STATUS * X FIRMWARE USES SCSI RULES (RESELECT, ETC.) * X RESERVED X NO SCATTER/GATHER OPERATION X ASYNC SCSI TRANSFER DC.B 0 RETRY COUNT=0 DC.L CT2 THE ADDRESS OF THE SECOND COMMAND TABLE DC.W 6 COMMAND LENGTH = 6 (GROUP 0 COMMAND) DC.B $08 READ COMMAND DC.B $00 LUN=0, BLOCK ADDR MSB=0 DC.B $00 BLOCK ADDR DC.B $86 (FULL BLOCK ADDR=$00086) DC.B $04 4 BLOCKS REQUESTED DC.B $03 CONTROL BYTE: FLAG BIT=1, LINK BIT=1. * see *NOTE below the second command table. DC.B 00 DON’T CARE DC.B 00 DON’T CARE DC.B 00 DON’T CARE DC.B 00 DON’T CARE DC.B 00 DON’T CARE DC.B 00 DON’T CARE DS.B 01 USER’S STATUS BYTE IS STORED HERE DC.B 07 SCSI INITIATOR ADDRESS = $07 DC.L $400 4 BLOCKS * $100 BYTES/BLOCK= $400 BYTES DC.L BUFF DATA BUFFER ADDRESS DC.W 1 MESSAGE IN AREA ALLOCATION= 1 BYTE DC.L MSIN1 MESSAGE IN AREA POINTER DC.W 1 MESSAGE OUT AREA ALLOCATION = 1 BYTE DC.L MSOUT1 MESSAGE OUT AREA POINTER DS.B 342 REMAINING OF THE 384 BYTE COMMAND TABLE MSIN1 DS.B 1 MESSAGE IN AREA FOR COMMAND TABLE #1 MSOUT1 DC.B $C0 THE IDENTIFY MESSAGE FOR LUN 0, WITH RESELECTION BUFF DS.B $400 4 BLOCK DATA BUFFER
2
2-17
2
CUSTOM SCSI PACKETS
*****************************COMMAND TABLE FOR THE WRITE COMMAND************** CT2 DC.B %01000000 * X LINK FLAG OFF * X PARITY CHECKING ENABLED * X DMA ENABLED * X CUSTOM SEQ. FLAG=> FIRMWARE CHECKS STATUS * X FIRMWARE USES SCSI RULES (RESELECT, ETC.) * X RESERVED. X NO SCATTER/GATHER X ASYNC SCSI TRANSFER DC.B 0 RETRY COUNT=0 DC.L 0 NO LINK ADDRESS PROVIDED. DC.W 6 COMMAND LENGTH = 6 (GROUP 0 COMMAND) DC.B $0A WRITE COMMAND DC.B $00 LUN=0, BLOCK ADDR MSB=0 DC.B $00 BLOCK ADDR DC.B $86 (FULL BLOCK ADDR=$00086) DC.B $04 4 BLOCKS REQUESTED DC.B $00 CONTROL BYTE: FLAG BIT=0, LINK BIT=0. DC.B 00 DON’T CARE DC.B 00 DON’T CARE DC.B 00 DON’T CARE DC.B 00 DON’T CARE DC.B 00 DON’T CARE DC.B 00 DON’T CARE DS.B 01 USER’S STATUS BYTE IS STORED HERE DC.B 07 SCSI INITIATOR ADDRESS = $07 DC.L $400 4 BLOCKS * $100 BYTES/BLOCK= $400 BYTES DC.L BUFF DATA BUFFER ADDRESS DC.W 1 MESSAGE IN AREA ALLOCATION= 1 BYTE DC.L MSIN2 MESSAGE IN AREA POINTER DC.W 1 MESSAGE OUT AREA ALLOCATION = 1 BYTE DC.L MSOUT2 MESSAGE OUT AREA POINTER DS.B 342 REMAINING OF THE 384 BYTE COMMAND TABLE MSIN2 DS.B 1 MESSAGE IN AREA FOR COMMAND TABLE #1 MSOUT2 DC.B $00 NO MESSAGE OUT PHASE FOR THE SECOND COMMAND.
2-18

TARGET Enable Custom Packet

Note
A linked command with the flag bit set is not supported, and the flag bit is ignored if it is set.
TARGET Enable Custom Packet
The TARGET enable custom packet is shown in the following table.
Even Byte \ Odd Byte \
FC B8 74 30
+$00 Controller LUN Device LUN +$02 Status Byte 0 Status Byte 1 (No te 1) +$04 Not Used +$06 Not Used +$08 Command Table Pointer (MSW) (Note 2) +$0A Command Table Pointer (LSW) (Note 2) +$0C 0000 +$0E Flag = C 0 0 0 +$10 0000 +$12 0000 +$14 0 0 Function Code (1C) +$16 Interrupt Level Vector Number +$18 Status Byte 2 Status Byte 3 (No te 1) +$1A 0 0 Retry Count
2
$00 00000xxx Controller logical unit
number
$01 00000xxx Device logical unit
number
$02 xxxxxxxx Status from SCSI
firmware (byte 0) (Note 1)
2-19
2
CUSTOM SCSI PACKETS
$03 xxxxxxxx Status from SCSI
firmware (byte 1)
(Note 1) $04 xxxxxxxx xxxxxxxx Not used $06 xxxxxxxx xxxxxxxx Not used $08 xxxxxxxx xxxxxxxx Command table
pointer (MSW) (Note
2)
$0A xxxxxxxx xxxxxxxx Command table
pointer (LSW) (Note
2) $0C 00000000 00000000 Reserved
$0E 1....... TARGET role
.1...... TARGET enable
..000000 Reserved
$0F 00000000 Reserved $10 00000000 0000 0000 Reserved $12 00000000 0000 0000 Reserved $14 00000000 Reserved $15 xxxxxxxx SCSI function ($1C =
Custom SCSI
sequence) $16 00000xxx Interrupt level (7 to 1) $17 xxxxxxxx Vector number to use
upon return $18 xxxxxxxx Status from SCSI
firmware (byte 2)
(Note 1) $19 xxxxxxxx Status from SCSI
firmware (byte 3)
(Note 1) $1A 00000000 Reserved $1B 00000000 Retry count must be 0
NOTES:
2-20
1. Refer to Chapter 3.
2. Command table = 384 bytes RAM work area.
Loading...
+ 140 hidden pages