No subject

kcummings at vnet.ibm.com kcummings at vnet.ibm.com
Tue Apr 19 08:32:34 PDT 1994


DOWNLOAD MICROCODE using WRITE BUFFER

This proposal uses the WRITE BUFFER command to implement download
microcode.  It was attempted to keep as much of the existing SCSI-2
structure for WRITE BUFFER command as possible.  No fields were added,
and all fields were kept.  Buffer id, buffer offset, and parameter list
length, were redefined for the download microcode modes of the command
(they are undefined in their present form) but every attempt was made to
keep these new definitions consistent with the definitions in the rest
of the command description.

The header numbers are from the SCSI-2 standard, revision 10L.  Changes
were made in sections 8.2.17.4 and 8.2.17.5.  Section 8.2.17.6 is
entirely new.

Please address comments to me:

Ken Cummings
kcummings at vnet.ibm.com
Tel. (602) 799-2182

*********************************************************************
8.2.17  WRITE BUFFER Command

The WRITE BUFFER command (see table) is used in conjunction with the
READ BUFFER command as a diagnostic for testing target memory and the
SCSI bus integrity.  Additional modes are provided for downloading
microcode and for downloading and saving microcode.

|--------------------------------------------------------------------|
|Table 75 - WRITE BUFFER command                                     |
|--------------------------------------------------------------------|
|Bit/|       |       |       |       |       |       |       |       |
|Byte|   7   |   6   |   5   |   4   |   3   |   2   |   1   |   0   |
|----|---------------------------------------------------------------|
| 0  |                Operation Code (X'3B')                         |
|----|---------------------------------------------------------------|
| 1  |  Logical Unit Number  |    Reserved   |          Mode         |
|----|---------------------------------------------------------------|
| 2  |                        Buffer ID                              |
|----|---------------------------------------------------------------|
| 3  |                                                               |
|----|                                                               |
| 4  |                        Buffer Offset                          |
|----|                                                               |
| 5  |                                                               |
|----|---------------------------------------------------------------|
| 6  |                                                               |
|----|                                                               |
| 7  |                      Parameter List Length                    |
|----|                                                               |
| 8  |                                                               |
|----|---------------------------------------------------------------|
| 9  |                         Control                               |
|--------------------------------------------------------------------|

This command shall not alter any medium of the target when the data mode
or the combined header and data mode is specified.

The function of this command and the meaning of fields within the
command descriptor block depend on the contents of the mode field.

    |-------------------------------------------------------------|
    | Table 76 - WRITE BUFFER mode field                          |
    |-------------------------------------------------------------|
    |        |                                 | Implementation   |
    |  Mode  | Description                     |   requirements   |
    |-------------------------------------------------------------|
    |  000b  | Write combined header and data  | Optional         |
    |-------------------------------------------------------------|
    |  001b  | Vendor-Specific                 | Vendor-Specific  |
    |-------------------------------------------------------------|
    |  010b  | Write data                      | Optional         |
    |-------------------------------------------------------------|
    |  011b  | Reserved                        | Reserved         |
    |-------------------------------------------------------------|
    |  100b  | Download microcode              | Optional         |
    |-------------------------------------------------------------|
    |  101b  | Download microcode and save     | Optional         |
    |-------------------------------------------------------------|
    |  110b  | Reserved                        | Reserved         |
    |-------------------------------------------------------------|
    |  111b  | Reserved                        | Reserved         |
    |-------------------------------------------------------------|

Note 93:
   Modes 00b and 001b are included for compatibility with CCS products
   that were designed prior to the generation of this international
   Standard.  These products restrict the maximum transfer length to
   65,535 bytes.

8.2.17.1 Combined header and data mode (000b)

In this mode, data to be transferred is preceded by a four-byte header.
The four-byte header consists of all reserved bytes.  The buffer ID and
the buffer offset fields shall be zero.  The parameter list length field
specifies the maximum number of bytes that shall be transferred during
the DATA OUT phase.  This number includes four bytes of header, so the
data length to be stored in the target's buffer is parameter list length
minus four.  The initiator should attempt to ensure that the parameter
list length is not greater than four plus the buffer capacity that is
returned in the header of the READ BUFFER command (mode 00b).  If the
parameter list length exceeds the buffer capacity, the target shall
return CHECK CONDITION status and shall set the sense key to ILLEGAL
REQUEST.

8.2.17.2  Vendor-specific move (001b)

In this mode, the meaning of the buffer ID, buffer offset, and
parameter list length are not specified by the International Standard.

8.2.17.3  Data mode (010b)

In this mode, the DATA OUT phase contains buffer data.  The buffer ID
field identifies a specific buffer within the target.  The vendor
assigns buffer ID codes to buffers within the target.  Buffer ID zero
shall be supported.  If more than one buffer is supported, additional
buffer ID codes shall be assigned contiguously, beginning with one.  If
an unsupported buffer ID code is selected, the target shall return CHECK
CONDITION status and shall set the sense key to ILLEGAL REQUEST with an
additional sense code of INVALID FIELD IN CDB.

Data are written to the target buffer starting at the location specified
by the buffer offset.  The initiator should conform to the offset
boundary requirements returned in the READ BUFFER descriptor.  If the
target is unable to accept the specified buffer offset, it shall return
CHECK CONDITION status and it shall set the sense key to ILLEGAL REQUEST
with an additional sense code if INVALID FIELD IN CDB.

