X3T9.2/92-132 John Lohmeyer 29 May 1992 NCR Chairman X3T9.2 Subject: Proposed New ATA Functions Zenith Data Systems supports the ATA standard but requires the additional functionality outlined in this proposal. We have tested the proposal in several systems that we market. Several drive manufacturers have also tested the proposal and others have indicated a willingness to support the proposed additional functions. We request that X3T9.2 accept the proposal for inclusion in the Extended ATA standard or in both the ATA and Extended ATA standards. While we do not want to delay the publication of the ATA standard, we understand that there is a great deal of support for bringing the ATA dpANS back to include an additional Logical Block Addressing (LBA) function. We are In favor of including in the ATA dpANS both the LBA and the proposed REST / RESUME functionality. BACKGROUND: There is a great deal of effort in the portable application industry to extend battery charge life by improvements in battery technology and reduced power dissipation. The Check Power Mode, Sleep, and Standby commands in the ATA dpANS are early examples of that effort. This proposal extends this capability by allowing the drive to have all power removed when not in use for a significant period of time and yet be able to resume operation in the same configuration and conditions as when power was removed. GENERAL DESCRIPTION: Three proposed optional commands allow a host system to place a drive in a condition for power off hibernation, to save the drive's internal state, and to cause the drive to restore its prior state and if required, to generate an interrupt. If the option is implemented, all three commands shall be incorporated. The first command, Rest, notifies the drive that a special power off mode will soon follow. It also guards against triggering a Rest / Resume cycle with inadvertent diagnostics. The second command, Read Drive State, causes the drive to send the host a block of data which contains the Drive States which are defined as any host selectable drive parameters, modes or registers. Following are examples of typical Drive States: a. Current logical geometry b. Power management timers c. Multiple command block count d. Number of ECC bytes transferred for long commands e. Cache on/off state (but not the cache contents) f. All I/O (task file) registers The saving of the Drive States is necessary in order to properly resume the preempted operation later. The last word of the data block is a place holder for the third command's additional function. Except for the last word, the format of the information is vendor unique and no architectural limitation of the drive design in implied. Except for the last word of the block, the information is held in the host system for a subsequent restart of the preempted operation. Having successfully completed the Read Drive State command, and internally storing the Drive States, the host is then free to remove power entirely from the drive. When the host system determines that the operation should again be resumed, the host applies power to the drive. When the drive is ready to receive commands, the host issues a Restore Drive State command which enables the host to transfer back to the drive the block of data that was transferred to the host during the Read Drive State command. Except for the last word, all of the data is in the same format and sequence as the data originally transferred to the host as a result of the Read Drive State command. The drive uses the data in a vendor unique manner to restore its prior state. Data from the last word informs the drive whether or not its interrupt line should be asserted at the end of this command. The data transfers, error detection, error reporting, and other I/O protocol employed are those presently documented in the ATA dpANS except for the special completion handling of the Restore Drive State command. When a drive first powers up and is capable of responding to a command, if the first command received is not the Restore Drive State, it will operate as presently defined by the ATA dpANS pending another Rest command. Prior to issuing any of the three Rest / Resume commands, but after all commands not associated with the Rest mode have completed, the host shall set the Features Register to ACh. If the register contains a value other than ACh when the Rest command is received, the command shall be rejected with an aborted command error. PROPOSAL: Post Power Off Resumption. +-------+-------------------+ +-----+ |Command| Parameters Used | |Class| | Code |FR |SC |SN |CY |DH | +-----+----------------------------------+---+-------+---+---+---+---+---+ | 1 | Read Drive State | O | E9h **| y | | | | | | 1 | Rest | O | E7h | y | | | | | | 3 | Restore Drive State | O | EAh | y | | | | | | 3 | Write Same | O | E9h **| y | y | y | y | y | +-----+----------------------------------+---+-------+---+---+---+---+---+ | ** - See Section 2.29 and 9.33 for distinction between Write Same and | | Read Drive State. | +-----+----------------------------------+---+-------+---+---+---+---+---+ | ACh | Allow Rest, Read Drive State, or Restore Drive State commands| 2.29 Write Same This command executes in a similar manner to Write Sectors except that only one sector of data is transferred. The contents of the sector are written to the medium one or more times. NOTE: The Write Same command allows for initialization of part or all of the medium to the specified data with a single command. Drives which implement the optional Rest / Resume commands will reject this command if it occurs after a Rest command and before a subsequent power off or reset. (See) 9.33. If the Features Register is 22h, the drive shall write that part of the medium specified by the sector count, sector number, cylinder and drive/head registers. If the Features Register contains DDh, the drive shall initialize all the user accessible medium. If the register contains a value other than 22h or DDh, and the drive is not in the Rest Mode (see 9.34), the command shall be rejected with an aborted command error. The drive issues an interrupt to indicate that the command is complete. Any error encountered during execution results in the termination of the write operation. Status is available in the Error Register if an error occurs. The error posting is the same as that of the write Sectors command. ADD the following three sections: 9.33 Read Drive State This command shall only be issued by the host following a successful Rest command. The transfer protocol of this command is the same as that of a Read Sector command except for the data source and that the transfer length shall always be 256 words (512 bytes) regardless of the sector size. If the drive is in the Rest Mode, receipt of the command shall cause the drive to transfer, in one 256 word block of data, all Drive States that are required to be saved by the host before power can be removed from the drive. The Drive States are those mentioned earlier that will be required to return the drive to the same configuration and condition it was in just prior to the entry into the Rest Mode. The specific data is vendor unique and the data format shall comprise the first 255 words (510 Bytes) of the transfer. Word 255, the last word, shall be transferred as 0000h. 9.34 Rest The Rest command prepares the drive for a subsequent Read Drive State command by initiating the Rest Mode. If a drive 1 (slave drive) is present, the host shall issue the Rest command and the Read Drive State to Drive 1 prior to issuing them to Drive 0. Since the Rest Mode can be utilized in addition to the power modes described in Section 8.3, if the Busy or DRQ bit is set, the host shall wait up to 30 Seconds for the Busy Bit and the DRQ Bit to clear. (This potential wait begins subsequent to the completion of any prior command. If the host can not determine that any pending command has completed, the host should wait for Busy Bit, DRQ and DASP- to clear before issuing the Rest command). If either DRQ or Busy Bits were set, the host may use the DASP- signal to determine when the Rest Mode may be initiated. The drive shall assert DASP- when a Rest command is received and deassert it upon completion of the Rest command. After the Rest command is issued, the host shall wait up to 10 Seconds for the drive to assert INTRQ. Upon receipt of the Rest command, the drive shall capture the state of the I/O registers as they existed upon completion of the previous command. Note that this implies a method of having a duplicate copy of all I/O registers which may have been changed by the Rest command and by a subsequent illegal command or the Read Drive State command. After issuing the Rest command, the host shall poll the Alternate Status register to monitor for completion status without clearing the interrupt flag that may have been set for an application program. After entering the Rest Mode, any command other than Read Drive State shall be rejected with an aborted command error. The Rest Mode shall only be cleared by power off or reset. 9.35 Restore Drive State After powering up to a condition in which the drive is ready to accept commands, the drive will accept any legal implemented command. If the host has previously caused a Rest Mode, the host must ensure the first command issued to the drive is not one that will interfere with the intended resume operation. This command shall only be issued by the host following a successful Read Drive State command. The transfer protocol of this command is the same as that of a Write Sector command except for the data source and that the transfer length shall always be 256 words (512 bytes) regardless of the sector size. Receipt of the command shall cause the drive to utilize the transferred Drive States to return the drive to the same configuration and condition it was in just prior to the entry into the Rest Mode. The specific data is vendor unique but shall be identical in content and format to that transferred by the prior Read Drive State command except for the last word transferred. The host shall always transfer all 256 words. If bit zero (0) of the last word transferred is 0h (reset to zero), INTRQ shall not be asserted at the completion of this command. If this same bit is a 1h (set to one), INTRQ shall be asserted at the conclusion of this command. After issuing the Restore Drive State command, the host shall poll the Alternate Status register to monitor for completion status without clearing the interrupt flag that may have been set for an application program. Note: This command does not result in a restoration of data buffers or cache. END OF PROPOSAL You will note that I did not insert the added sections in their natural alphabetical location. The committee may prefer to do that. I have no objections to placing them in the alphabetical location but did not want to burden the original change proposal with the resultant changes of section numbers and cross references. Please review this proposed change to the dpANS. If you have any questions or suggestions, I will be pleased to provide the necessary resources to help incorporate the proposed change into the ATA dpANS.