Background
Programming Methods
Legacy Method
AHCI
Advanced Host Controller Interface
Register Access
Layer Definition
Application Layer
Programming interface
Transport Layer
Construct and deliver the frames
Manage virtually all of the link protocol
Transmission
Generate CRC for each FIS
Scramble the FIS to reduce EMI
Generate the Primitives used in the SATA protocol
Reception
Inverse operations
Physical Layer
Provide the SerDes
Transceiver functions
Link initialization
Speed detection
STP Support SATA
SATA Link Layer performs many of the functions provided by the SAS Phy Layer
STP essentially combines the SAS Link and Phy Layers into the STP Link Layer
The STP Concept
STP must simulate the SATA directly-connected host-to-drive topology
Connected to
Initiator
Detect this condition during the OOB sequence
The link simply operates using SATA protocol
Not need for a connection
No need for the use of STP
Expander
First establish a connection that use the STP
Application Layer
Transport Layer
Main responsibility
Construct outgoing frames
Parse incoming frames
Difference between SATA FIS and SSP
FIS can carry up to 8KB of data
Only 1KB for SSP
Link Layer (STP)
Link Layer Serial Support
CRC Generation and Checking
Outgoing Frames
Incoming Frames
Scrambling
STP needs two scramblers
FIS Scrambler
Reduce EMI for each FIS
Primitive Suppression Scrambler
Reduce EMI for repeated primitives
Only two are listed in the standard
SATA_PMACK
SATA_PMNAK
Continued primitives
At least 2 same primitive to be repeated
Followed by the continue primitive "SATA_CONT"
Use the Primitive Suppression scrambler to send scrambled data dwords
Ignored by the receiver
Reason
Allow the main transmitter scrambler and receiver descrambler to maintain their states
Connection Management
STP Connections
Half-duplex
Allow frames to go one way at a time
The other direction on the link carries feedback about the progress of the frame
Little-endian
Different flow control
One the connection established
Recognize the SATA flow control primitives
Recognize the CLOSE primitive from the initiator
Sending a FIS
Acknowledging the FIS
Closing the Connection
Affliations
Many initiators might access the same SATA target
Save Nexus Info
STP target keeps track of the source address for all of the initiators that access the port
Allow multiple initiators to access the SATA device
Keep some memory of the equivalent I_T_L_Q nexus information
Affiliation
STP target automatically store the source address of the initiator whenever it accepts a connection request
Only allowing access by that initiator until the affiliation is cleared
XRDY/XRDY Collision
Throttling and SSC (Spread-Spectrum Clocking)
Phy Layer
Clock Management
The number of ALIGNs fro SATA target is 2 within every 256 dwords
8/b10b Encoding and Decoding
Endianess
PCIe, SAS, IB
Big-endian bytes
Little-endian bits
SATA
Little-endian bytes
Little-endian bits
The primitives for SAS and SATA are both big endian
SATA II
Port Multipliers
Allow one host port to access up to 15 target devices (0~14)
Can't be cascaded
App. set the port value to 15, send that device a software reset
Port Selector
Allow a SATA device to operate somewhat like a dual-ported device
Allow two hosts to access one device to provide a fail-over mechanism
Detected by the host during OOB when the response to the COMRESET
Enclosure Management
Native Command Queuing(NCQ)
Permit the target device to re-order queued commands
Better performance
Both hardware and software support must be in place
The use of a Port Multiplier limits the usefulness of NCQs
Initiation
Hardware Initialization
Detect the presence of an attached device
OOB signaling
Transmission
COMWAKE
COMINIT/COMRESET
Reception
SATA OOB Protocol
COMRESET/COMINIT
Host → Target: COMRESET
Reset the target
Target → Host: COMINIT
Indicate readiness for the next step
Negotiate the highest common transmission rate supported by both devices
Send a pattern at the desired rate to the neighbor and listen for the response
Roles During Speed Negotiation
Target controls this process
Host as the responder
Target has sent COMWAKE
Target begins speed negotiation by sending ALIGN at the fastest rate
If no correct response from host
Switch to the next lower speed it supports
If correct response from host
Host sends ALIGNs back to the target
Host send D10.2 repeatedly
Until recognize ALIGN
Only one version ALIGN(0)
D10.2 Used as a Dial Tone
010101 0101
SATA Link Initialization Example
Software Initialization