ufs.txt 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. Universal Flash Storage
  2. =======================
  3. Contents
  4. --------
  5. 1. Overview
  6. 2. UFS Architecture Overview
  7. 2.1 Application Layer
  8. 2.2 UFS Transport Protocol(UTP) layer
  9. 2.3 UFS Interconnect(UIC) Layer
  10. 3. UFSHCD Overview
  11. 3.1 UFS controller initialization
  12. 3.2 UTP Transfer requests
  13. 3.3 UFS error handling
  14. 3.4 SCSI Error handling
  15. 1. Overview
  16. -----------
  17. Universal Flash Storage(UFS) is a storage specification for flash devices.
  18. It is aimed to provide a universal storage interface for both
  19. embedded and removable flash memory based storage in mobile
  20. devices such as smart phones and tablet computers. The specification
  21. is defined by JEDEC Solid State Technology Association. UFS is based
  22. on MIPI M-PHY physical layer standard. UFS uses MIPI M-PHY as the
  23. physical layer and MIPI Unipro as the link layer.
  24. The main goals of UFS is to provide,
  25. * Optimized performance:
  26. For UFS version 1.0 and 1.1 the target performance is as follows,
  27. Support for Gear1 is mandatory (rate A: 1248Mbps, rate B: 1457.6Mbps)
  28. Support for Gear2 is optional (rate A: 2496Mbps, rate B: 2915.2Mbps)
  29. Future version of the standard,
  30. Gear3 (rate A: 4992Mbps, rate B: 5830.4Mbps)
  31. * Low power consumption
  32. * High random IOPs and low latency
  33. 2. UFS Architecture Overview
  34. ----------------------------
  35. UFS has a layered communication architecture which is based on SCSI
  36. SAM-5 architectural model.
  37. UFS communication architecture consists of following layers,
  38. 2.1 Application Layer
  39. The Application layer is composed of UFS command set layer(UCS),
  40. Task Manager and Device manager. The UFS interface is designed to be
  41. protocol agnostic, however SCSI has been selected as a baseline
  42. protocol for versions 1.0 and 1.1 of UFS protocol layer.
  43. UFS supports subset of SCSI commands defined by SPC-4 and SBC-3.
  44. * UCS: It handles SCSI commands supported by UFS specification.
  45. * Task manager: It handles task management functions defined by the
  46. UFS which are meant for command queue control.
  47. * Device manager: It handles device level operations and device
  48. configuration operations. Device level operations mainly involve
  49. device power management operations and commands to Interconnect
  50. layers. Device level configurations involve handling of query
  51. requests which are used to modify and retrieve configuration
  52. information of the device.
  53. 2.2 UFS Transport Protocol(UTP) layer
  54. UTP layer provides services for
  55. the higher layers through Service Access Points. UTP defines 3
  56. service access points for higher layers.
  57. * UDM_SAP: Device manager service access point is exposed to device
  58. manager for device level operations. These device level operations
  59. are done through query requests.
  60. * UTP_CMD_SAP: Command service access point is exposed to UFS command
  61. set layer(UCS) to transport commands.
  62. * UTP_TM_SAP: Task management service access point is exposed to task
  63. manager to transport task management functions.
  64. UTP transports messages through UFS protocol information unit(UPIU).
  65. 2.3 UFS Interconnect(UIC) Layer
  66. UIC is the lowest layer of UFS layered architecture. It handles
  67. connection between UFS host and UFS device. UIC consists of
  68. MIPI UniPro and MIPI M-PHY. UIC provides 2 service access points
  69. to upper layer,
  70. * UIC_SAP: To transport UPIU between UFS host and UFS device.
  71. * UIO_SAP: To issue commands to Unipro layers.
  72. 3. UFSHCD Overview
  73. ------------------
  74. The UFS host controller driver is based on Linux SCSI Framework.
  75. UFSHCD is a low level device driver which acts as an interface between
  76. SCSI Midlayer and PCIe based UFS host controllers.
  77. The current UFSHCD implementation supports following functionality,
  78. 3.1 UFS controller initialization
  79. The initialization module brings UFS host controller to active state
  80. and prepares the controller to transfer commands/response between
  81. UFSHCD and UFS device.
  82. 3.2 UTP Transfer requests
  83. Transfer request handling module of UFSHCD receives SCSI commands
  84. from SCSI Midlayer, forms UPIUs and issues the UPIUs to UFS Host
  85. controller. Also, the module decodes, responses received from UFS
  86. host controller in the form of UPIUs and intimates the SCSI Midlayer
  87. of the status of the command.
  88. 3.3 UFS error handling
  89. Error handling module handles Host controller fatal errors,
  90. Device fatal errors and UIC interconnect layer related errors.
  91. 3.4 SCSI Error handling
  92. This is done through UFSHCD SCSI error handling routines registered
  93. with SCSI Midlayer. Examples of some of the error handling commands
  94. issues by SCSI Midlayer are Abort task, Lun reset and host reset.
  95. UFSHCD Routines to perform these tasks are registered with
  96. SCSI Midlayer through .eh_abort_handler, .eh_device_reset_handler and
  97. .eh_host_reset_handler.
  98. In this version of UFSHCD Query requests and power management
  99. functionality are not implemented.
  100. UFS Specifications can be found at,
  101. UFS - http://www.jedec.org/sites/default/files/docs/JESD220.pdf
  102. UFSHCI - http://www.jedec.org/sites/default/files/docs/JESD223.pdf