serial ata interface - androbenchcsl.skku.edu/uploads/ice3028s14/2-sata.pdf · ata-3 1997 smart...
TRANSCRIPT
Jin-Soo Kim ([email protected])
Computer Systems Laboratory
Sungkyunkwan University
http://csl.skku.edu
Serial ATA Interface
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 2
ST-506 Interface
▪ ST-506: The first 5.25” HDD from Seagate
▪ 1980, up to 5MB at $1500
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 3
(Parallel) ATA Interface
▪ IDE (Integrated Disc Electronics) drives
▪ Support for two drives (master/slave)
▪ Standardized in 1994 as ANSI X3.221: AT Attachment Interface for Disk Drives
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 4
PATA Block Diagram
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 5
PATA Evolution Standard Year Speed Transfer Modes Features
ATA 1994 5 MB/s PIO modes 0-2 Multiword DMA mode 0
AT bus 2/3 bytes @ 8MHz
ATA-2 1996 16 MB/s
PIO modes 3-4 Multiword DMA modes 1-2
PCI bus burst tx. 2 bytes @ 8MHz Logical Block Address (LBA)
ATA-3 1997 SMART
ATA-4 1998 33 MB/s UDMA modes 0-2 2 bytes @ 16.5MHz
ATA-5 2000 66 MB/s UDMA modes 3-4 2 bytes @ 33MHz
ATA-6 2002 100 MB/s UDMA mode 5 1.5x PCI clock 2 bytes @ 50MHz 48-bit LBA
ATA-7 2003 133 MB/s UDMA mode 6 2 bytes @ 66MHz DDR clocking
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 6
PATA Programming Interface
▪ Task file
• A block of registers mapped into the x86 IO address space
• Eight Command Registers (@ 0x01F0) + One Control Register (@ 0x03F6)
▪ Issuing a command
• Initialize the task file for a particular command
• Write the appropriate value to the Command register @ 0x01F7
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 7
Physical Drive Geometry
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 8
Taskfile (Physical Addressing)
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 9
Taskfile (28-bit LBA)
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 10
48-bit LBA
▪ 28-bit LBA: up to 128GB
▪ ATA-6 introduced 48-bit LBA: up to 128PB
• Two writes issued to LBA low/middle/high (0x01F3-0x01F5) and sector count (0x01F2)
• High-order byte is loaded first
• cf. ReadDMAExtended, WriteDMAExtended
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 11
PATA Command Sequence
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 12
Multiple PATA Interfaces
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 13
Serial ATA (SATA)
▪ Primary internal storage interconnect for desktop and mobile PCs. • HDDs, SSDs, optical drives, removable disks, ..
▪ More than 1.1 billion SATA drives shipped during 2001-2008
▪ Market share (as of 2008): • Desktop PC market: 99%
• Mobile PC market: 97.7%
• Enterprise market: 27.6%
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 14
Why SATA?
▪ Lower pin count (cost, space, …)
▪ Lower voltage support (5V 0.7V)
▪ Higher performance:
• SATA 1: 150MB/s @ 1.5Gb/s
• SATA 2: 300MB/s @ 3Gb/s
▪ Simple drive configuration (no slave)
▪ Greater reliability (CRC/packet)
▪ Migration to servers (hot plug, …)
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 15
Compatibility with PATA
▪ HBA sends the register contents to the drive via a packet called a “Frame Information Structure (FIS)”.
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 16
SATA Block Diagram
SATA 1
SATA 2
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 17
SATA Protocol Layers
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 18
FIS Types
▪ Each FIS has an 8-bit ID (type)
▪ Size is always multiples of 4 bytes (=1 DW)
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 19
Register FIS H2D
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 20
Data FIS
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 21
Non-Data Commands
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 22
DMA Read Command
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 23
DMA Write Command
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 24
NCQ
▪ Enqueue up to 32 commands in the drive
▪ Process them in an out-of-order fashion
B
D
A
C B
D
A
C
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 25
Enabling NCQ
▪ IDENTIFY DEVICE command:
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 26
First Party DMA Commands
▪ First Party DMA (FPDMA) Read
▪ First Party DMA (FPDMA) Write
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 27
FPDMA Read Command
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 28
FPDMA Write Command
Auto-activate
X
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 29
AHCI
▪ Advanced Host Controller Interface
• By Intel
• The current version is AHCI v1.3 (Oct. 2010)
• Defines the functional behavior and software interface of the SATA/AHCI adapters
• AHCI HBAs support from 1 to 32 ports
• An HBA optionally supports SATA NCQ via the FPDMA Queued Command protocol for each device of up to 32 entries
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 30
Command Queue in AHCI
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 31
SATA 3.0
▪ Standardized in May 2009
▪ Primarily for SATA SSDs and RAID cards
▪ Transfer rate: 6 Gbps ~ 600MB/s
▪ New NCQ streaming command
• Provide isochronous data transfers for audio/video applications
▪ Other improvements in connector, power management, etc.