590 likes | 705 Views
Serial Advanced Technology Attachment (SATA) Application Layer. UNH InterOperability Lab. Application Layer. SATA Software Settings Preservation (SSP) Description of SSP SET FEATURES Preserved Settings Across COMRESET SATA Native Command Queuing (NCQ) How NCQ Works Description of NCQ
E N D
Serial Advanced Technology Attachment(SATA) Application Layer UNH InterOperability Lab
Application Layer SATA Software Settings Preservation (SSP) Description of SSP SET FEATURES Preserved Settings Across COMRESET SATA Native Command Queuing (NCQ) How NCQ Works Description of NCQ Definitions * SSP and NCQ are SATA specific features that were added because of increased capability. These features are often tested by OEMs and the SATA-IO certification program.
Description of SSP • Host configures a device when it is recognized using commands like SET FEATURES and SSP commands • Software settings are retained after a software reset • When a COMRESET occurs, not all settings are necessarily preserved as a COMRESET is essentially a hardware reset
Description of SSP • If there is an asynchronous loss of signal, a COMRESET is sent, some software settings are lost • Without legacy mode drivers, SSP ensures that settings are maintained after a COMRESET
Application Layer • SATA Software Settings Preservation (SSP) • Description of SSP • SET FEATURES • Preserved Settings Across COMRESET • SATA Native Command Queuing (NCQ) • How NCQ Works • Description of NCQ • Definitions
SET FEATURES • SET FEATURES Definition • Features Enable / Disable Values • Feature Identification Values • Enable / Disable Non-Zero Offsets in DMA Setup • Enable / Disable DMA Setup FIS Auto-Activate Optimization • Enable / Disable Device-Initiated Interface Power State Transitions • Enable / Disable Guaranteed in-Order Data Delivery • Enable / Disable Asynchronous Notification • Enable / Disable Software Settings Preservation • Enable / Disable Device Automatic Partial to Slumber Transitions
SET FEATURES Definition • SET FEATURES commands inform the device about host capabilities • Features can be enabled and disabled • The control of these features is designated by SET FEATURES
Features Enable / Disable Values • (7:0) contains the specific SATA feature that is being either enabled or disabled. These features are defined on the following slide.
Enable / Disable Non-Zero Offsets in DMA Setup • Enables or disables non-zero buffer offsets in the DMA Setup FIS if device uses the First-party DMA mechanism • When enabled, useful for completing incorrectly ordered data delivery
Enable / Disable DMA Setup FIS Auto-Activate Optimization • Used to automatically activate the transfer of the first Data FIS from the host to the device • Allows FIS operation to immediately activate, eliminating the need for a separate DMA Activation FIS
Enable / Disable Device-Initiated Interface Power State Transitions • Allows host to enable or disable initiation of power state transitions for the device • When interface power state transitions is favorable, host can enable for the device
Enable / Disable Device-Initiated Interface Power State Transitions • Capture shows device response to PMREQ_P when IPM (Interface Power Management) is enabled
Enable / Disable Device-Initiated Interface Power State Transitions • Capture shows device response to PMREQ_S when IPM (Interface Power Management) is NOT enabled
Enable / Disable Guaranteed in-Order Data Delivery • Host can enable or disable guaranteed in-order data delivery when a First-party DMA mechanism and non-zero buffer offsets are used • Helpful for segmenting cumbersome I/O processes into multiple data phases while keeping complexity at a minimum
Enable / Disable Asynchronous Notification • Allows host to control asynchronous notification • Disabled by default, when enabled allows the device to request attention without polling the host
Enable / Disable Software Settings Preservation • Software Settings Preservation can be enabled or disabled by the host • Supported by default at start up
Enable / Disable Device Automatic Partial to Slumber Transitions • Host can enable or disable Device Automatic Partial to Slumber transitions • Not enabled if the Device-Initiated Interface Power State transitions have been disabled
Application Layer • SATA Software Settings Preservation (SSP) • Description of SSP • SET FEATURES • Preserved Settings Across COMRESET • SATA Native Command Queuing (NCQ) • How NCQ Works • Description of NCQ • Definitions
Preserved Settings Across COMRESET • The following settings are reserved across a COMRESET when a device has SSP enabled. • INITIALIZE DEVICE PARAMETERS: Device settings established with the INITIALIZE DEVICE PARAMETERS command. This command is obsolete in the ATA8-ACS standard, and was last defined in the ATA/ATAPI-5 standard. • Power Management Feature Set Standby Timer: The Standby timer used in the Power Management feature set. • Read/Write Stream Error Log: The Read Stream Error Log and Write Stream Error Logs (accessed using the GPL feature set commands).
Preserved Settings Across COMRESET • Security mode state: The security mode state established by Security Mode feature set commands (refer to the ATA8-ACS standard). The device shall not transition to a different security mode state based on a COMRESET. For example, the device shall not transition from the SEC5: Unlocked / not Frozen state to state SEC4: Security enabled / Locked when a COMRESET occurs, instead the device shall remain in the SEC5: Unlocked / not Frozen state. • SECURITY FREEZE LOCK: The Frozen mode setting established by the SECURITY FREEZE LOCK command.
Preserved Settings Across COMRESET • SECURITY UNLOCK: The unlock counter that is decrement as part of a failed SECURITY UNLOCK command attempt. • SET MAX ADDRESS (EXT): The maximum LBA specified in SET MAX ADDRESS of SET MAX ADDRESS EXT. • SET FEATURES (Write Cache Enable/Disable): The write cache enable/disable setting established by the SET FEATURES command with subcommand code of 02h or 82h.
Preserved Settings Across COMRESET • SET FEATURES (Set Transfer Mode): PIO, Multiword, and UDMA transfer mode settings established by the SET FEATURES command with subcommand code of 03h. • SET FEATURES (Advanced Power Management Enable/Disable): The advanced power management enable/disable setting established by the SET FEATURES command with subcommand code of 05h or 85h. The advanced power management level established in the Count(7:0) register when advanced power management is enabled (SET FEATURES subcommand code 05h) shall also be preserved.
Preserved Settings Across COMRESET • SET FEATURES (Read Look-Ahead): The read look-ahead enable/disable setting established by the SET FEATURES command with subcommand code of 55h or AAh. • SET FEATURES (Release Interrupt): The release interrupt enable/disable setting established by the SET FEATURES command with a subcommand code of 5Dh or DDh. • SET FEATURES (SERVICE Interrupt): The SERVICE interrupt enable/disable setting established by the SET FEATURES command
Preserved Settings Across COMRESET • SET FEATURES (Reverting to Defaults): The reverting to power-on defaults enable/disable setting established by the SET FEATURES command with a subcommand code of CCH or 66h. • SET MULTIPLE MODE: The block size established with the SET MULTIPLE MODE command.
Preserved Settings Across COMRESET • NCQ QUEUE MANAGEMENT (Deadline Handling): The state of WDNC and RDNC. • Write-Read-Verify feature set: The contents of IDENTIFY DEVICE data word 120 bit 1, words 210-211, and word 220 bits (7:0). The device shall not return to its Write-Read-verify factory default setting after processing a COMRESET
Application Layer • SATA Software Settings Preservation (SSP) • Description of SSP • SET FEATURES • Preserved Settings Across COMRESET • SATA Native Command Queuing (NCQ) • How NCQ Works • Description of NCQ • Definitions
How NCQ Works • When drive receives multiple commands from an application, NCQ optimizes how the commands will be completed • Drive must intelligently and internally assess the destination of the logic block addresses and then order the commands to optimize the workload
How NCQ Works • This is due to the fact that the mechanical movement needed to position the read / write head is relevant • This improves performance and minimizes the mechanical positioning for the drive
How NCQ Works • Commands are ordered in the queue to minimize mechanical movement
Application Layer • SATA Software Settings Preservation (SSP) • Description of SSP • SET FEATURES • Preserved Settings Across COMRESET • SATA Native Command Queuing (NCQ) • How NCQ Works • Description of NCQ • Definitions
Description of NCQ • The reserved 32 bit field in the Set Device Bits FIS is used to show the status for outstanding commands, one command per bit • BSY bit in the Status register shows only if the device is ready to receive another command
Description of NCQ • When a new command is received the BSY bit is set to zero • Data sent to the device uses the First Party DMA mechanism to allow the host to select the appropriate destination memory buffer for transfer • Host cannot issue new commands from the reception of a DMA Setup FIS until either the the associated transfer count is exhausted OR the ERR bit in the Status register is set
Description of NCQ • DMA Setup FIS for memory buffer selection
Description of NCQ • Set Device Bits FIS for successful READ FPDMA QUEUED command
Description of NCQ • Set Device Bits FIS with error notification and command completions
Description of NCQ • Set Device Bits FIS aborting all outstanding commands
Description of NCQ • Successful completion of this process is updated in the Set Device Bits FIS 32 bit array • If process fails, the process is halted and allows software or controller firmware to resolve the failure
Application Layer • SATA Software Settings Preservation (SSP) • Description of SSP • SET FEATURES • Preserved Settings Across COMRESET • SATA Native Command Queuing (NCQ) • How NCQ Works • Description of NCQ • Definitions
Definitions • Command Issue Mechanism • Data Delivery Mechanism • Status Return Mechanism • Priority • Unload
Command Issue Mechanism • New commands can only be attempted when the BSY bit has been cleared to zero • BSY bit in the Shadow Status register is checked before a new command is issued • Commands are deferred if BSY bit is set to one
Command Issue Mechanism • It is favorable for a device to minimize deferred commands, so the BSY bit should be cleared as soon as possible • NCQ issues a tag that identifies a command • Tag range is from 0 to 31
Command Issue Mechanism • For devices that show a value less than 31 in their IDENTIFY DEVICE word 75, the host issues tags that are less than or equal to the reported value • When a new NCQ command is issued the bit in the SActive register corresponding to the tag is set to one
Command Issue Mechanism • If command is accepted, the BSY bit is set to zero
Data Delivery Mechanism • DMA Setup FIS is used by the device in order to choose the correct transfer buffer • Multiple DMA Setup FIS transmission are not required, even if the transfer spans more than one Data FIS
Data Delivery Mechanism • The DMA Mechanism is optimized to eliminate one transaction • Requested data is immediately sent after a request without the need for a DMA Activate FIS
Data Delivery Mechanism • A device may return data for a command out of order if: • Host controller supports non-zero buffering and is enabled • AND if guaranteed in order data deliver is not supported OR is disabled
Data Delivery Mechanism • The device may send more than one DMA Setup FIS to complete a particular I/O process if: • The host supports non-zero buffer offsets • Use of non-zero offsets is enabled • The device supports and has guaranteed in-order data delivery enabled
Data Delivery Mechanism • DMA Setup FIS definition for memory buffer selection
Status Return Mechanism • Is not interlocked with other commands • Relies on one active command bit (ACT), the 32 protocol specific bits in the Set Device Bits FIS, to convey status of outstanding commands • SActive field conveys command completion information for updating the ACT bit array