Single Board Computers SCSI Software User’s Manual (SBCSCSI/D1)
Notice While reasonable efforts have been made to assure the accuracy of this document, Motorola, Inc. assumes no liability resulting from any omissions in this document, or from the use of the information obtained therein. Motorola reserves the right to revise this document and to make changes from time to time in the content hereof without obligation of Motorola to notify any person of such revision or changes.
Preface The Single Board Computers SCSI Software UserÕs Manual describes the SCSI Software, a building block for SCSI services. It is intended for developers who have a working knowledge of SCSI. In the context of this manual, SCSI Software describes the Firmware used to control the NCR53C710 SCSI I/O Processor (SIOP) used on the Motorola Single Board Computers containing that chip. It does not include operating system speciÞc device drivers.
Motorola¨ and the Motorola symbol are registered trademarks of Motorola, Inc. SYSTEM V/68, SYSTEM V/88, VERSAdos, and VMEexec are trademarks of Motorola, Inc. IBM is a registered trademark of International Business Machines, Inc. NCR, NCR 53C710, and SCSI SCRIPTS are registered trademarks of National Cash Register. UNIX¨ is a registered trademark of UNIX System Laboratories, Inc.
Contents General Information 1-1 Organization of This Manual 1-1 Conventions 1-2 Related Documentation 1-3 DeÞnition of SCSI 1-4 General Description of the SCSI Software 1-4 SIOP Firmware 1-5 Introduction 2-1 A Basic View of the SIOP Firmware 2-1 Firmware Interface 2-2 Division of Functional Responsibilities 2-3 Primary Functions of the Firmware 2-4 Primary Functions Required of the User 2-5 Functional Overview 2-6 Command Flow 2-6 Interrupt Mode 2-6 Polled Mode 2-7 Interrupt Mechanism 2-8 Message Handling
Debug Trace Memory Structure 5-2 Example 5-4 User Level Setup 5-4 Code Level Setup 5-5 Debug Trace Display 5-6 Firmware Debug Log Map 5-9 Firmware Debug Log Entry Descriptions 5-11 BERR 5-11 BRST 5-11 COMP 5-11 DISC 5-12 IDOV 5-12 INIT 5-12 INT 5-12 KICK 5-12 LCMP 5-13 MREJ 5-13 PMM 5-13 PVER 5-13 QEKO 5-13 RESL 5-14 SGE 5-14 SIID 5-14 STEP 5-14 STO 5-14 UDC 5-14 XMSG 5-15 XSTO 5-15 Use of the Firmware After Use by the SBC ROM Debugger 5-15 Cache Coherency 5-16 Local Bus Usage by the NCR 53C710 5-16 Target
Bit 16 -- DEVRST B-5 Bit 15 -- MIBUF B-6 Bit 14 -- MOBUF B-6 Bit 13 -- NO_ATN B-6 Bit 10 -- SIOPADD B-7 Bit 9 -- SIOPINT B-7 Bit 8 -- SCSIRST B-7 Bit 7 -- TAG_Q B-7 Bit 6 -- LINK B-8 Bit 4 -- S/G B-8 Bit 3 -- D_PH B-8 Bit 2 -- R/W B-8 Bit 1 -- ASYNC B-8 Bit 0 -- SYNC B-9 Device Address or SIOP Interrupt Level B-10 LUN B-10 CDB Length or Queue Depth B-11 CDB B-11 Message-In Length B-11 Message-In Buffer Pointer B-12 Message-In Bytes (0-B) B-12 Message-Out Length B-12 Message-Out Buffer Pointer B-13 Message-O
splhi C-2 splx C-3 ret_stat C-4 (de)serialize_memory_access C-5 Status Field D-1 status_key Error Codes D-1 SS_GOOD (0x00) D-1 SS_CHECK (0x02) D-1 SS_CM_GOOD (0x04) D-2 SS_BUSY (0x08) D-2 SS_I_GOOD (0x10) D-2 SS_I_CM_GOOD (0x14) D-2 SS_RSVCON (0x18) D-3 SS_CMDTERM (0x22) D-3 SS_QFULL (0x28) D-3 siop_key Error Codes D-4 SI_GOOD (0x00) D-4 SI_NOP (0x01) D-4 SI_SCSIRST (0x02) D-4 SI_DEVRST (0x03) D-4 SI_ABRT (0x04) D-4 SI_ABRTTAG (0x05) D-5 SI_CLEARQ (0x06) D-5 SI_DATAOV (0x07) D-5 SI_DATAUR (0x08) D-5 SI_CLK2
Overview E-1 Menu Item Descriptions E-3 Main Menu E-3 t167 Configuration E-3 SCSI Driver Library Development Tools E-4 NCR Firmware Development Tools E-4 SCSI Driver Library Tests E-4 NCR Firmware Tests E-4 help E-4 status E-4 quit E-4 exit E-4 t167 ConÞguration Menu E-4 Allocate New Control Structure Set E-5 Allocate New Data Buffer E-5 Display/Alter Data Buffer Parameters E-5 SDL and NCR Firmware Addresses E-6 Select Terminal Type E-6 SCSI Driver Library Development Tools Menu E-7 Build sdl_cmd Structure
Add a Second Data Buffer to the t167 Configuration E-20 Issue an INQIRY Command E-22 Issue a Format Command E-23 Issue Reads and Writes to a Disk Device E-24 Use of t167 with the NCR Firmware E-28 Initialize the NCR Firmware Interface E-28 Send SCSI INQUIRY to the Device E-29 Mode Sense Parameters E-32 Issue a Read Command to the Device E-34
List of Figures Firmware/User Interaction Block Diagram 2-3 Debug Trace Memory Structure 5-3 Directory Structure: bin, src, and lib Files A-2 Directory Structure: Include Files and SIOP Firmware A-2 Directory Structure: sdl Files (sheet 1 of 2) A-3 Directory Structure: sdl Files (sheet 2 of 2) A-4 t167 Submenus and Functions E-2
List of Tables C Call Interface 3-1 68K Assembler Interface 3-2 88K Assembler Interface 3-2 Firmware Display Frame Map 5-10 Firmware Display Data Map Key 5-11 Typical NCR 53C710 Local Bus Usage for SCSI Data Transfers 5-16 Command Structure B-2 Command Control Bit DeÞnitions B-3 Example Scatter/Gather List B-17 SIOP Clock Rates for VMEmodules B-19 Snoop Control Modes B-19 Debug Logging Initialization Values Structure B-23 SDL Direct Access Commands E-11 SDL Supported Sequential Access Commands E-12 Template
xiv
INTRODUCTION 1 General Information This chapter explains what SCSI is and what the SBC SCSI Software does to support SCSI-related hardware on selected Single Board Computers (SBCs). It also explains the meanings conveyed by the variety of fonts and special text symbols found throughout this manual. Most importantly, it assists in finding desirable information on these pages and elsewhere. N otes This userÕs manual documents the SBC SCSI Software Release 1.1.
1 Introduction Conventions The conventions used in this document are: bold for user input that you type just as it appears; also used for commands, options and arguments to commands, and names of programs, directories, and files. italic for names of variables to which you assign values; also used for comments in screen displays and examples. fixed font for system output (e.g., screen displays, reports), examples, and system prompts.
Related Documentation Related Documentation The publications are applicable to the SBCs and may provide additional helpful information pertinent to the use of the SCSI Software. If not shipped with this product, they may be purchased by contacting your local Motorola sales office. Non-Motorola documents may be obtained from the sources listed. Document Title SBC SCSI Software Release 1.
1 Introduction The following publications are available from the sources indicated. ANSI Small Computer System Interface-2 (SCSI-2), Draft Document X3.131198X, Revision 10c; Global Engineering Documents, P.O. Box 19539, Irvine, CA 92714. NCR 53C710 SCSI I/O Processor Data Manual, document #NCR53C710DM; NCR Corporation, Microelectronics Products Division, Colorado Springs, CO.
General Description of the SCSI Software SIOP Firmware The SIOP Firmware provides these unique features and facilities: ❏ Handles all aspects of SCSI protocol conformance. ❏ No firmware intelligence is imposed on the command requests issued to peripherals. ❏ Internally enqueues all command requests, in a linked list, until they can be dispatched to the SCSI bus; therefore, an unlimited number of command requests can be issued to the Firmware before status for any of them is received by the user.
1 Introduction 1-6 Single Board Computers SCSI Software UserÕs Manual
OVERVIEW 2 Introduction The following chapter is an introduction to the workings of the SIOP Firmware which is used to control the SCSI port on the SBCs. It is recommended that the reader have a working knowledge of SCSI. A Basic View of the SIOP Firmware The Firmware consists of the Motorola Microprocessor (MPU) code and the NCR SCSI SCRIPTS code (SCRIPTS) which work together to control the NCR 53C710 SCSI I/O Processor (SIOP). The MPU code provides the user interface to the SCSI bus.
Overview 2 Firmware Interface The SIOP Firmware has several externally accessible routines, or entry points, which may be called by the user to initiate Firmware action. The following is a brief summary of these routines. 2-2 siop_init() This routine is for Firmware initialization. The user calls this entry point to provide the Firmware with memory resources and basic SIOP operating parameters and to allow the Firmware to perform required initialization.
Division of Functional Responsibilities Division of Functional Responsibilities 2 The Firmware and the user have definite and separate responsibilities when communicating with SCSI devices. Basically, the Firmware manages the SCSI bus protocol while the user manages the device specifics. (See Figure 2-1.) The following sections provide details of these responsibilities.
Overview 2 Primary Functions of the Firmware The Firmware is designed to manage the SCSI bus protocol when interfacing to a device on the SCSI bus. The Firmware operates independently of any specific knowledge of devices on the SCSI bus. The Firmware handles the following aspects of SCSI protocol. ❏ Interpret Received Messages The Firmware automatically receives and processes the messages received from target devices.
Division of Functional Responsibilities ❏ Error Recovery 2 The Firmware supports only minimal error recovery. When an error condition is detected, the Firmware attempts to get the physically threaded device off the SCSI bus so the bus is free to send command requests to other SCSI devices or subsequent commands to the same device. Primary Functions Required of the User The following duties are required of a user when interfacing to the Firmware.
Overview 2 Functional Overview The following sections describe the functional attributes of the Firmware. A simplistic description of the flow of a command request through the Firmware is given. The SIOP interrupts are explained in some detail as are the Firmware responses to various SCSI messages which may be received. Command Flow The basic flow of the Firmware is followed as a command request is executed.
Functional Overview The first interrupt is generated by the SCRIPTS to notify the MPU code that the SIOP is not busy with any SCSI bus activity. The MPU code dequeues the next command structure (siop_struc) which is available for execution and initializes some SCRIPTS control structures. Next, the MPU code invokes the appropriate SCRIPTS entry point for the command request. Control of the MPU is returned to the user after the SCRIPTS begin execution.
Overview After the command request completes, the MPU code updates some fields in the command structure (siop_struc), updates Firmware queues, and then calls the user's return status routine. At this point, the siop_struc is back in the control of the user. The user may immediately call the Firmware through siop_cmd() to send a new command request; however, it is recommended that the user wait until the Firmware returns control of the MPU via the siop_cmd() return before sending any more command requests.
Functional Overview SCSI Gross Error This interrupt is generated when the SIOP detects an illegal condition in the SIOP bus control logic (e.g., an overflow of the SCSI FIFO) or and illegal condition on the SCSI bus (e.g., a phase change with an outstanding synchronous offset). The Firmware hangs if this interrupt occurs. INT Instruction This is the SCRIPTS programmed interrupt invoked by the INT instruction. Programmed interrupts cause the MPU code to handle situations which the SCRIPTS or SIOP cannot.
Overview Single Step 2 This interrupt is generated only in a special diagnostic mode enabled by recompiling the Firmware source code. If enabled, the SIOP generates an interrupt after the successful execution of each SCRIPTS instruction. Message Handling This section deals with the messages that may be received by the Firmware and the associated Firmware response. CMD Complete A SCRIPTS instruction clears the SCSI ACK signal to complete the MSG-IN phase and then waits for the BUS FREE phase.
Functional Overview Linked CMD Complete A linked command complete INT instruction interrupt is generated. This holds the bus in the MSG-IN phase while the Firmware sets up data structures for the next linked command. The MPU code restarts the SCRIPTS at an instruction which clears the SCSI ACK signal to complete the MSG-IN phase and then waits for the COMMAND phase.
Overview 2 2-12 Single Board Computers SCSI Software UserÕs Manual
FIRMWARE INTERFACE 3 Introduction This chapter defines the interface to the SIOP Firmware. The entry points, input parameters, and return parameters are also described in this chapter.
Firmware Interface Table 3-2. 68K Assembler Interface 3 Name Input Registers Output Registers siop_init init_vals 4 (A7) siopdatap 8 (A7) status D0 siop_cmd siop_struc (A7) siopdatap 8 (A7) status via status return routine siop_int siopdatap 4 (A7) sdt_tinit sdt_tvalue 4 (A7) sdt_alloc siopdatap 4 (A7) sfw_getrev string_buffer 4 (A7) siopdatap 8 (A7) &trace_entry A0 max_size 8(A7) bytes available D0 Table 3-3.
siop_init() siop_init() NAME siop_init ÑInitialize the SIOP Firmware 3 SYNOPSIS #include #include #include #include "scsi.h" "ncr.h" "ncr710.h" "scsi_err.
Firmware Interface ERROR CONDITIONS A successful call to siop_init() must be executed before any other access to the Firmware can be attempted. All non-zero return codes are fatal and require the problem to be remedied. The return codes are listed along with an explanation of their meaning and recommended remedy. 3 SI_GOOD (0x00) No errors. SI_BADCLKPAR (0x0A) A clock speed parameter was supplied that cannot be interpreted.
siop_init() NOTES ❏ The Firmware needs to be initialized only once but may be initialized many times as long as there are no outstanding command requests to the Firmware when siop_init() is called. If a user calls the initialization routine while commands are outstanding to the Firmware, then unpredictable results will occur. However, a user may call this module any number of times before calling the command entry module to reinitialize the firmware.
Firmware Interface siop_cmd() NAME 3 siop_cmd ÑSIOP Firmware command call SYNOPSIS #include #include #include #include "scsi.h" "ncr.h" "ncr710.h" "scsi_err.
siop_int() siop_int() NAME siop_int ÑSIOP interrupt handler 3 SYNOPSIS #include #include #include #include "scsi.h" "ncr.h" "ncr710.h" "scsi_err.h" /* /* /* /* SCSI specific definitions */ firmware structure definitions */ hardware/firmware specific definitions */ error definitions */ void siop_int(siopdatap) struct siopdata *siopdatap;/* SIOP Firmware global data pointer */ DESCRIPTION The interrupt handler routine is called by the code which is invoked when the SIOP interrupt occurs.
Firmware Interface sdt_tinit() NAME 3 sdt_tinit ÑInitialize the SCSI debug trace log SYNOPSIS #include "scsi.h" #include "scsi_dbg.h" #include "ncr.
sdt_tinit() Each time the user changes the location of the siopdata structure (changes the value of siopdatap) for a call to siop_init(), a new call to sdt_tinit with the new siopdata structure must be made to re-enable debug logging. For more detailed information concerning use of the debug log, refer to Chapter 5, Special Topics.
Firmware Interface sdt_alloc() NAME 3 sdt_alloc ÑAllocate a SCSI debug trace entry SYNOPSIS #include "scsi.h" #include "scsi_dbg.h" #include "ncr.h" /* SCSI specific definitions */ /* SCSI debug defines and macros */ /* firmware structure definitions */ struct trace_entry *sdt_alloc(siopdatap) struct siopdata *siopdatap; /* SIOP Firmware global data pointer */ DESCRIPTION The function of this routine is to return a pointer to a debug trace entry.
sfw_getrev() sfw_getrev() NAME sfw_getrev Ñ Return Firmware Revision String 3 SYNOPSIS #include "scsi.h" #include "ncr.h" #include "ncr710.h" #include "scsi_err.
Firmware Interface NOTES A max_size of 32 bytes should be adequate for all available data. If you must be sure, however, allocate space for string_buffer after determining the space available.
NCR BUILD TOOLS 4 Introduction The NCR build tools are a set of utilities provided to compile NCR SCSI SCRIPTS source modules. The utilities provided are the SCRIPTS compiler and the SCRIPTS preprocessor. The compiler, as written by the NCR Corporation, is used to compile general purpose SCRIPTS source files into executable NCR 53C710 machine instructions.
NCR Build Tools Example Usage of the NCR Build Utilities What follows is an extract from a Makefile showing an example .n.o make rule for compiling a SCRIPTS module. This example is specific to a SYSTEM V/68 host. For a SYSTEM V/88 host, N710P should be set to use n710p80k and N710C should likewise be set to n710c80k. TMPDIR = ./tmp_hdrs INCDIR = ../incl 4 CPP N710C N710P = cc -E = n710c68k = n710p68k PFLAGS = -Um68k -UsysV68 -Um88k -Uunix -I$(INCDIR) EXTHDRS= $(INCDIR)/ncr.h \ $(INCDIR)/ncr710.
Example Usage of the NCR Build Utilities N ote With the following explanations, refer to the numbered columns to the left of the Ò.n.oÓ make rule shown above. Line(s) Function 1 Create a directory, TMPDIR, into which Þltered headers will be placed. 2-6 Strip the headers down to only the single-line preprocessor directives. 7 8-10 Use sed to remove blank lines, unknown compiler directives, and other cpp ejecta which are meaningless to the build utilities (or worse).
NCR Build Tools n710p68k (n710p80k) NAME n710p68k (n710p80k) ÑPreprocessor for NCR SCSI SCRIPTS files SYNOPSIS 4 extern extern unsigned relocation[]; unsigned script_ptr[]; n710p68k file DESCRIPTION The n710p68k (n710p80k) is the NCR SCSI SCRIPTS preprocessor resident on an MC68xxx (MC88100) host that preprocesses a single SCRIPTS file prior to compilation by the SCRIPTS compiler.
n710p68k (n710p80k) The script_ptr[] array contains pointers to the starting location of each SCRIPTS declared with a PROC n710c68k (n710c80k) compiler directive. Array indexes used to access script_ptr[] array elements are global integer variables generated by the preprocessor and placed in the output file file.i. The variable name of an array index is formed from the name of the SCRIPTS array, with the suffix "_idx" appended.
NCR Build Tools All SCRIPTS instructions must be contained within a single source module. The identifiers rel_d, rel_c, and NCROF are reserved and may not be used in the SCRIPTS source code. The SCRIPTS PROC labels relocation and first_datap are reserved.
n710c68k (n710c80k) n710c68k (n710c80k) NAME n710c68k (n710c80k) ÑCompiler for NCR SCSI SCRIPTS files SYNOPSIS n710c68k file [options] [outfile] 4 DESCRIPTION The n710c68k (n710c80k) is the NCR SCSI SCRIPTS compiler for the NCR 53C710 SCSI I/O Processor resident on an MC68xxx (MC88100) host that translates SCRIPTS contained in file to C language integer arrays of NCR 53C710 opcodes and operands. The compiled outfile may then be compiled by a C language compiler to produce an outfile.o object file.
NCR Build Tools -o outfile This option determines if a C-compilable data file is generated and if so what the name of the file is. If the -o is given without specifying a filename, the output filename defaults to a file.out. -u When this option is set, the definitions INSTRUCTIONS and PATCHES in the output file is suppressed. This option is necessary if two or more output files are being linked together.
SPECIAL TOPICS 5 Introduction This chapter covers topics which most users will not use in the normal course of SCSI operation. It is provided as a guide for those who wish to exercise the full functionality of the Firmware. Firmware Debug Logging This section describes the operation of the Firmware debug trace mechanism. Debug tracing is useful when problems are encountered while accessing the SCSI bus through the Firmware. The debug trace can reveal the source of many functional discrepancies.
Special Topics After logging is enabled, a user calls sdt_alloc() to get a pointer to the next entry to be used for debug logging. A user makes this call from within a section of code which is suspected to introduce problems or when critical information is available to be saved in the log. The final step in debug logging is retrieval and analysis of the logged information. This is done after a problem has occurred and the user is trying to determine the source of that problem.
Firmware Debug Logging High Memory sdt_tvalue.end -> | First Log Entry | start-> | Second Log Entry | : | : | : | 5 | Current Entry | sdt_tvalue.current -> : | : | : | | Last Log Entry - 1 | | Last Log Entry | Special First Entry sdt_tvalue.begin -> | ↓ Low Memory Figure 5-1.
Special Topics Example This section shows, through example, how to enable debug logging, how to record debug information in a trace entry, and how to display the log. A ROM debugger will be used to initialize the sdt_tvalue structure and display the log. The information which will be displayed is from currently embedded log entry points in the Firmware. Examples shown here use the MVME167 ROM debugger; however, these same commands can be used with the other ROM debuggers.
Firmware Debug Logging 4. Clear the debug trace memory area using the BF command. 167-Bug>bf 400000 800000 0 Effective address: 00400000 Effective address: 007FFFFF 167-Bug> 5. sdt_tvalue is initialized to enable debug logging but debug logging is not yet enabled. To enable debug logging and to log some debug trace entries, execute an IOP command to a local SCSI device.
Special Topics The following procedure was adhered to in the above code. 5 1. If the global value sdt_flag located in siopdata is set to an ASCII 'D' (0x44) then continue with the trace operation. 2. Raise the interrupt mask using the function splhi() (refer to Appendix C). Save the return value so it can be restored upon completion of the trace. 3. Call the function sdt_alloc() to get a pointer to a debug log entry. 4. Set the eyepicker to a unique four byte ASCII string.
Firmware Debug Logging have been extra bytes in which a trace entry would not fit. sdt_alloc() uses this field to determine the bounds of the log when a wraparound situation occurs. 0x0C - Current This is a pointer to the last trace entry which was logged. 0x10 - 68K This is an eyecatcher to inform the user that the next field (68Ksize) is the number to specify when displaying a trace entry with the 68K ROM debugger MD command.
Special Topics 167-Bug> 007FD1A0 007FD1B0 007FD1C0 007FD1D0 007FD1E0 007FD1F0 007FD200 007FD210 007FD220 007FD230 007FD240 007FD250 007FD260 007FD270 007FD280 007FD290 007FD2A0 007FD2B0 007FD2C0 5 167-Bug> 007FD2D0 007FD2E0 007FD2F0 007FD300 007FD310 007FD320 007FD330 007FD340 007FD350 007FD360 007FD370 007FD380 007FD390 007FD3A0 007FD3B0 007FD3C0 007FD3D0 007FD3E0 007FD3F0 167-Bug> 5-8 4E43 0000 0F00 FFF4 0000 0083 0000 0000 0000 0000 0000 0000 0103 0000 0000 0000 0000 0000 0000 5220 0000 0000 7021 6
Firmware Debug Logging Firmware Debug Log Map The following section explains the fields within a Firmware trace entry. The generic trace entry, as defined in the header file scsi_dbg.h, is: struct trace_entry { UINT eyepicker; UINT eyecatcher; UCHAR data[LARGE_AMOUNT]; }; All Firmware trace entries will contain an eyepicker entry of NCR that identifies this as a Firmware trace entry (as opposed to a driver trace frame) and an eyecatcher label that identifies the unique log point within the Firmware.
Special Topics The mapping table below shows the relative placement of all structures and structure elements for a typical screen display. For a given Firmware log entry, some combination of these elements will be valid. Table 5-1.
Firmware Debug Logging The mapping table below shows which fields are valid for the given Firmware debug logging entry point. The entry points are listed according to the eyecatcher field. Table 5-2. Firmware Display Data Map Key Frame Byte Range Variable Group Valid at Eyecatcher Entries Structure Name Header File 0x08 through 0x13 NCR 53C710 opcodes STEP instX ncr710db.h 0x14 through 0x53 SIOP H.W. Registers ALL EXCEPT INIT, CMD ncr_siop ncr710.
Special Topics DISC 5 structures logged- ncr_siop, siop_cns, siop_struc description- The SCRIPTS received a disconnect message for the current physically threaded command. The state of the SCSI command was saved. If another command request was on the ready queue, it was enqueued for SCRIPTS command execution, otherwise, the SCRIPTS were placed in an idle loop.
Firmware Debug Logging LCMP structures logged- ncr_siop, siop_cns, siop_struc description- The SCRIPTS received a linked command complete message for the current physically threaded command. The Firmware enqueues the next linked siop_struc for SCRIPTS command execution. structures logged- ncr_siop, siop_cns, siop_struc description- The SCRIPTS received an message reject message in response to a message sent to the target for the current physically threaded command.
Special Topics RESL structures logged- ncr_siop, siop_cns, siop_struc description- A valid reselection occurred. A device for which a siop_struc is available, reselected the SIOP. The state of the command is restored and the SCRIPTS are invoked to continue execution of the command request. structures logged- ncr_siop, siop_cns description- The SIOP has experienced a SCSI hardware error. No recovery action is instituted.
Use of the Firmware After Use by the SBC ROM Debugger XMSG structures logged- ncr_siop, siop_cns, siop_struc description- The SCRIPTS received an extended message for the current physically threaded command. The Firmware copies the received message into the MESSAGE-IN buffer and acts upon the message if it was a synchronous data transfer request or wide data transfer request message.
Special Topics Cache Coherency 5 The user is responsible for making sure all of the memory used by the Firmware is cache coherent. This includes the Firmware data area (siopdata), the command structure (siop_struct), and all buffers contained within the command structure. Generally, the proper snoop mode setting (refer to Table B-5) handles cache coherency for all onboard memory on MotorolaÕs 68040and 88110-based SBCs.
Target Mode Target Mode (THIS INFORMATION WILL BE AVAILABLE ONLY IN A FUTURE RELEASE.
Special Topics 5 5-18 Single Board Computers SCSI Software UserÕs Manual
DIRECTORY STRUCTURE A Miscellaneous files used for the SCSI Software for the compiler and preprocessor binaries are mentioned in Chapter 4. These files are located under bin. Other unsupported files are located under src and lib. See Figure A-1. The SCSI Software is mostly organized under a single directory, sbc_scsi. Under this directory are two main subdirectories for the include files and the SIOP Firmware. See Figure A-2.
A Directory Structure /. bin/ src/ lib/ task/ sbc_scsi/ continued on n710c68k n710c68k.ELF (NOTE 1) n710c80k n710c88k.ABI n710csun3 (NOTE 1) n710csun4 (NOTE 1) n710p68k n710p68k.ELF (NOTE 1) n710p80k n710p88k.ABI n710psun3 (NOTE 1) n710psun4 (NOTE 1) ncr710cc/ t167/ 88100/ 68040/ libsbc.a libsbc.a next figure files npp710.c (NOTE 2) NOTES: 1. THESE FILES ARE NOT SUPPORTED. 2. VMEexec LIBRARIES ARE PROVIDED IN COFF FORMAT. THEIR CONTENTS ARE BUILT FROM THE SOURCE FILES SHOWN IN FIGURE A-2.
A sbc_scsi/ sdl/ (NOTE) continued on next sheet devices/ archive.c ccsdev.c cdrom.c dad_ccs.c dev_tbl.c exabyte.c nodev.c teacf.c toshiba.c wren.c wren3.c sdlmgr/ sdlatch.c sdlcmd.c sdlstat.c cdromcmd/ start/ prevent/ fdiskcmd/ common/ attach/ attach/ common/ read/ format/ cdstart.c cdprevnt.c toshctl.c toshejct.c toshload.c toshstop.c toshstrt.c cdatch.c attach/ atch_inq.c frstinq.c tsturdy.c write/ scatgat/ teac_sel.c flp_cvrt.c flpread.c flpwrite.c teacatch.c teachsel.c flpscat.
A Directory Structure sbc_scsi/ sdl/ (NOTE) continued from previous sheet diskcmd/ attach/ deffmt/ asgnalts/ dadatch.c dadsel.c dadsen.c dkfmtcfg.c dksen.c dkstrt.c postatch.c wrenatch.c wrensel.c reserve/ read/ format/ dkfmtdef.c dkseldef.c dksendef.c readcap/ diskread.c dkresv.c dkrdcap.c dkrtncap.c scatgat/ write/ saferead/ diskscat.c dkrsf10b.c dkrsf6b.c dkfmt.c wmfmtcfg.c diskwrite.c tapecmd/ common/ read/ saferead/ dkalts.c scatgat/ write/ space/ allow.c taperead.c prevent.
SIOP FIRMWARE STRUCTURES B Introduction This appendix lists all of the structures which are external to or defined by the SIOP Firmware and which must be provided by the code using the services of the Firmware. siop_struc (Command Structure) The command structure contains all the information necessary to manage a single call to the SIOP Firmware. This structure is initialized by the user and allocated to the Firmware when the user makes a command call to the Firmware.
SIOP Firmware Structures B Table B-1.
siop_struc (Command Structure) User ID B The user ID field is for user command logging. This field is not examined by the Firmware nor is it altered by the Firmware. Command Control The command control field designates the mode in which the Firmware operates. The three mode bits, INTATR, TARGET, and CONFIG, are mutually exclusive. The Firmware can operate in only one mode per command request.
SIOP Firmware Structures B Bit 30 -- TARGET If the INTATR bit is not set and the TARGET bit is set then the Firmware operates in target mode. This bit designates the information in the structure to contain control information in regards to a target mode request as indicated by either the T_EXEC or T_WAIT bit in this field. The T_EXEC and T_WAIT bits are mutually exclusive. Other bits in the command control field are examined and used as indicated by their target definitions.
siop_struc (Command Structure) Another use of this bit is when sending a request sense command in response to a CHECK status received for some command to a device. The request sense command must be sent before any other commands to prevent the CHECK condition from being cleared before the user can find out the reason for the CHECK status. Bit 16 -- DEVRST initiator mode If set, the command structure allocated to the Firmware contains a bus device reset message in the first byte of the message out field.
SIOP Firmware Structures B Bit 15 -- MIBUF initiator mode If set, defines the message-in buffer pointer field to contain a pointer to a buffer where messages from the target are to be saved. If clear, the messages are saved in the 12-byte message-in field and the message-in buffer pointer field is initialized by the Firmware. It is recommended to NOT set the MIBUF in the command control field for normal operation; this feature of the Firmware is intended to be used for very long extended messages.
siop_struc (Command Structure) Bit 10 -- SIOPADD B config mode If set, the Firmware sets the SCSI address at which the SIOP resides. The user designates the address in the device address field of the command structure. Bit 9 -- SIOPINT config mode If set, the Firmware installs the interrupt level at which the SIOP Firmware interrupts the MVME167/MVME187 MPU. The user designates the interrupt level in the SIOP interrupt level field of the command structure.
SIOP Firmware Structures B Bit 6 -- LINK initiator mode If set, command in the CDB has the link bit set. The link field in the command structure must point to the next command structure to be used. This bit must be set for linked commands so the Firmware does not flag a linked command operation as a protocol violation. Bit 4 -- S/G initiator mode If set, scatter/gather is used for data transfers. The user must supply a scatter/gather list.
siop_struc (Command Structure) Bit 0 -- SYNC B initiator mode If set, the Firmware initiates negotiations for synchronous data transfers. The SIOP initiates negotiation for the maximum offset it supports and the fastest period possible. If a synchronous data transfer rate has been established then the user should clear this bit to avoid unnecessary negotiations.
SIOP Firmware Structures B Device Address or SIOP Interrupt Level initiator mode The user initializes the device address field with the SCSI address of the device to be accessed. For example, a command for SCSI address 4, LUN 2 would need a 0x00000004 placed in this field. config mode TAG_Q bit setThe user initializes the device address field with the SCSI address of the target device that supports tagged command queuing. For example, SCSI address 6, LUN 1 would need a 0x00000006 placed in this field.
siop_struc (Command Structure) CDB Length or Queue Depth B initiator mode The CDB length field contains the length of the CDB, in bytes, that the user wants to be transferred during the command phase. CDB lengths defined by the SCSI specification are 6, 10, and 12 bytes. config mode TAG_Q bit setThe user initializes this field with the maximum number of SCSI commands the target LUN can queue at a time.
SIOP Firmware Structures B Message-In Buffer Pointer This field may be modified by the Firmware. initiator mode If the MIBUF bit is set, the message-in buffer pointer field contains the starting address where a message from the target is to be stored. It is recommended to not set the MIBUF in the command control field for normal operation; this feature of the Firmware is intended to be used for very long extended messages. If the MIBUF bit is cleared, this field is initialized by the Firmware.
siop_struc (Command Structure) Message-Out Buffer Pointer B This field may be modified by the Firmware. initiator mode If the MOBUF bit is set, the message-out pointer field contains the address where a message to the target is placed. Normally, the user does not need to supply any messages to send to the target. It is recommended to not set the MOBUF bit in the command control field for normal operation; this feature of the Firmware is intended to be used for very long extended messages.
SIOP Firmware Structures B Data Pointer or Scatter/Gather List Pointer This field may be modified by the Firmware. initiator mode The data pointer field contains a pointer to a buffer where data is transferred to/from. If the S/G bit is set in the command control field then this field contains a pointer to a scatter/gather list. The scatter/gather list must be aligned on a four-byte boundary (longword boundary for the CISC MVME167; word boundary for the RISC MVME187).
siop_struc (Command Structure) Status B initiator mode The status field contains status concerning the target device, Firmware, and SCSI bus. The least significant byte in this field contains the status received from the target during the status phase of the SCSI command. The second least significant byte in this field contains an error code generated by the Firmware if a Firmware detected error occurred.
SIOP Firmware Structures B Work Area initiator mode The work area fields are used by the Firmware to save, change, or amend device and command dependent parameters and statuses.
Scatter/Gather List Scatter/Gather List B The scatter/gather list is initialized by the user and allocated to the Firmware with the command structure. The Firmware may modify the scatter/gather list in the case of a disconnect. Below is an example of a scatter/gather list with two entries. For this example list, the user would place 0x00004000 in the Scatter/Gather List Pointer (Data Pointer) field of the command structure and set the S/G bit in the command control field.
SIOP Firmware Structures B siop_init (Firmware Initialization Structure) This is the data structure passed to the siop_init() entry point.
siop_init (Firmware Initialization Structure) The following table lists the SCLK rate on Motorola VMEmodules: B Table B-4. SIOP Clock Rates for VMEmodules VMEmodule MPU Clock SIOP Clock MHz MHz 25 50 50000000 (0x02FAF080) 33 66 66666666 (0x03F940AA) 50 50 50000000 (0x02FAF080) 167 187 167 187 197 Hz snoopmode The SIOP has snoop control output lines which are compatible with the snoop control inputs of the MC68040 and MC88110.
SIOP Firmware Structures B script_ptr The user initializes this field to the globally defined value of the SCSI Script pointer array (extern unsigned script_ptr[]) which is created by the preprocessor to the NCR SCRIPTS compiler.
Initialization Structure (depreciated version) Initialization Structure (depreciated version) B The INITPARS structure is archaic. It is defined here in order to support compatibility with existing code. Please switch to using its replacement, the INIT_TYPE_1 structure.
SIOP Firmware Structures B Pointer to Script Pointer Array Same definition as in the INIT_TYPE_1 structure.
sdt_tinit (Debug Logging Initialization Structure) sdt_tinit (Debug Logging Initialization Structure) B Some of the initialization values which are used by the debug logging initialization routine, sdt_tinit, are contained in a structure. A pointer to this structure is passed into the initialization routine. The fill bytes in the structure are unused at the current time and it is recommended to clear these bytes. Table B-6.
SIOP Firmware Structures B B-24 Single Board Computers SCSI Software UserÕs Manual
EXTERNAL ROUTINES C Introduction The SCSI Software requires services to be provided external to the SCSI Software itself. These services must be provided by the specific application. There are two global services which must be provided: splhi A routine used to mask interrupts from the NCR 53C710 SCSI chip. This may be a null routine if the specific application of the SCSI Software uses the software in polled mode (i.e., at interrupt level 0).
External Routines splhi NAME C splhi ÑMask interrupts SYNOPSIS UINT splhi() DESCRIPTION The splhi routine masks interrupts from the NCR 53C710 SCSI chip. This routine is normally used in conjunction with splx. Example: level = splhi(); /* mask interrupts */ /* code that cannot be interrupted goes here */ splx(level); /* go to previous priority level */ RETURN VALUE splhi is always successful and returns the previous interrupt priority level.
splx splx NAME splx ÑRestore Interrupt Priority Level C SYNOPSIS UINT splx(level) UINT level; /* previous Interrupt Priority Level */ DESCRIPTION The splx routine restores the interrupt priority level following a call to splhi. This function is normally used in conjunction with splhi. level is hardware specific and is not guaranteed to be in the range 0 through 7.
External Routines ret_stat NAME C ret_stat ÑNotify User of Command Completion SYNOPSIS void ret_stat(cmd) struct siop_struc *cmd; /* completed command structure */ DESCRIPTION The ret_stat routine is user-supplied code which executes when a command request to the Firmware is completed. A pointer to this routine must be installed in the status_ptr field of each siop_struc used by the Firmware. This routine should check the status field of the returned siop_struc to determine if any errors occurred.
(de)serialize_memory_access (de)serialize_memory_access NAME serialize_memory_access Ñ Enforce serialized access to I/O memory C deserialize_memory_access Ñ Allow out-of-order access to I/O memory SYNOPSIS void serialize_memory_access() void deserialize_memory_access() DESCRIPTION Many processors execute and complete load and store instructions in the order in which they are encountered.
External Routines RETURN VALUE none C ERROR CONDITIONS none NOTES No calls may be made to the SCSI Firmware from within these routines. Your compilation tools or run-time environment may already supply routines similar to these. Or, they may provide C-language interfaces to modify processor registers, eliminating the need for you to code these routines in assembly language.
RETURNED ERRORS D Status Field Command status returned in the status field of siop_struc is subdivided into the following structure as extracted from the header file ncr.h.
Returned Errors SS_CM_GOOD (0x04) This is the SCSI status of CONDITION MET. This status is returned whenever certain SCSI operations, such as search data, are satisfied. This should be interpreted as a good status by the user with no corrective action necessary. SS_BUSY (0x08) D This is the SCSI status of BUSY. This status indicates that the target is busy. This status is returned whenever a target is unable to accept a command from an otherwise acceptable initiator.
status_key Error Codes SS_RSVCON (0x18) This is the SCSI status of RESERVATION CONFLICT. This status is returned whenever an initiator attempts to access a logical unit that is reserved exclusively for another SCSI initiator. This error indicates that in a multiple initiator system another initiator has locked a target device. The simplest recovery attempt is to retry this command at a later time in hopes that the device has since become released.
Returned Errors siop_key Error Codes For the field siop_key, the following error codes are listed along with an explanation of their meaning and recommended response. Some of these errors are also returned for an siop_init() call, in which case, they are located in the LSB of the returned value. D SI_GOOD (0x00) Current command has completed successfully. No corrective action is necessary. SI_NOP (0x01) An siop_struc was sent with no command mode bit (i.e.
siop_key Error Codes SI_ABRTTAG (0x05) This status is returned only for target mode commands outstanding to the Firmware. It indicates that a SCSI abort tag message has been received by the Firmware in target mode for the specified logical unit. If the target task supports tagged queuing, it should abort only the current I/O. SI_CLEARQ (0x06) D This status is returned only for target mode commands outstanding to the Firmware.
Returned Errors SI_CLK2FAST (0x09) This error is returned during Firmware initialization. The initialization parameter, initval.clk_speed, contains an ASCII numeric value greater than 7500 (0x37353030) which represents a clock speed greater than 75 MHz. SI_BADCLKPAR (0x0A) D This error is returned during Firmware initialization. The initialization parameter, initval.clk_speed, contains a character that is not a valid ASCII equivalent of the decimal values 0 through 9 (0x30 through 0x39).
siop_key Error Codes SI_BERRCMD (0x0F) This status if returned if a bus error occurs when the SIOP is attempting to access the local bus while it is physically threaded to a SCSI device in any phase other than a SCSI bus DATA PHASE (i.e., BERR while sending a CDB out to a target). The Firmware gets the target device off the SCSI bus before returning this error code. The err_addr field of the siop_struc points to the fault address.
Returned Errors SI_UPC (0x12) This error is returned when the Firmware detected an unexpected phase change in a target device to which it was physically threaded. This condition may be caused by a problem on the device or with the SCSI bus itself. The Firmware gets the target off the SCSI bus before returning this error code. The user should retry this command at least once in an attempt to recover from some random or transient problem with the target.
siop_key Error Codes SI_PVE04 (0x17) This protocol violation error is returned when a physically threaded target device does not transition to one of the following phases from the MSG-OUT phase: CMD, STATUS, DATA-IN, DATA-OUT, MSG-IN, MSG-OUT. Transitions to any other phase result in a protocol violation. SI_PVE05 (0x18) This protocol violation error is returned when a physically threaded target device transitions to an incorrect phase following either the DATA-IN or DATA-OUT phase.
Returned Errors SI_BADPATCH (0x1E) D This error is returned during Firmware initialization. The SCRIPTS program which patches the run-time SCRIPTS received an interrupt other than a SCRIPTS INT instruction interrupt. Possible error interrupt sources are bus fault, abort and illegal instruction. The invalid interrupt source read from the SIOP DSTAT register is not returned to the user. SI_NOSCSIBUS (0x1F) During Firmware initialization, the SCSI bus is monitored and was found to be in an illegal state.
t167 TEST PROGRAM E Introduction This appendix describes t167, a test program that can be used with the SBC SCSI Software. The test program is primarily used to send commands to the SIOP Firmware. The test program can also be used to send commands to the SBC SCSI Driver Library (SDL). The SDL is not described in any User's Manual. It is given out as unsupported source on the Single Board Computers SCSI Software Release Tape. Refer to the SBC SCSI Software Release 1.
t167 Test Program SBC SCSI SOFTWARE TESTMAIN MENU (t167) E CONFIGURATION MENU NCR FIRMWARE DEVELOPMENT TOOLS MENU NCR FIRMWARE TESTS MENU (1) cnfg (3) fwdt (5) fwtst (1) newcs (2) newdb (3) dbp (4) addr (5) term (1) bldfwcs (2) fwinit (3) fwcmd (4) dspcdb (5) dspfwcs (6) dspfwstat (7) dspdb (8) reset (1) auto (2) func (3) bound (4) stress (5) perf (6) reset SDL DEVELOPMENT TOOLS MENU SDL TESTS MENU (2) sdldt (4) sdltst (1) bldsdlcs (2) sdlinit (3) sdlread (4) sdlwrite (5) sdlcntrl (6) dspsdlc
Menu Item Descriptions Menu Item Descriptions Main Menu t167 contains five major menu items which can be selected.
t167 Test Program SCSI Driver Library Development Tools This submenu provides access to a number of functions which are useful when working with the SDL. From this menu, a user may build and issue SDL commands. Once a command has been executed by the SDL, other menu selections permit the user to inspect the results returned by the SDL. NCR Firmware Development Tools This submenu provides access to the SIOP Firmware. From this menu, a user may build and issue SIOP commands.
Menu Item Descriptions Item Name Description 1 newcs Allocate New Control Structure Set 2 newdb Allocate New Data Buffer 3 dbp Display/Alter Data Buffer Parameters 4 addr SDL and NCR Firmware Addresses 5 term Select Terminal Type h help Display this menu s status Status of previous command q quit Return to previous menu x exit Exit from t167 E Allocate New Control Structure Set Several structures are used to pass parameters to the SDL and SIOP Firmware.
t167 Test Program SDL and NCR Firmware Addresses The entry points into the SDL and SIOP Firmware are maintained as variables which are initialized at run time to the addresses of the SDL and SIOP Firmware modules linked with t167. This menu item displays the current addresses. Select Terminal Type Certain data displays are capable of overwriting displayed values rather than scrolling. Support for this option requires knowledge specific to the terminal in use. One terminal type is defined at this time.
Menu Item Descriptions SCSI Driver Library Development Tools Menu This submenu provides access to a number of functions which are useful when working with the SDL. From this menu, a user may build and issue SDL commands. Once a command has been executed by the SDL, other menu selections permit the user to inspect the results returned by the SDL.
t167 Test Program The display commands can produce large amounts of output data. Listing control is built into these commands to limit display pages to 24 lines or less. As with the parameter prompts, a '.' or 'x' entered at a paging prompt causes the command or t167 to terminate. Build sdl_cmd Structure This command is used to completely configure a t167 control structure prior to the execution of an SDL command. Any allocated control structure may be configured.
Menu Item Descriptions Issue sdl_write Command The SDL is entered through the sdl_write entry point. Unless specified on the command line, the user is prompted for an allocated control structure number. Status is displayed upon completion of the sdl_write command. Command format: sdlwrite [-c] sdlwrite If the 'c' option is selected, the current (last specified) control structure is used. A control structure may not be specified if this option is selected.
t167 Test Program Display Data Buffer Contents The contents of the data buffer pointed to by the current SDL control structure are displayed, in the format shown below. The first and last addresses of the selected buffer are also displayed.
Menu Item Descriptions Table E-1.
t167 Test Program Table E-2.
Menu Item Descriptions NCR Firmware Development Tools Menu This submenu provides access to a number of functions which are useful when working with the SIOP Firmware. From this menu, a user may build and issue commands to the SIOP Firmware. Once a command has been executed, other menu selections permit the user to inspect the results returned by the SIOP Firmware.
t167 Test Program The display commands can produce large amounts of output data. Listing control is built into these commands to limit display pages to 24 lines or less. As with the parameter prompts, a '.' or 'x' entered at a paging prompt causes the command or t167 to terminate. Build F/W Control Structure Interactive function which prompts user for values necessary to create an SIOP Firmware command.
Menu Item Descriptions Data buffer contents display example: Offset Hexadecimal Value db[0]: First address = 0x1fbdca0 ASCII Equivalent Last address = 0x1fbe09f 60 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F `abcdefghijklmno 70 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F pqrstuvwxyz{|}~. Command format: dspdb [-c] [-bbuffer] E offset is number of bytes from beginning of buffer at which buffer display is to begin. length is total number of bytes to display.
t167 Test Program Menu Expansion New menus are added by creating a uniquely-named menu structure and adding a menu_item structure with the address of the new menu to a parent menu. The total number of menu selections within a menu is MAX_ITEMS. If fewer selections are contained within a menu, the final menu_item structure should be MENU_END. Each menu should also contain a help selection, which contains a pointer to the pseudo-function MENU_HELP.
Adding SDL Tools Support for New Devices Table E-3. Template Files Device Type File Array direct-access, Þxed-media devices, i.e., conventional hard-disk drives "t167daf.c" sdp_daf[ ] direct-access, removable-media devices, i.e., ßoppy-disk drives "t167dar.c" sdp_dar[ ] sequential-access devices, i.e., streaming tape drives "t167sad.c" sdp_sad[ ] E 3. Edit "file.c", altering all parameters required to support the new device as required.
t167 Test Program Example Use of t167 This section describes the typical use of t167. Once it is loaded and executing, these step-by-step examples can be followed to gain an understanding of the overall operation.
Example Use of t167 2. The user MUST select menu item 2 (sdlinit) prior to issuing any other commands to the SDL. Answer with a to select the defaults as shown below: SDL Tools --> 2 SCSI address (7): Interrupt level (0): Clock frequency ('2500'): Snoop-mode (0): sdl_init status: 0x0 SDL Tools --> 3. The user MUST next select menu item 1 (bldsdlcs) to conÞgure for an ATTACH command to the device prior to issuing any other commands to the SDL. Answer as shown in the example below.
t167 Test Program SDL Tools --> 5 Control structure [0] (0): sdl_cntrl status: 0x0 SDL Tools --> A status of 0 indicates a good ATTACH. Add a Second Data Buffer to the t167 Configuration In order to issue an SDL INQIRY command to the device, t167 must have a second data buffer allocated of length less than the 0xff byte maximum allowed by the SCSI-2 when issuing an INQUIRY to a device. This procedure demonstrates the creating of such a buffer. E 1.
Example Use of t167 3. At the t167 conÞguration menu, select item 2, to create a new data buffer. t167 Configuration Item ---1 2 3 4 5 h s q x Name -----newcs newdb dbp addr term help status quit exit t167 Config --> 4.
t167 Test Program Issue an INQIRY Command 1. To issue an SDL INQIRY command to the device, build a new control command through menu selection 1. Here, input INQIRY instead of ATTACH. (Note that entry for the SDL command can either be the ASCII name or the command code, both obtained from the tables presented earlier.
Example Use of t167 3.
t167 Test Program 1. Select menu item 1 to set up the command structure for a format command. SDL Tools --> 1 Control structure [0] (0): Structure type (control or read/write) [c, r] (c): Device type (direct or sequential access) [d, s] (d): Medium type (fixed or removable) [f, r] (f): 32-bit SCSI device number (0, 0x0): Command (0xA, INQIRY): FORMAT FmtData bit (clear or set) [c, s] (clear): c CmpLst bit (clear or set) [c, s] (clear): c Defect list formats: E 0. 4. 5. 6.
Example Use of t167 1. Use the q command to go from the current menu to the main t167 menu and select menu item 1, t167 cnfg. 2. In the cnfg menu, select item 3 to display the current data buffer parameters. Use this function to get the address and size of data buffer 0.
t167 Test Program 4. Issue the go (G) command to the MVME167/187 ROM Debugger and hit an h to repaint the t167 screen. Go back to the SDL screen, and initialize the command structure for a write. SDL Tools --> 1 Control structure [0] (0): Structure type (control or read/write) [c, r] (c): 32-bit SCSI device number (0, 0x0): Data buffer [0, 1] (0): Logical block count (33372840, 0x1FD3AA8): 2 Logical block number (33287760, 0x1FBEE50): 0 SDL Tools --> E 5.
Example Use of t167 7. Press the ABORT switch on the front panel and use the MVME167/187 ROM Debugger block Þll (BF) command to re-write the data buffer to zeros.
t167 Test Program Use of t167 with the NCR Firmware Use of t167 with the NCR Firmware is described in this section. This is the lowest level of interface to the local SCSI bus, and allows the user to build direct SCSI commands (CDBs) to devices on the SCSI bus. Initialize the NCR Firmware Interface The following procedure MUST be executed prior to issuing any other commands to the Firmware. 1.
Example Use of t167 Send SCSI INQUIRY to the Device Building commands at the Firmware interface level requires the construction of an siop_struc command structure (described in Appendix B). The initialization of the Firmware interface in the previous step resulted in a reset of the NCR Firmware internal SCSI data transfer mode configuration for all devices to the ASYNC mode. If any SDL commands have been used previously, then the actual SCSI drive may be set up for SYNC.
t167 Test Program UCHAR msg_out[6] ................ (0): UCHAR msg_out[7] ................ (0): UCHAR msg_out[8] ................ (0): UCHAR msg_out[9] ................ (0): UCHAR msg_out[10] ................ (0): UCHAR msg_out[11] ................ (0): UINT data_count ................... (1024): UCHAR *data_ptr ................... (0x1FBDCA0): struct siop_struc *link_ptr ....... (0): UCHAR scsi_phase[0] ............. (0): UCHAR scsi_phase[1] ............. (0): UCHAR scsi_phase[2] .............
Example Use of t167 3. Send the command to the Firmware by selecting menu item 3. F/W Tools --> 3 Control structure [0] (0): siop_cmd status: 0x800 Return status: 2048 (0x800) F/W Tools --> Note the returned status of 0x800 (Data Underrun). This status is received because we gave the Firmware a buffer of size 1024 bytes but only requested 0x40 bytes from the device. This is an expected and acceptable status. 4. Select menu item 7 to display the data buffer to see the inquiry data.
t167 Test Program Mode Sense Parameters This exercise shows how to get the current device's mode page parameters. This example senses the current page 3 parameters; however, default, changeable, and saved parameters could be fetched instead as well as other mode pages. 1. E Select menu item 1 to build a Firmware control structure. Note that most of the parameters can be left at their default values. Also note that the data_ptr parameter is reset back to the start of data buffer 0.
Example Use of t167 2. Select menu item 6 to display the command structure. F/W Tools --> 5 Control structure [0] (0): Address of siop_struc structure: 0x1FBCCB4 Contents of siop_struc structure: UINT user_defined ................ 0x0 UINT cmd_ctrl ..................... 0x8000000D UINT addr_ilvl .................... 0, 0x0 UINT lun .......................... 0, 0x0 UINT cdb_lgth ..................... 6, 0x6 UCHAR cdb[MAX_CDB]: 0 1A 00 03 00 FF 00 00 00 00 00 00 00 UINT msg_in_lgth ..................
t167 Test Program Issue a Read Command to the Device 1. Hit the ABORT switch on the front panel of the target CPU and use the memory modify (MM) command to fill in the contents of data buffer 0.
Example Use of t167 3. Build the command structure for a 10-byte read. F/W Tools --> 1 Control structure [0] (0): UINT user_defined ................ UINT cmd_ctrl ..................... UINT addr_ilvl .................... UINT lun .......................... UINT cdb_lgth ..................... UCHAR cdb[0] .................... UCHAR cdb[1] .................... UCHAR cdb[2] .................... UCHAR cdb[3] .................... UCHAR cdb[4] .................... UCHAR cdb[5] ....................
t167 Test Program 4. Select menu item 5 to display the command structure. F/W Tools --> 5 Control structure [0] (0): Address of siop_struc structure: 0x1FBCCB4 Contents of siop_struc structure: UINT user_defined ................ 0x0 UINT cmd_ctrl ..................... 0x8000000D UINT addr_ilvl .................... 0, 0x0 UINT lun .......................... 0, 0x0 UINT cdb_lgth ..................... 10, 0xA UCHAR cdb[MAX_CDB]: 0 28 00 00 00 00 00 00 00 02 00 00 00 UINT msg_in_lgth ..................
Glossary Term Definition CDB (NOTE) Command Descriptor Block - A defined SCSI structure used to communicate commands from an initiator to a target. DISconnect (NOTE) The function that occurs when an SCSI target releases control of the SCSI bus, allowing it to go to the BUS FREE phase. Initiator (NOTE) An SCSI device (usually a host system) that requests an I/O process to be performed by another SCSI device (a target).
Glossary Term Definition SCSI (NOTE) Small Computer System Interface - An ANSI-defined intelligent I/O bus. SCSI-2 (NOTE) An ANSI-defined intelligent I/O bus with broader functional definitions and tighter protocol definitions than SCSI-1 (SCSI). SCSI address (NOTE) The hexadecimal representation of the unique address (0 through 7) assigned to an SCSI device. G L O S S A R Y SCSI device (NOTE) A host adapter or a target controller that can be attached to the SCSI bus.
Index Symbols C (de)serialize_memory_access C-5 C call interface 3-1 C debug initialization 3-8 C debug trace allocation 3-10 C firmware command call 3-6 C firmware initialization call 3-3 C return firmware revision string 3-11 C SIOP firmware interrupt handler 3-7 cache coherency 5-16 CDB GL-1 CDB (Command Descriptor Block) B-11 CDB length or queue depth B-11 code level setup 5-5 command call C firmware 3-6 command control B-3 command control bit definitions B-3 command flow 2-6 command structure B-1,
Index I N D E X firmware display 5-11 data pointer or scatter/gather list pointer B-14 data reference relocation 4-1 debug initialization C 3-8 debug logging code level setup 5-5 example 5-4 firmware 5-1 user level setup 5-4 debug logging initialization structure B-23 debug logging initialization values structure B-23 debug logging interface 5-1 debug trace 5-1 debug trace allocation C 3-10 debug trace display 5-6 debug trace memory structure 5-2, 5-3 debugging packages 1-3 definition of SCSI 1-4 definiti
G general description of the SCSI software 1-4 general information 1-1 glossary GL-1 H help E-4 I IDOV 5-12 INIT 5-12 initialization C debug 3-8 initialization call C firmware 3-3 initialize the NCR firmware interface E-28 initiator GL-1 initiator mode B-3 INT 5-12 INTATR (command control bit 31) B-3 interface assembler 3-2 C call 3-1 debug logging 5-1 firmware 2-2, 3-1 interrupt handler C SIOP firmware 3-7 interrupt mechanism 2-8 interrupt mode 2-6 introduction 1-1, 2-1, 3-1, 4-1, 5-1, A-1, B-1, C-1, E-1
Index MPU code 1-4 MREJ 5-13 MVME167Bug 1-3 MVME187Bug 1-3 N n710c68k 4-7 n710c80k 4-7 n710p68k 4-4 n710p80k 4-4 NCR 53C710 1-4, 2-1 NCR build tools 4-1 NCR build utilities example 4-2 NCR firmware development tools E-4 NCR firmware development tools menu E-13 NCR firmware tests E-4 NCR SCSI SCRIPT 2-1 preprocessor utility 4-4 NCR SCSI SCRIPT files compiler 4-7 NCR SCSI SCRIPTS 4-1 nexus GL-1 NO_ATN (command control bit 13) B-6 NVRAM GL-1 O organization manual 1-1 overview 2-1, E-1 functional 2-6, 5-1 P
SCSI SCRIPTS data reference relocation 4-1 SCSI software general description 1-4 SCSI status GL-2 SCSI-2 1-4, GL-2 SCSIRST (command control bit 8) B-7 SDL GL-2 SDL and NCR firmware addresses E-6 SDL direct access commands E-11 SDL supported sequential access commands E-12 sdl_key D-1 sdt_alloc 2-2, 3-10, 5-1 sdt_tinit 2-2, 3-8, 5-1 debug logging initialization structure B-23 select GL-2 select terminal type E-6 send SCSI INQUIRY to the device E-29 sense_key D-1 serialize_memory_access C-5 sfw_getrev 2-2, 3-
Index SS_I_GOOD (0x10) D-2 SS_QFULL (0x28) D-3 SS_RSVCON (0x18) D-3 status B-15, E-4 status field D-1 status return function pointer B-14 status_key D-1 status_key error codes D-1 STEP 5-14 STO 5-14 subdirectories A-1 submenus and functions t167 E-2 SYNC (command control bit 0) B-9 T I N D E X T_EXEC (command control bit 12) B-7 t167 GL-2 configuration E-3 configuration menu E-4 submenus and functions E-2 test program E-1 TAG_Q (command control bit 7) B-7 tagged command queuing GL-2 target GL-2 TARGET (