Date: Wed, 11 Mar 1998 08:28:57 -0500 (EST) From: Tarl Neustaedter - SMCC Software Subject: Item #436: FC/AL SCSI FCP proposed binding P1275 Openboot Working Group Proposal -- Proposal #:436 Ver 1.5 Title: Open Firmware recommended Practices for SCSI-3 FCP Interface Author: David Brean Date: 11-March-1998 Ed/Tech: Technical Synopsis: A proposed bus binding for SCSI FCP over Fibre Channel Doc & Version: New Document Problem: There is interest in developing a document for the bindings between Open Firmware and SCSI FCP over Fibre Channel. Proposal: SCSI FCP over Fibre Channel Bus Binding to IEEE Std 1275-1994 Title: Version 1.5 1 Introduction 1.1 Overview and References This draft describes the application of Open Firmware to the SCSI-3 protocol as implemented on the Fibre Channel Protocol (FCP) for SCSI and the nodes that represent FCP host adapters. 2 References and Definitions 2.1 References [1] ANSI X3.230:1994 - Fibre Channel Physical and Signaling Interface (FC-PH) [2] ANSI X3.297:1996 - Fibre Channel Physical and Signaling Interface (FC-PH-2) [3] ANSI X3.272:1996 - Fibre Channel Arbitrated Loop (FC-AL) [4] ANSI X3.269:1996 - Fibre Channel Protocol for SCSI (FCP) [5] Fibre Channel - Private Loop SCSI Direct Attach (FC-PLDA), Project 1162-DT [6] Fibre Channel - Fabric Loop Attach (FC-FLA), Project 1235-DT [7] SFF-8045 Specification for 40-pin SCA-2 Connector w/Parallel Selection, version 3.7 [8] IEEE Standard 1275-1994 IEEE Standard for Boot (Initialization and Configuration) Firmware: Core Requirements and Practices [9] Device Support Extensions to IEEE 1274-1994, Revision 1.0 [10] Generic Names, version 1.4 2.2 Definition of Terms bus node: an Open Firmware device node that represents a bus controller. In cases where a node represents the interface, or "bridge", between one bus and another, the node is both a bus node relative to the bus it controls and a child node of its parent bus. Note that an Open Firmware device node is not in itself a physical hardware device, rather it is a software abstraction that describes a hardware device. child node: A device node that represents a FCP "target" device. logical unit: a target resident entity that implements a device model and executes SCSI commands sent by an application client. name identifer: a 64-bit identifer, also called WWN, used to identify entities on Fiber Channel such as FC_Ports. See FC-PLDA [4] section 5.1. world-wide name (WWN): 64-bit globally name unique identifier. The following FC-PH formats use the IEEE company identifer as the direct or indirect basis for their unique values. node name: a name identifer associated with node. port name: a name identifer associated with port. LIP: Fibre Channel sequence, Loop Initialization Primitive. Re-initializes fibre channel loop. Aribitrated Loop Physical Address (AL_PA): A unique one-byte valid value assigned (see section 5 in FC-AL [3]) during the Loop Initialization to each NL_Port or FL_Port on the Loop. hard address: the AL_PA which an FC-AL device attempts to acquire in the LIHA Loop Initialization Sequence. Loop_id: Loop_ids are 7-bit values numbered contiguously from 0 - 126 decimal and represent the 127 valid AL_PAs on a loop. Loop_IDs correspond to the 7-bit SEL word in the SFF-8045 [7] used for designating a hard address that NL_Port attempts to acquire during the LIHA loop Initialization Sequence. See FC-AL Annex K (Assigned Loop Identifier) for complete mapping. adisc: Fibre Channel sequence, Address Discovery. FC-PH-2 [2] section 21.19.2. Used to obtain all known addressing information about a fibre channel device, including hard-addresses, port WWN, and node WWN. native-address idenifier: the address identifier that indicates the targeted destination in the D_ID field or the intiator source in the S_ID field of the transmitted frame. See FC-AL [3] section 5.2. well-known addresses: a set of address identifiers defined by FC-PH to access global server functions such as a name server. 3 Bus Charactistics The Fibre Channel Protocol for SCSI (FCP) [4] defines a Fibre Channel mapping layer (FC-4) that uses the services defined by FC-PH [1] and extended by FC-PH-2 [2] to transmit SCSI command, data, and status information between a SCSI initiator and SCSI target. The use of the standard enables the transmission of standard SCSI formats, the transmission of standard SCSI data and parameter strings, and the receipt of SCSI status and sense information across the Fibre Channel using only the standard Fibre Channel frame and sequence formats. The FCP will operate with Fibre Channel Classes of service 1, 2 and 3 and will operate across Fibre Channel fabrics and arbitrated loops. 3.1 Physical Address Formats and Representations Fibre Channel (FC) is logically a point-to-point serial data channel. The Physical layer described in [1] performs those functions required to transfer data from one N_Port to another. A FC switch allows communication among more than two N_Ports. Fibre Channel Arbitrated Loop (FC-AL), described in [3], is an alternate implementation that uses the FC mechanisms to transfer data between an NL_Port selected by the arbitration process and any of the other NL_Ports on a loop. Once communication is opened between two NL_Ports, standard FC frames are used to provide an FC-PH compliant delivery service. In FCP documents [4], N_Ports and NL_Ports capable of supporting FCP transactions are collectively refered to as FCP_Ports. The Private Loop SCSI Direct Attach (FC-PLDA) [5] and Fabric Loop Attach (FC-FLA) [6] profiles further specify that each FCP intiator and target must have a unique 64-bit identifier, also called a Node WWN, that is used to indentify FCP_Port entities. Also, each FCP_Port of a SCSI intiator or target must have a 64-bit identifier called a Port WWN - SCSI targets and initiators may have more than one FC port. A SCSI initiator acquires the Node and Port names of the SCSI target and associates that information with a native-address identifier that is used to transfer information in FC frames. For the FC-AL topology, there are algorithms defined for assignment of the native address identifer based on a local device physical address called the AL_PA during loop initialization when there is no connection to a fabric. The AL_PA is mapped from the SCSI device SFF-8045 connector loop_ID if the loop_IDs for all devices on the loop are unique. 3.1.1 Physical Address Formats 3.1.1.1 Numerical Representation The numerical representation of a "fcp" address consists of four cells encoded as follows. Bit#0 refers to the least significant bit. Bit # 33222222 22221111 11111100 00000000 10987654 32109876 54321098 76543210 wwn.hi cell: wwwwwwww wwwwwwww wwwwwwww wwwwwwww wwn.lo cell: wwwwwwww wwwwwwww wwwwwwww wwwwwwww lun.hi cell: llllllll llllllll llllllll llllllll lun.lo cell: llllllll llllllll llllllll llllllll where: ww..ww 64-bit unsigned number node name ll..ll 64-bit unsigned number logical unit 3.1.1.2 Text Representation The text representation of a "fcp" target identifer is the following form: wNNNNNNNNNNNNNNN[,LLLLLLLLLLLLLLLL] where: w is the letter 'w' NNNNNNNNNNNNNNN is an ASCII hexadecimal number in the range 0...FFFFFFFFFFFFFFF LLLLLLLLLLLLLLLL is an ASCII hexadecimal number in the range 0...FFFFFFFFFFFFFFF. This portion of the address is optional and may be omitted if zero. The correspondence between the text representation and numerical representation is as follows: wNNNNNNNNNNNNNNN,LLLLLLLLLLLLLLLL corresponds to a Node name with numerical value: ww...ww is a binary encoding of NNNNNNNNNNNNNNN ll...ll is a binary encoding of LLLLLLLLLLLLLLLL Conversion of hexadecimal numbers from text representation to numerical representation shall be case-insensitive and leading zeros shall be permitted but not required. Conversion from numerical representation to text representation shall use the lower case forms of the hexadecimal digits in the range a...f, suppresing leading zeros. 3.2 Bus-specific Configuration Variables None. 3.3 Format of the Probe List None. 3.4 Interrupt Specification Format None (FCP has no interrupts). 3.5 Fcode Interpretation Semantics None (FCP has no provision for device identification via Fcode). 4 Bus Nodes 4.1 Properties 4.1.1 Open Firmware-defined Properties for Bus Nodes The following standard property, as defined in Open Firmware, has special meaning or interpretation for FCP: "device_type" Standard prop-name to specify the implemented interface. Prop-encoded-array: a string encoded with the encode-string. The meaning of this property is as defined in Open Firmware. A standard Package conforming to this specification and corresponding to a device that implements a FCP shall implement this property with the string value "fcp". 4.1.2 Bus-specific Properties for Bus Nodes "node-wwn" prop-name, denotes FCP node name. prop-encoded-array: a string encoded with encode-string, that represents the 16-digit hex representation of the node IEEE identifier "port-wwn" prop-name, denotes FCP port name. prop-encoded-array: a string encoded with encode-string, that represents the 16-digit hex representation of the port IEEE identifier 4.2 Methods 4.2.1 Open Firmware-defined Methods for Bus Nodes A Standard Package implementing the "fcp" device type shall implement the following standard methods as defined in Open Firmware, with physical address representations as specified in 3.1 of this standard: open ( -- okay? ) Prepare this device for subsequent use. close ( -- ) Close this previously opened device. decode-unit ( addr len -- lun.lo lun.hi wwn.low wwn.hi ) Convert text representation of address to numerical representation encode-unit ( lun.lo lun.hi wwn.low wwn.hi -- addr len ) Convert numerical representation of address to text representation dma-alloc ( size -- virt ) Allocate a memory region for later use. dma-free ( virt size -- ) Free memory allocated with dma-alloc. 4.2.2 Bus-specific Methods for Bus Nodes A package implementing the "fcp" device type may implement the following optional bus-specific method: max-transfer ( -- n ) Returns the maximum DMA length supported by the hardware. set-address ( lun.lo lun.hi wwn.lo wwn.hi -- ) Set the SCSI target and logical unit to which subsequent commands apply. set-timeout ( msecs -- ) Sets the maximum length of time in milliseconds that the driver will wait for completion of a command. The default value of zero means to wait indefinitely. A hardware error result is reported for a command that times out. lid-to-wwn ( loopid -- wwn.lo wwn.hi ) Retrieves the WWN for a specified target on the FC loop. This allows for easy programmatic use of a geographically-addressed backplane while still using WWNs to in the unit address. show-children ( -- ) Searches the Fibre Channel for attached targets and their associated logical units. Displays the information that the SCSI inquiry reports for those devices. diagnose ( -- error-code | 0 ) Performs a simple self-test for generic SCSI device. Perform an SCSI "test-unit-ready" command on the currently selected target and unit (see set-address). If that fails, display a message indicating the details of the failure and return a non-zero error code. Otherwise, perform a SCSI "send-diagnostic" command, returning zero if it succeeds or a non-zero error code if it fails. 5 Child Nodes Properties and Methods 5.1 Child Node Properties Child nodes shall implement the standard Open Firmware properties corresponding to the device type. 5.2 Child node methods 5.2.1 Open Firmware-defined Methods for Child Nodes Child nodes shall implement the standard Open Firmware methods as modified by the Open Firmware Recommended Practice, Device Support Extensions [8]. Devices that can be used as boot devices share be of type "block" and shall define the following methods: open ( -- okay? ) Prepare this device for subsequent use. close ( -- ) Close this previously opened device load ( addr -- size ) This method is as defined by Open Firmware core document [8]. Load a client program from device to memory. This method is provided by the "disk-label" support package. read ( addr len -- actual ) This method is as defined by Open Firmware core document [8]. Read device into memory buffer; return actual byte count. This method is provided by the "deblocker" support package. write ( addr len -- actual ) This method is as defined by Open Firmware core document [8]. Write memory buffer to device; return actual byte count. This method is provided by the "deblocker" support package. seek ( pos.lo pos.hi -- status ) This method is as defined by Open Firmware core document [8]. Set position for the next read or write. This method is provided by the "deblocker" support package. size ( -- d ) This method is as defined by the Device Support Extension [9] which states: return as a double number "d", the number of bytes of storage associated with the device or instance. If the size cannot be determined, return the double number -1. #blocks ( -- u ) This method is as defined by the Device Support Extension [9] which states: return as an unsigned number "u", the nmber of blocks of storage associated with the device or instance, where "block" is a unit of storage consisting of the number of bytes returned by the package's "block-size" method. If the size cannot be determined, or if the number of blocks exceeds the range of an unsigned number, return the maximum unsigned interger (which because of the Open Firmware's assumption of two's complement arthmetic is equivalent to the signed number -1). offset-low ( -- u ) This method is as defined by the Device Support Extensions [9]. Return the least significant cell of the double number denoting the beginning offset of the disk partition that was specified when the "disk-label" support package was opened. In general, the offset is obtained by executing the offset method of the "disk-label" support package with an argument of zero. It is permissible for the disk package to execute the "disk-label" support package's offset method once after opening that support package, storing for later use. offset-high ( -- u ) This method is as defined by the Device Support Extensions [9]. Return the most significant cell of the double number denoting the beginning offset of the disk partition that was specified when the "disk-label" support package was opened. In general, the offset is obtained by executing the offset method of the "disk-label" support package with an argument of zero. It is permissible for the disk package to execute the "disk-label" support package's offset method once after opening that support package, storing for later use. block-size ( -- block-len ) This method is as defined by Open Firmware core document [8]. Return the block size for the device. This method is required in order to allow use of the "deblocker" support package. max-transfer ( -- max-len ) This method is as defined by Open Firmware core document [8]. Return the size of the largest possible transfer. This method is required in order to allow use of the "deblocker" support package. read-blocks ( addr block# #blocks -- #read ) This method is as defined by Open Firmware core document [8]. Read #blocks from device into memory, starting at block#. This method is required in order to allow use of the "deblocker" support package. write-blocks ( addr block# #blocks -- #written ) This method is as defined by Open Firmware core document [8]. Write #blocks from memory into device, starting at block#. This method is required in order to allow use of the "deblocker" support package. 5.2.2 Bus-specific methods for child nodes None. 6 User Interface Extensions None [ P1275 Item #436 -- Received: Wed Mar 11 05:33:45 PST 1998 ]