Just added: SATA Protocol Training Videos
Serial ATA (SATA)
Serial ATA, also known and referred to as SATA, SATA-I, SATA-II, SATA-III, SATA Gen 1, SATA Gen 2, SATA Gen3, SATA3G, SATA6G, and SATA 6G. Serial ATA is the replacement to the popular IDE/Paralell ATA protocol. It can be found in just about any modern laptop or desktop system.
Serial ATA still shares the same command set as IDE, known as ATA. The latest revision is ATA-8 and can be found on the t13.org website.
The Basics:
The Serial ATA Protocol uses the following for communication:
Link Layer - Primitives, out of Band (OOB) Signalling)
Packet Layer - Frame Information Structures (FISes)
Application/Command Layer - ATA Commands.
The Link Layer
Sending of data patterns, 4 bytes (D-Word) at a time
Data is 8b10b encoded, uses K/D characters, and is scrambled to avoid EMI issues.
- K/D characters are used to specify the type of byte being used: data or control.
- K is for control character, specifying a non-DATA byte / primitive
- E.g. D23.1 D23.1 D21.5 K28.3 = SOF (start of frame primitive)
- D is for data character
- E.g. D30.6 D13.5 D30.5 D15.7 = 0xDE AD BE EF h
- K is for control character, specifying a non-DATA byte / primitive
- 8b10b encoding – coding scheme used by SATA to translate unencoded data and control bytes into characters
- Running Disparity is used in conjunction with 8b/10b encoding to limit the run length of 1’s and 0’s
- Scrambling is used to distribute the potential EMI emissions over a broader range
- 8b10b encoding errors, running disparity errors are a good indicator of physical layer issues.
Primitives
Primitives are primarily used to start/stop/request data.
ALIGN – Sent to align activities between hosts and devices. Must be sent every 256 DWORDs
SYNC – Synchronize
X_RDY – Product is ready to start transmitting a frame
R_RDY – Product is ready to start receiving a frame
R_IP – Product is receiving the frame
WTRM – Product has finished sending the frame and is waiting to terminate the connection
R_OK – Product has received the frame and it’s CRC is good
R_ERR – Product has received the frame and it’s CRC is bad
SOF – Start of Frame
EOF – End of Frame. DWORD previous to EOF is the CRC value
HOLD – Product not ready to send/receive additional data
HOLDA – Product acknowledges that other product needs time to “catch up”
CONT – “Continues” previous primitive until a different one is sent. Used to reduce EMI.
PMREQ_S – Interface Power Management Request for Slumber
PMREQ_P – Interface Power Management Request for Partial
PMACK – Power Management Request Acknowledged (approved)
PMNAK – Power Management Request Not Acknowledged (denied)
DMAT – Sent to terminate a DMA transmission
Out Of Band Singaling (OOB) / Speed Negotiation
OOB, Out of Band, is a signaling pattern of either ALIGN primitives or DWORDs consisting of D24.3 characters and idle time used to initialize the SATA interface. There are three kinds of OOB signals used in SATA:
COMINIT – Used by the device to request a communication initialization
COMRESET – Used by the host to force a hardware reset on the device
COMWAKE – Used by either the host or device to signal the PHY layer to wake up.
Below is a diagram showing how speed negotiation is achieved.
|
|
1.Host sends COMREST.
2.Device sees COMRESET, sends COMINIT
3.Host sees COMINIT, sends COMWAKE
4.Device sees COMWAKE, sends ALIGN primitives at highest supported speed
5.Host sends D10.2 at 1.5Gps as clock reference, sees ALIGNs and sends ALIGNs
6.Host and device send SYNC primitives
|
| Here is a trace of the speed negotiation in our protocol view |
Training Videos (found on our Youtube channel)
|
SATA Introduction - Basics, Primitives, OOB, PM, and Frame Transmission |
SATA Introduction - Frames, Commands, and NCQ |