The parameter list length specifies the maximum number of bytes that
shall be transferred during the DATA OUT phase to be stored in the
specified buffer beginning at the buffer offset.  The initiator should
attempt to ensure that the parameter list length plus the buffer offset
does not exceed the capacity of the specified buffer.  (The capacity of
the buffer can be determined by the buffer capacity field in the READ
BUFFER descriptor.)  If the buffer offset and parameter list length
fields specify a transfer that would exceed the buffer capacity, the
target shall return CHECK CONDITION status and shall set the sense key
to ILLEGAL REQUEST with an additional sense code of INVALID FIELD IN
CDB.

8.2.17.4  Download microcode mode (100b)

In this mode, vendor-specific microcode or control information shall be
transferred to the control memory space of the target.  After a
power-cycle or reset, the device operation shall revert to a
vendor-specific condition.

Microcode data are written to the target buffer id starting at the
location specified by the buffer offset.  If the target is unable to
accept the specified buffer offset, it shall return CHECK CONDITION
status and it shall set the sense key to ILLEGAL REQUEST with an
additional sense code if INVALID FIELD IN CDB.

The parameter list length specifies the maximum number of bytes that
shall be transferred during the DATA OUT phase to be stored in the
specified buffer id beginning at the buffer offset.  If the buffer
offset and parameter list length fields specify a transfer that would
exceed the buffer capacity, the target shall return CHECK CONDITION
status and shall set the sense key to ILLEGAL REQUEST with an additional
sense code of INVALID FIELD IN CDB.  When the microcode download has
completed successfully the target shall generate a unit attention
condition for all initiators.  When reporting the unit attention
condition, the target shall set the additional sense code to MICROCODE
HAS BEEN CHANGED.

8.2.17.5  Download microcode and save mode(101b)

In this mode, vendor-specific microcode or control information shall be
transferred to the target buffer and, if the WRITE BUFFER command is
completed successfully, also shall be saved in a non-volatile memory
space (semiconductor, disk, or other).  The downloaded code shall then
be effective after each power-cycle and reset until it is supplanted in
another download microcode and save operation.

When the download microcode and save command has completed successfully
the target shall generate a unit attention condition for all initiators.
When reporting the unit attention condition, the target shall set the
additional sense code to MICROCODE HAS BEEN CHANGED.

Microcode data are written to the target buffer id starting at the
location specified by the buffer offset.  If the target is unable to
accept the specified buffer offset, it shall return CHECK CONDITION
status and it shall set the sense key to ILLEGAL REQUEST with an
additional sense code if INVALID FIELD IN CDB.

The parameter list length specifies the maximum number of bytes that
shall be transferred during the DATA OUT phase to be stored in the
specified buffer beginning at the buffer offset.  If the buffer offset
and parameter list length fields specify a transfer that would exceed
the buffer capacity, the target shall return CHECK CONDITION status and
shall set the sense key to ILLEGAL REQUEST with an additional sense code
of INVALID FIELD IN CDB.  When the download microcode and save command
has completed successfully the target shall generate a unit attention
condition for all initiators.

8.2.17.6  Download microcode (and save) sequence

In both modes 100b and 101b, it shall be the responsibility of the
initiator to transfer all of the microcode in the microcode image, using
multiple WRITE BUFFER commands if necessary.  The target shall know that
all of the microcode data has been transmitted successfully when the
initiator issues a final WRITE BUFFER command, denoted by a Parameter
List Length set to zero.  This command must be the last WRITE BUFFER
command received by the target for this download microcode sequence.
The buffer id field for this command is undefined.  The mode field for
this command must be the same as the previous WRITE BUFFER commands.

Implementers Note:
   Interfaces which do not guarantee sequential delivery must ensure all
   previous WRITE BUFFER commands have successfully completed before
   delivering this last command.

After the first WRITE BUFFER command with modes set to 100b or 101b, any
commands from the initiator other than INQUIRY, TEST UNIT READY, REQUEST
SENSE, or additional WRITE BUFFER commands in the same mode, shall cause
the download sequence to be terminated and any microcode data received
to be discarded.  INQUIRY, TEST UNIT READY, or REQUEST SENSE commands
shall be the only commands allowed during this sequence from other
initiators.  Any other commands received shall be executed and shall
cause the target to terminate the download sequence.  Any microcode data
received to that point shall be discarded.  If the target terminates the
download sequence because of an improper command sequence, the target
shall cause CHECK CONDITION status and shall set the sense key to
ILLEGAL REQUEST with an additional sense key of COMMAND SEQUENCE ERROR
to be presented to the initiator originating the download sequence.

Implementers Note:
   It is highly recommended that the initiator reserve the target prior
   to initiating a download microcode sequence.

The link bit for the last WRITE BUFFER command shall be zero.  Other
link bits are optional.

After determining that all of the microcode data has been transferred to
the target, the target shall utilize a vendor-unique method for
verifying the new microcode data, and for transferring the new microcode
to the non-volatile storage (if the mode was download microcode and
save).

The new microcode shall not take effect until the target receives a
target reset.




More information about the T10 mailing list