€• †Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ/translations/zh_CN/scsi/ufs”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ/translations/zh_TW/scsi/ufs”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ/translations/it_IT/scsi/ufs”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ/translations/ja_JP/scsi/ufs”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ/translations/ko_KR/scsi/ufs”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ/translations/pt_BR/scsi/ufs”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ/translations/sp_SP/scsi/ufs”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…””}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³Œ6/var/lib/git/docbuild/linux/Documentation/scsi/ufs.rst”h´KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒUniversal Flash Storage”h]”hŒUniversal Flash Storage”…””}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊh²hh³hÇh´Kubh¶)”}”(hXZContents 1. Overview 2. UFS Architecture Overview 2.1 Application Layer 2.2 UFS Transport Protocol (UTP) layer 2.3 UFS Interconnect (UIC) Layer 3. UFSHCD Overview 3.1 UFS controller initialization 3.2 UTP Transfer requests 3.3 UFS error handling 3.4 SCSI Error handling 4. BSG Support 5. UFS Reference Clock Frequency configuration”h]”hXZContents 1. Overview 2. UFS Architecture Overview 2.1 Application Layer 2.2 UFS Transport Protocol (UTP) layer 2.3 UFS Interconnect (UIC) Layer 3. UFSHCD Overview 3.1 UFS controller initialization 3.2 UTP Transfer requests 3.3 UFS error handling 3.4 SCSI Error handling 4. BSG Support 5. UFS Reference Clock Frequency configuration”…””}”hhÝsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1hµhhÊh²hh³hÇh´KubhÉ)”}”(hhh]”(hÎ)”}”(hŒ 1. Overview”h]”hŒ 1. Overview”…””}”(hhîh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhëh²hh³hÇh´KubhŒ paragraph”“”)”}”(hXÃUniversal Flash Storage (UFS) is a storage specification for flash devices. It aims to provide a universal storage interface for both embedded and removable flash memory-based storage in mobile devices such as smart phones and tablet computers. The specification is defined by JEDEC Solid State Technology Association. UFS is based on the MIPI M-PHY physical layer standard. UFS uses MIPI M-PHY as the physical layer and MIPI Unipro as the link layer.”h]”hXÃUniversal Flash Storage (UFS) is a storage specification for flash devices. It aims to provide a universal storage interface for both embedded and removable flash memory-based storage in mobile devices such as smart phones and tablet computers. The specification is defined by JEDEC Solid State Technology Association. UFS is based on the MIPI M-PHY physical layer standard. UFS uses MIPI M-PHY as the physical layer and MIPI Unipro as the link layer.”…””}”(hhþh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´Khhëh²hubhý)”}”(hŒ%The main goals of UFS are to provide:”h]”hŒ%The main goals of UFS are to provide:”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K#hhëh²hubhŒ block_quote”“”)”}”(hX„* Optimized performance: For UFS version 1.0 and 1.1 the target performance is as follows: - Support for Gear1 is mandatory (rate A: 1248Mbps, rate B: 1457.6Mbps) - Support for Gear2 is optional (rate A: 2496Mbps, rate B: 2915.2Mbps) Future version of the standard, - Gear3 (rate A: 4992Mbps, rate B: 5830.4Mbps) * Low power consumption * High random IOPs and low latency ”h]”hŒ bullet_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hX;Optimized performance: For UFS version 1.0 and 1.1 the target performance is as follows: - Support for Gear1 is mandatory (rate A: 1248Mbps, rate B: 1457.6Mbps) - Support for Gear2 is optional (rate A: 2496Mbps, rate B: 2915.2Mbps) Future version of the standard, - Gear3 (rate A: 4992Mbps, rate B: 5830.4Mbps) ”h]”(hý)”}”(hŒOptimized performance:”h]”hŒOptimized performance:”…””}”(hj+h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K%hj'ubhý)”}”(hŒAFor UFS version 1.0 and 1.1 the target performance is as follows:”h]”hŒAFor UFS version 1.0 and 1.1 the target performance is as follows:”…””}”(hj9h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K'hj'ubj!)”}”(hhh]”(j&)”}”(hŒESupport for Gear1 is mandatory (rate A: 1248Mbps, rate B: 1457.6Mbps)”h]”hý)”}”(hjLh]”hŒESupport for Gear1 is mandatory (rate A: 1248Mbps, rate B: 1457.6Mbps)”…””}”(hjNh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K)hjJubah}”(h]”h ]”h"]”h$]”h&]”uh1j%hjGubj&)”}”(hŒESupport for Gear2 is optional (rate A: 2496Mbps, rate B: 2915.2Mbps) ”h]”hý)”}”(hŒDSupport for Gear2 is optional (rate A: 2496Mbps, rate B: 2915.2Mbps)”h]”hŒDSupport for Gear2 is optional (rate A: 2496Mbps, rate B: 2915.2Mbps)”…””}”(hjeh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K*hjaubah}”(h]”h ]”h"]”h$]”h&]”uh1j%hjGubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1j h³hÇh´K)hj'ubhý)”}”(hŒFuture version of the standard,”h]”hŒFuture version of the standard,”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K,hj'ubj!)”}”(hhh]”j&)”}”(hŒ-Gear3 (rate A: 4992Mbps, rate B: 5830.4Mbps) ”h]”hý)”}”(hŒ,Gear3 (rate A: 4992Mbps, rate B: 5830.4Mbps)”h]”hŒ,Gear3 (rate A: 4992Mbps, rate B: 5830.4Mbps)”…””}”(hj–h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K.hj’ubah}”(h]”h ]”h"]”h$]”h&]”uh1j%hjubah}”(h]”h ]”h"]”h$]”h&]”jj€uh1j h³hÇh´K.hj'ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j%hj"ubj&)”}”(hŒLow power consumption”h]”hý)”}”(hj¸h]”hŒLow power consumption”…””}”(hjºh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K0hj¶ubah}”(h]”h ]”h"]”h$]”h&]”uh1j%hj"ubj&)”}”(hŒ"High random IOPs and low latency ”h]”hý)”}”(hŒ High random IOPs and low latency”h]”hŒ High random IOPs and low latency”…””}”(hjÑh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K1hjÍubah}”(h]”h ]”h"]”h$]”h&]”uh1j%hj"ubeh}”(h]”h ]”h"]”h$]”h&]”jŒ*”uh1j h³hÇh´K%hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K%hhëh²hubeh}”(h]”Œoverview”ah ]”h"]”Œ 1. overview”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KubhÉ)”}”(hhh]”(hÎ)”}”(hŒ2. UFS Architecture Overview”h]”hŒ2. UFS Architecture Overview”…””}”(hjýh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjúh²hh³hÇh´K5ubhý)”}”(hŒ^UFS has a layered communication architecture which is based on SCSI SAM-5 architectural model.”h]”hŒ^UFS has a layered communication architecture which is based on SCSI SAM-5 architectural model.”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K7hjúh²hubhý)”}”(hŒ@UFS communication architecture consists of the following layers.”h]”hŒ@UFS communication architecture consists of the following layers.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K:hjúh²hubhÉ)”}”(hhh]”(hÎ)”}”(hŒ2.1 Application Layer”h]”hŒ2.1 Application Layer”…””}”(hj*h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj'h²hh³hÇh´K=ubj)”}”(hXrThe Application layer is composed of the UFS command set layer (UCS), Task Manager and Device manager. The UFS interface is designed to be protocol agnostic, however SCSI has been selected as a baseline protocol for versions 1.0 and 1.1 of the UFS protocol layer. UFS supports a subset of SCSI commands defined by SPC-4 and SBC-3. * UCS: It handles SCSI commands supported by UFS specification. * Task manager: It handles task management functions defined by the UFS which are meant for command queue control. * Device manager: It handles device level operations and device configuration operations. Device level operations mainly involve device power management operations and commands to Interconnect layers. Device level configurations involve handling of query requests which are used to modify and retrieve configuration information of the device. ”h]”(hý)”}”(hXThe Application layer is composed of the UFS command set layer (UCS), Task Manager and Device manager. The UFS interface is designed to be protocol agnostic, however SCSI has been selected as a baseline protocol for versions 1.0 and 1.1 of the UFS protocol layer.”h]”hXThe Application layer is composed of the UFS command set layer (UCS), Task Manager and Device manager. The UFS interface is designed to be protocol agnostic, however SCSI has been selected as a baseline protocol for versions 1.0 and 1.1 of the UFS protocol layer.”…””}”(hj<h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K?hj8ubhý)”}”(hŒBUFS supports a subset of SCSI commands defined by SPC-4 and SBC-3.”h]”hŒBUFS supports a subset of SCSI commands defined by SPC-4 and SBC-3.”…””}”(hjJh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´KDhj8ubj!)”}”(hhh]”(j&)”}”(hŒ>UCS: It handles SCSI commands supported by UFS specification.”h]”hŒdefinition_list”“”)”}”(hhh]”hŒdefinition_list_item”“”)”}”(hŒ=UCS: It handles SCSI commands supported by UFS specification.”h]”(hŒterm”“”)”}”(hŒUCS:”h]”hŒUCS:”…””}”(hjlh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jjh³hÇh´KFhjfubhŒ definition”“”)”}”(hhh]”hý)”}”(hŒ8It handles SCSI commands supported by UFS specification.”h]”hŒ8It handles SCSI commands supported by UFS specification.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´KGhj|ubah}”(h]”h ]”h"]”h$]”h&]”uh1jzhjfubeh}”(h]”h ]”h"]”h$]”h&]”uh1jdh³hÇh´KFhjaubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hj[ubah}”(h]”h ]”h"]”h$]”h&]”uh1j%hjXubj&)”}”(hŒrTask manager: It handles task management functions defined by the UFS which are meant for command queue control.”h]”j`)”}”(hhh]”je)”}”(hŒpTask manager: It handles task management functions defined by the UFS which are meant for command queue control.”h]”(jk)”}”(hŒ Task manager:”h]”hŒ Task manager:”…””}”(hj°h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jjh³hÇh´KIhj¬ubj{)”}”(hhh]”hý)”}”(hŒbIt handles task management functions defined by the UFS which are meant for command queue control.”h]”hŒbIt handles task management functions defined by the UFS which are meant for command queue control.”…””}”(hjÁh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´KIhj¾ubah}”(h]”h ]”h"]”h$]”h&]”uh1jzhj¬ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jdh³hÇh´KIhj©ubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hj¥ubah}”(h]”h ]”h"]”h$]”h&]”uh1j%hjXubj&)”}”(hX[Device manager: It handles device level operations and device configuration operations. Device level operations mainly involve device power management operations and commands to Interconnect layers. Device level configurations involve handling of query requests which are used to modify and retrieve configuration information of the device. ”h]”j`)”}”(hhh]”je)”}”(hXUDevice manager: It handles device level operations and device configuration operations. Device level operations mainly involve device power management operations and commands to Interconnect layers. Device level configurations involve handling of query requests which are used to modify and retrieve configuration information of the device. ”h]”(jk)”}”(hŒDevice manager:”h]”hŒDevice manager:”…””}”(hjòh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jjh³hÇh´KQhjîubj{)”}”(hhh]”hý)”}”(hXDIt handles device level operations and device configuration operations. Device level operations mainly involve device power management operations and commands to Interconnect layers. Device level configurations involve handling of query requests which are used to modify and retrieve configuration information of the device.”h]”hXDIt handles device level operations and device configuration operations. Device level operations mainly involve device power management operations and commands to Interconnect layers. Device level configurations involve handling of query requests which are used to modify and retrieve configuration information of the device.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´KLhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jzhjîubeh}”(h]”h ]”h"]”h$]”h&]”uh1jdh³hÇh´KQhjëubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hjçubah}”(h]”h ]”h"]”h$]”h&]”uh1j%hjXubeh}”(h]”h ]”h"]”h$]”h&]”jjëuh1j h³hÇh´KFhj8ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K?hj'h²hubeh}”(h]”Œapplication-layer”ah ]”h"]”Œ2.1 application layer”ah$]”h&]”uh1hÈhjúh²hh³hÇh´K=ubhÉ)”}”(hhh]”(hÎ)”}”(hŒ&2.2 UFS Transport Protocol (UTP) layer”h]”hŒ&2.2 UFS Transport Protocol (UTP) layer”…””}”(hj@h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj=h²hh³hÇh´KTubj)”}”(hXgThe UTP layer provides services for the higher layers through Service Access Points. UTP defines 3 service access points for higher layers. * UDM_SAP: Device manager service access point is exposed to device manager for device level operations. These device level operations are done through query requests. * UTP_CMD_SAP: Command service access point is exposed to UFS command set layer (UCS) to transport commands. * UTP_TM_SAP: Task management service access point is exposed to task manager to transport task management functions. UTP transports messages through UFS protocol information unit (UPIU). ”h]”(hý)”}”(hŒ‹The UTP layer provides services for the higher layers through Service Access Points. UTP defines 3 service access points for higher layers.”h]”hŒ‹The UTP layer provides services for the higher layers through Service Access Points. UTP defines 3 service access points for higher layers.”…””}”(hjRh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´KVhjNubj!)”}”(hhh]”(j&)”}”(hŒ¥UDM_SAP: Device manager service access point is exposed to device manager for device level operations. These device level operations are done through query requests.”h]”hý)”}”(hŒ¥UDM_SAP: Device manager service access point is exposed to device manager for device level operations. These device level operations are done through query requests.”h]”hŒ¥UDM_SAP: Device manager service access point is exposed to device manager for device level operations. These device level operations are done through query requests.”…””}”(hjgh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´KZhjcubah}”(h]”h ]”h"]”h$]”h&]”uh1j%hj`ubj&)”}”(hŒjUTP_CMD_SAP: Command service access point is exposed to UFS command set layer (UCS) to transport commands.”h]”hý)”}”(hŒjUTP_CMD_SAP: Command service access point is exposed to UFS command set layer (UCS) to transport commands.”h]”hŒjUTP_CMD_SAP: Command service access point is exposed to UFS command set layer (UCS) to transport commands.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K]hj{ubah}”(h]”h ]”h"]”h$]”h&]”uh1j%hj`ubj&)”}”(hŒtUTP_TM_SAP: Task management service access point is exposed to task manager to transport task management functions. ”h]”hý)”}”(hŒsUTP_TM_SAP: Task management service access point is exposed to task manager to transport task management functions.”h]”hŒsUTP_TM_SAP: Task management service access point is exposed to task manager to transport task management functions.”…””}”(hj—h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K_hj“ubah}”(h]”h ]”h"]”h$]”h&]”uh1j%hj`ubeh}”(h]”h ]”h"]”h$]”h&]”jjëuh1j h³hÇh´KZhjNubhý)”}”(hŒEUTP transports messages through UFS protocol information unit (UPIU).”h]”hŒEUTP transports messages through UFS protocol information unit (UPIU).”…””}”(hj±h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´KbhjNubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KVhj=h²hubeh}”(h]”Œ ufs-transport-protocol-utp-layer”ah ]”h"]”Œ&2.2 ufs transport protocol (utp) layer”ah$]”h&]”uh1hÈhjúh²hh³hÇh´KTubhÉ)”}”(hhh]”(hÎ)”}”(hŒ 2.3 UFS Interconnect (UIC) Layer”h]”hŒ 2.3 UFS Interconnect (UIC) Layer”…””}”(hjÐh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjÍh²hh³hÇh´Keubj)”}”(hXDUIC is the lowest layer of the UFS layered architecture. It handles the connection between UFS host and UFS device. UIC consists of MIPI UniPro and MIPI M-PHY. UIC provides 2 service access points to upper layer: * UIC_SAP: To transport UPIU between UFS host and UFS device. * UIO_SAP: To issue commands to Unipro layers. ”h]”(hý)”}”(hŒÔUIC is the lowest layer of the UFS layered architecture. It handles the connection between UFS host and UFS device. UIC consists of MIPI UniPro and MIPI M-PHY. UIC provides 2 service access points to upper layer:”h]”hŒÔUIC is the lowest layer of the UFS layered architecture. It handles the connection between UFS host and UFS device. UIC consists of MIPI UniPro and MIPI M-PHY. UIC provides 2 service access points to upper layer:”…””}”(hjâh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´KghjÞubj!)”}”(hhh]”(j&)”}”(hŒ;UIC_SAP: To transport UPIU between UFS host and UFS device.”h]”hý)”}”(hjõh]”hŒ;UIC_SAP: To transport UPIU between UFS host and UFS device.”…””}”(hj÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´Klhjóubah}”(h]”h ]”h"]”h$]”h&]”uh1j%hjðubj&)”}”(hŒ.UIO_SAP: To issue commands to Unipro layers. ”h]”hý)”}”(hŒ,UIO_SAP: To issue commands to Unipro layers.”h]”hŒ,UIO_SAP: To issue commands to Unipro layers.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´Kmhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1j%hjðubeh}”(h]”h ]”h"]”h$]”h&]”jjëuh1j h³hÇh´KlhjÞubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KghjÍh²hubeh}”(h]”Œufs-interconnect-uic-layer”ah ]”h"]”Œ 2.3 ufs interconnect (uic) layer”ah$]”h&]”uh1hÈhjúh²hh³hÇh´Keubeh}”(h]”Œufs-architecture-overview”ah ]”h"]”Œ2. ufs architecture overview”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K5ubhÉ)”}”(hhh]”(hÎ)”}”(hŒ3. UFSHCD Overview”h]”hŒ3. UFSHCD Overview”…””}”(hjAh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj>h²hh³hÇh´Kqubhý)”}”(hŒÂThe UFS host controller driver is based on the Linux SCSI Framework. UFSHCD is a low-level device driver which acts as an interface between the SCSI Midlayer and PCIe-based UFS host controllers.”h]”hŒÂThe UFS host controller driver is based on the Linux SCSI Framework. UFSHCD is a low-level device driver which acts as an interface between the SCSI Midlayer and PCIe-based UFS host controllers.”…””}”(hjOh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´Kshj>h²hubhý)”}”(hŒGThe current UFSHCD implementation supports the following functionality:”h]”hŒGThe current UFSHCD implementation supports the following functionality:”…””}”(hj]h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´Kwhj>h²hubhÉ)”}”(hhh]”(hÎ)”}”(hŒ!3.1 UFS controller initialization”h]”hŒ!3.1 UFS controller initialization”…””}”(hjnh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjkh²hh³hÇh´Kzubj)”}”(hŒ£The initialization module brings the UFS host controller to active state and prepares the controller to transfer commands/responses between UFSHCD and UFS device. ”h]”hý)”}”(hŒ¢The initialization module brings the UFS host controller to active state and prepares the controller to transfer commands/responses between UFSHCD and UFS device.”h]”hŒ¢The initialization module brings the UFS host controller to active state and prepares the controller to transfer commands/responses between UFSHCD and UFS device.”…””}”(hj€h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K|hj|ubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K|hjkh²hubeh}”(h]”Œufs-controller-initialization”ah ]”h"]”Œ!3.1 ufs controller initialization”ah$]”h&]”uh1hÈhj>h²hh³hÇh´KzubhÉ)”}”(hhh]”(hÎ)”}”(hŒ3.2 UTP Transfer requests”h]”hŒ3.2 UTP Transfer requests”…””}”(hjŸh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjœh²hh³hÇh´Kubj)”}”(hX3Transfer request handling module of UFSHCD receives SCSI commands from the SCSI Midlayer, forms UPIUs and issues the UPIUs to the UFS Host controller. Also, the module decodes responses received from the UFS host controller in the form of UPIUs and intimates the SCSI Midlayer of the status of the command. ”h]”hý)”}”(hX2Transfer request handling module of UFSHCD receives SCSI commands from the SCSI Midlayer, forms UPIUs and issues the UPIUs to the UFS Host controller. Also, the module decodes responses received from the UFS host controller in the form of UPIUs and intimates the SCSI Midlayer of the status of the command.”h]”hX2Transfer request handling module of UFSHCD receives SCSI commands from the SCSI Midlayer, forms UPIUs and issues the UPIUs to the UFS Host controller. Also, the module decodes responses received from the UFS host controller in the form of UPIUs and intimates the SCSI Midlayer of the status of the command.”…””}”(hj±h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´Kƒhj­ubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Kƒhjœh²hubeh}”(h]”Œutp-transfer-requests”ah ]”h"]”Œ3.2 utp transfer requests”ah$]”h&]”uh1hÈhj>h²hh³hÇh´KubhÉ)”}”(hhh]”(hÎ)”}”(hŒ3.3 UFS error handling”h]”hŒ3.3 UFS error handling”…””}”(hjÐh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjÍh²hh³hÇh´KŠubj)”}”(hŒ{Error handling module handles Host controller fatal errors, Device fatal errors and UIC interconnect layer-related errors. ”h]”hý)”}”(hŒzError handling module handles Host controller fatal errors, Device fatal errors and UIC interconnect layer-related errors.”h]”hŒzError handling module handles Host controller fatal errors, Device fatal errors and UIC interconnect layer-related errors.”…””}”(hjâh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´KŒhjÞubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KŒhjÍh²hubeh}”(h]”Œufs-error-handling”ah ]”h"]”Œ3.3 ufs error handling”ah$]”h&]”uh1hÈhj>h²hh³hÇh´KŠubhÉ)”}”(hhh]”(hÎ)”}”(hŒ3.4 SCSI Error handling”h]”hŒ3.4 SCSI Error handling”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjþh²hh³hÇh´Kubj)”}”(hXkThis is done through UFSHCD SCSI error handling routines registered with the SCSI Midlayer. Examples of some of the error handling commands issues by the SCSI Midlayer are Abort task, LUN reset and host reset. UFSHCD Routines to perform these tasks are registered with SCSI Midlayer through .eh_abort_handler, .eh_device_reset_handler and .eh_host_reset_handler. ”h]”hý)”}”(hXjThis is done through UFSHCD SCSI error handling routines registered with the SCSI Midlayer. Examples of some of the error handling commands issues by the SCSI Midlayer are Abort task, LUN reset and host reset. UFSHCD Routines to perform these tasks are registered with SCSI Midlayer through .eh_abort_handler, .eh_device_reset_handler and .eh_host_reset_handler.”h]”hXjThis is done through UFSHCD SCSI error handling routines registered with the SCSI Midlayer. Examples of some of the error handling commands issues by the SCSI Midlayer are Abort task, LUN reset and host reset. UFSHCD Routines to perform these tasks are registered with SCSI Midlayer through .eh_abort_handler, .eh_device_reset_handler and .eh_host_reset_handler.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K’hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K’hjþh²hubhý)”}”(hŒaIn this version of UFSHCD, Query requests and power management functionality are not implemented.”h]”hŒaIn this version of UFSHCD, Query requests and power management functionality are not implemented.”…””}”(hj'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K™hjþh²hubeh}”(h]”Œscsi-error-handling”ah ]”h"]”Œ3.4 scsi error handling”ah$]”h&]”uh1hÈhj>h²hh³hÇh´Kubeh}”(h]”Œufshcd-overview”ah ]”h"]”Œ3. ufshcd overview”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KqubhÉ)”}”(hhh]”(hÎ)”}”(hŒ4. BSG Support”h]”hŒ4. BSG Support”…””}”(hjHh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjEh²hh³hÇh´Kubhý)”}”(hX This transport driver supports exchanging UFS protocol information units (UPIUs) with a UFS device. Typically, user space will allocate struct ufs_bsg_request and struct ufs_bsg_reply (see ufs_bsg.h) as request_upiu and reply_upiu respectively. Filling those UPIUs should be done in accordance with JEDEC spec UFS2.1 paragraph 10.7. *Caveat emptor*: The driver makes no further input validations and sends the UPIU to the device as it is. Open the bsg device in /dev/ufs-bsg and send SG_IO with the applicable sg_io_v4::”h]”(hXNThis transport driver supports exchanging UFS protocol information units (UPIUs) with a UFS device. Typically, user space will allocate struct ufs_bsg_request and struct ufs_bsg_reply (see ufs_bsg.h) as request_upiu and reply_upiu respectively. Filling those UPIUs should be done in accordance with JEDEC spec UFS2.1 paragraph 10.7. ”…””}”(hjVh²hh³Nh´NubhŒemphasis”“”)”}”(hŒ*Caveat emptor*”h]”hŒ Caveat emptor”…””}”(hj`h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j^hjVubhŒ¬: The driver makes no further input validations and sends the UPIU to the device as it is. Open the bsg device in /dev/ufs-bsg and send SG_IO with the applicable sg_io_v4:”…””}”(hjVh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´KŸhjEh²hubhŒ literal_block”“”)”}”(hXio_hdr_v4.guard = 'Q'; io_hdr_v4.protocol = BSG_PROTOCOL_SCSI; io_hdr_v4.subprotocol = BSG_SUB_PROTOCOL_SCSI_TRANSPORT; io_hdr_v4.response = (__u64)reply_upiu; io_hdr_v4.max_response_len = reply_len; io_hdr_v4.request_len = request_len; io_hdr_v4.request = (__u64)request_upiu; if (dir == SG_DXFER_TO_DEV) { io_hdr_v4.dout_xfer_len = (uint32_t)byte_cnt; io_hdr_v4.dout_xferp = (uintptr_t)(__u64)buff; } else { io_hdr_v4.din_xfer_len = (uint32_t)byte_cnt; io_hdr_v4.din_xferp = (uintptr_t)(__u64)buff; }”h]”hXio_hdr_v4.guard = 'Q'; io_hdr_v4.protocol = BSG_PROTOCOL_SCSI; io_hdr_v4.subprotocol = BSG_SUB_PROTOCOL_SCSI_TRANSPORT; io_hdr_v4.response = (__u64)reply_upiu; io_hdr_v4.max_response_len = reply_len; io_hdr_v4.request_len = request_len; io_hdr_v4.request = (__u64)request_upiu; if (dir == SG_DXFER_TO_DEV) { io_hdr_v4.dout_xfer_len = (uint32_t)byte_cnt; io_hdr_v4.dout_xferp = (uintptr_t)(__u64)buff; } else { io_hdr_v4.din_xfer_len = (uint32_t)byte_cnt; io_hdr_v4.din_xferp = (uintptr_t)(__u64)buff; }”…””}”hjzsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jxh³hÇh´K¨hjEh²hubhý)”}”(hŒQIf you wish to read or write a descriptor, use the appropriate xferp of sg_io_v4.”h]”hŒQIf you wish to read or write a descriptor, use the appropriate xferp of sg_io_v4.”…””}”(hjˆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K·hjEh²hubhý)”}”(hŒmThe userspace tool that interacts with the ufs-bsg endpoint and uses its UPIU-based protocol is available at:”h]”hŒmThe userspace tool that interacts with the ufs-bsg endpoint and uses its UPIU-based protocol is available at:”…””}”(hj–h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´KºhjEh²hubj)”}”(hŒ6https://github.com/westerndigitalcorporation/ufs-tool ”h]”hý)”}”(hŒ5https://github.com/westerndigitalcorporation/ufs-tool”h]”hŒ reference”“”)”}”(hjªh]”hŒ5https://github.com/westerndigitalcorporation/ufs-tool”…””}”(hj®h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jªuh1j¬hj¨ubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K½hj¤ubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K½hjEh²hubhý)”}”(hŒfFor more detailed information about the tool and its supported features, please see the tool's README.”h]”hŒhFor more detailed information about the tool and its supported features, please see the tool’s README.”…””}”(hjÈh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K¿hjEh²hubhý)”}”(hŒ#UFS specifications can be found at:”h]”hŒ#UFS specifications can be found at:”…””}”(hjÖh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´KÂhjEh²hubj!)”}”(hhh]”(j&)”}”(hŒ?UFS - http://www.jedec.org/sites/default/files/docs/JESD220.pdf”h]”hý)”}”(hjéh]”(hŒUFS - ”…””}”(hjëh²hh³Nh´Nubj­)”}”(hŒ9http://www.jedec.org/sites/default/files/docs/JESD220.pdf”h]”hŒ9http://www.jedec.org/sites/default/files/docs/JESD220.pdf”…””}”(hjòh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jôuh1j¬hjëubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´KÄhjçubah}”(h]”h ]”h"]”h$]”h&]”uh1j%hjäh²hh³hÇh´Nubj&)”}”(hŒCUFSHCI - http://www.jedec.org/sites/default/files/docs/JESD223.pdf ”h]”hý)”}”(hŒBUFSHCI - http://www.jedec.org/sites/default/files/docs/JESD223.pdf”h]”(hŒ UFSHCI - ”…””}”(hjh²hh³Nh´Nubj­)”}”(hŒ9http://www.jedec.org/sites/default/files/docs/JESD223.pdf”h]”hŒ9http://www.jedec.org/sites/default/files/docs/JESD223.pdf”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”juh1j¬hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´KÅhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1j%hjäh²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jj€uh1j h³hÇh´KÄhjEh²hubeh}”(h]”Œ bsg-support”ah ]”h"]”Œ4. bsg support”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KubhÉ)”}”(hhh]”(hÎ)”}”(hŒ.5. UFS Reference Clock Frequency configuration”h]”hŒ.5. UFS Reference Clock Frequency configuration”…””}”(hjEh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjBh²hh³hÇh´KÈubhý)”}”(hX‚Devicetree can define a clock named "ref_clk" under the UFS controller node to specify the intended reference clock frequency for the UFS storage parts. ACPI-based system can specify the frequency using ACPI Device-Specific Data property named "ref-clk-freq". In both ways the value is interpreted as frequency in Hz and must match one of the values given in the UFS specification. UFS subsystem will attempt to read the value when executing common controller initialization. If the value is available, UFS subsystem will ensure the bRefClkFreq attribute of the UFS storage device is set accordingly and will modify it if there is a mismatch.”h]”hXŠDevicetree can define a clock named “ref_clk†under the UFS controller node to specify the intended reference clock frequency for the UFS storage parts. ACPI-based system can specify the frequency using ACPI Device-Specific Data property named “ref-clk-freqâ€. In both ways the value is interpreted as frequency in Hz and must match one of the values given in the UFS specification. UFS subsystem will attempt to read the value when executing common controller initialization. If the value is available, UFS subsystem will ensure the bRefClkFreq attribute of the UFS storage device is set accordingly and will modify it if there is a mismatch.”…””}”(hjSh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´KÊhjBh²hubeh}”(h]”Œ+ufs-reference-clock-frequency-configuration”ah ]”h"]”Œ.5. ufs reference clock frequency configuration”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KÈubeh}”(h]”Œuniversal-flash-storage”ah ]”h"]”Œuniversal flash storage”ah$]”h&]”uh1hÈhhh²hh³hÇh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÇuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(hÍNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j”Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÇŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jnjkj÷jôj;j8j:j7jÊjÇj3j0jBj?j™j–jÊjÇjûjøj:j7j?j<jfjcuŒ nametypes”}”(jn‰j÷‰j;‰j:‰jʉj3‰jB‰j™‰jʉjû‰j:‰j?‰jf‰uh}”(jkhÊjôhëj8júj7j'jÇj=j0jÍj?j>j–jkjÇjœjøjÍj7jþj<jEjcjBuŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.