Design Considerations for USB Mass Storage Steve Kolokowsky Cypress Semiconductor syk@cypress.com June 12, 2002 2
Mass Storage The Killer App June 12, 2002 3
Outline Mass Storage Class Bridge Selection Criteria Fixed Function vs. Programmable Bridges Driver Performance Issues June 12, 2002 4
Mass Storage Class SCSI Command Set RBC, Transparent, SFF-8070 subsets Defines 13 possible combinations of host and device behavior Defines Bulk Only Transport (BOT) and Command Bulk Interrupt (CBI) transport June 12, 2002 5
Bulk Only Transport (BOT) One IN and one OUT endpoint CBW -- Data -- CSW Uses STALL for Synchronization Control Pipe IN Pipe Out Pipe June 12, 2002 6
READ Transaction Host OUT (CBW) "Read Sectors" IN IN Read Data CSW Device June 12, 2002 7
Read Stall OUT (CBW) "Read Sectors" IN Host SETUP Clear Stall IN STALL CSW w/ Residue Device June 12, 2002 8
Write Transaction Host OUT (CBW) "Write (10)" OUT (DATA) IN Device CSW w/ Residue June 12, 2002 9
Write with STALL Host OUT (CBW) "Write (10)" OUT (DATA) SETUP Clear Stall IN STALL CSW w/ Residue Device June 12, 2002 10
Command Block Wrapper (CBW) bit Byte 0-3 4-7 8-11 (08h-0Bh) 12 (0Ch) 13 (0Dh) 14 (0Eh) 15-30 (0Fh-1Eh) 7 6 5 4 dcbwsignature dcbwtag 3 2 1 0 dcbwdatatransferlength bmcbwflags Reserved (0) bcbwlun Reserved (0) bcbwcblength CBWCB Source USB MSC BOT spec version 1.0 June 12, 2002 11
Command Block (CBWCB) READ Example bit Byte 7 6 5 4 3 2 1 0 0 OPERATION CODE (28h) 1 Reserved DPO FUA Reserved RELADR 2 3 (MSB) LOGICAL BLOCK ADDRESS 4 5 6 7 8 9 (LSB) Reserved (MSB) TRANSFER LENGTH (LSB) CONTROL Source SCSI2 Block Command specification June 12, 2002 12
Command Status Word (CSW) Contents bit Byte 0-3 4-7 8-11 (08h-0Bh) 12 (Ch) 7 6 5 4 3 2 1 dcswsignature dcswtag dcswdataresidue bcswstatus 0 June 12, 2002 13
The 13 Cases D e v i c e Phase Error Causes Stall HOST Hn Hi Ho Dn (1) Hn = Dn (4) Hi > Dn (9) Ho > Dn (5) Hi > Di Di (2) Hn < Di (6) Hi = Di (10) Ho <> Di (7) Hi < Di Do (3) Hn < Do (8) Hi <> Do Successful Transfer (11) Ho > Do (12) Ho = Do (13) Ho < Do June 12, 2002 14
Host Support Both Transports Supported Bulk Only Transport (preferred) CBI (Obsolete) Supported by Microsoft (W2K, ME, XP) Supported by Apple (OS9, OS X) Linux driver Available Vendors provide drivers for Win 98 June 12, 2002 15
OTG Support Proposal for FAT16 under discussion. Implementations are ahead of the spec OTG Demo seen earlier Concerns about support for other devices CD/DVD Larger drives June 12, 2002 16
Bridge Selection Criteria All Bridge Chips are not Created Equal Consider Power Flexibility Translation Speed June 12, 2002 17
Power Some Mass Storage Class devices must be bus-powered Key chain drives Flash readers Most are not HDD CD, DVD, CDRW June 12, 2002 18
Programmable Vs Fixed ATA Interface Solutions Programmable Requires Learning Custom Features BIOS / OS support Performance tweaks Fixed Function Plug n Play No changes Maybe Fixed performance June 12, 2002 19
Programmable Device Benefits Work With Non ATA compliant devices Many optical drives are non-compliant in subtle ways Market Differentiation Add features beyond raw disk drive Special OS support Support different spec variants Boot Windows boot is still a work in progress. May need device changes June 12, 2002 20
IDE Translation The Class Spec only uses ATAPI commands Translation required for non-atapi devices Hard Drives Compact Flash Embedded Flash Other IDE devices New OS / BIOS may need more translation June 12, 2002 21
Error Recovery Errors are not special cases. They are a fact of life for removable media Error recovery strategies Drive firmware errors Some may only be fixable by a programmable solution Testing with errors is critical June 12, 2002 22
Speed ATA Interface Speed UDMA/66 = 500MBits/sec Buffering Buffering Larger buffers if no buffer on the drive Queuing Support Still undefined in the spec Enhanced Drivers June 12, 2002 23
Driver Performance System Configuration Software Configuration Mass Storage Drivers Used Test Results June 12, 2002 24
System Configuration System Tested P4 1.7Ghz, 128MB Windows XP Intel USB 2.0 Integrated Host Controller (ICH4) Test Devices Cypress ISD300 ATA/ATAPI Bridge Chip IBM DTLA-307030 HD (30.7GB, 7200RPM) Ricoh MP7120A CD-R/RW (12x10x32x) June 12, 2002 25
Software Configuration Software Stack Intel Labs EHCI Driver Microsoft USB Mass Storage Class Driver Cypress USB Mass Storage Class Driver Benchmark Software HD Tach 2.60 CD Tach 98 June 12, 2002 26
Software Configuration Intel Labs ECHI Evaluation Driver Custom ECHI driver developed by Intel Labs Four different binaries used in Benchmark Comparisons: Compiled Compiled with Interrupt Threshold of 1 (ITH1) High priority Compiled Compiled with Interrupt Threshold of 2 (ITH2) Compiled Compiled with Interrupt Threshold of 4 (ITH4) Compiled Compiled with Interrupt Threshold of 8 (ITH8) Lower priority June 12, 2002 27
Software Configuration Microsoft USB Mass Storage Class Driver USB Storage Class driver included in the Windows XP distribution Used to obtain the results of a Traditional implementation of the USB Storage Class BOT specification Cypress USB Mass Storage Class Driver Custom USB Storage Class driver developed by Cypress Added performance enhancements to eliminate the latency incurred by the Traditional implementation of the USB Storage Class BOT specification. June 12, 2002 28
Traditional Driver June 12, 2002 29
Performance Enhanced Implementation June 12, 2002 30
USB 2.0 Benchmark Comparisons Average Read Performance Traditional vs. Cypress performance enhanced implementation, plus Native IDE M B P S 30 25 20 15 10 5 0 ITH8 ITH4 ITH2 ITH1 Native Microsoft USB Storage Class Driver Cypress USB Storage Class Driver Native IDE June 12, 2002 31
USB 2.0 Benchmark Comparisons Average Write Performance Traditional vs. Cypress performance enhanced implementation, plus Native IDE M B P S 16 14 12 10 8 6 4 2 0 ITH8 ITH2 Native Microsoft USB Storage Class Driver Cypress USB Storage Class Driver Native IDE June 12, 2002 32
Summary Mass Storage Class Overview BOT Shared Interface for Commands and Data Bridge Selection Programmable Solutions Allow Customization Custom Drivers Boost Performance June 12, 2002 33
Questions and Answers June 12, 2002 34
Contact Information Marketing: Jack Woods VJW@cypress.com June 12, 2002 35