Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2031670ybf; Mon, 2 Mar 2020 00:18:47 -0800 (PST) X-Google-Smtp-Source: ADFU+vsJOb5zp+q+Msgt4LuKBTcINVbCPIrqHGXU/BSTFsBRfBlkSslPCIp+2ByBv1nAMujHeuwz X-Received: by 2002:a05:6830:1e58:: with SMTP id e24mr1827402otj.267.1583137127570; Mon, 02 Mar 2020 00:18:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583137127; cv=none; d=google.com; s=arc-20160816; b=rswt6SbECXMKHMBn7D7zJ3SjInsR8iBlh6IO/XENQq+CigF99nONqSZKpGwCMoJMI8 3CTfpAI2jGTXBmeWiOSXV7plCw5F7at0gUda324qphg7iqi9R7rDrjJ6p6imuGfdZuy9 YmVSpJo3UD29bGrHCebud82pM234W5jRC3H2VH6WohVMwGKcAgPC8a6X6BVTej2k20ML RoHUK/7sHzFHijb5zVnG+QQGmmxPmUWUBUAYY2aG0+WRzK/rgaHAyy4tzyjnMAeUaYfR 46BD+nr8KbB7jCfGrlLI3t8D0UF9mLkbJyniCN+3rI8ib9rXSNqWTHJTHkkZ/ZbZwh4i uA1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=evs1CRa6N+STDUh3L/ZXy1ZUE0TEwI0xfsKTmpiBo5Y=; b=aUzsPiQMLvjy1hCheB/IGdWR0lqZc8GAdndkT/3qzCUdeBaKC3C4XbpJ327ZLZ2FW5 WNqTdO/0B6p/kJCNJzfiC1MEXKqnY2GcOvvxyj9Vgjv67vPlRhnr2vvyU21VAGhpARcm byu6XbeX0SFqipI1XK8fu1ulWA9apvOzSQYCMS638RZM9QvZBM6a7MoMA52f2dWUsJA7 /dXA/cgbqxENhMT+F7eY8AFDKqKxQbxjIDMuoDQYMzdQ0CsFl7YVEHFlPcUOqQPYr1hc 9JLLJG2rDNnZr4ib/Zz4SaOCL8XJDlCbV5Nf5GlaI00O5oLJkLMsEsGXgiN77EApAoDi 7iuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BtT32kPt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e21si6302387oti.124.2020.03.02.00.18.35; Mon, 02 Mar 2020 00:18:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BtT32kPt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727577AbgCBIRI (ORCPT + 99 others); Mon, 2 Mar 2020 03:17:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:57210 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727361AbgCBIQY (ORCPT ); Mon, 2 Mar 2020 03:16:24 -0500 Received: from mail.kernel.org (ip5f5ad4e9.dynamic.kabel-deutschland.de [95.90.212.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F35A52470A; Mon, 2 Mar 2020 08:16:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583136980; bh=vy+dLGrSL8+cXX3QG/G5aDP/hpGOIVd5o6AkEw1RqEI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BtT32kPtbiWjqPVZom6G1TYIToxy1bNZGAuK663aUbJcU52TcAN3z1acU/awHusCR VjeC5o5EqZL4pyCnIu3uErzGzpRyvArFGvIoG01zH8J3slfiIKYI7xKPqyY9/BapBY i3WFdWHvKiCQsuRnWD3gSj97gUjfEbAP78K4atB8= Received: from mchehab by mail.kernel.org with local (Exim 4.92.3) (envelope-from ) id 1j8gFO-0003zo-2m; Mon, 02 Mar 2020 09:16:18 +0100 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , Alim Akhtar , Avri Altman , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org Subject: [PATCH 40/42] docs: scsi: convert ufs.txt to ReST Date: Mon, 2 Mar 2020 09:16:13 +0100 Message-Id: <052d45576e342a217185e91a83793b384b1592a4.1583136624.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab --- Documentation/scsi/index.rst | 1 + Documentation/scsi/{ufs.txt => ufs.rst} | 84 ++++++++++++++++--------- MAINTAINERS | 2 +- drivers/scsi/ufs/Kconfig | 2 +- 4 files changed, 57 insertions(+), 32 deletions(-) rename Documentation/scsi/{ufs.txt => ufs.rst} (79%) diff --git a/Documentation/scsi/index.rst b/Documentation/scsi/index.rst index df005cb94f6b..27720d145eff 100644 --- a/Documentation/scsi/index.rst +++ b/Documentation/scsi/index.rst @@ -44,5 +44,6 @@ Linux SCSI Subsystem sym53c500_cs sym53c8xx_2 tcm_qla2xxx + ufs scsi_transport_srp/figures diff --git a/Documentation/scsi/ufs.txt b/Documentation/scsi/ufs.rst similarity index 79% rename from Documentation/scsi/ufs.txt rename to Documentation/scsi/ufs.rst index 81842ec3e116..a920c0a5a1f6 100644 --- a/Documentation/scsi/ufs.txt +++ b/Documentation/scsi/ufs.rst @@ -1,24 +1,26 @@ - Universal Flash Storage - ======================= +.. SPDX-License-Identifier: GPL-2.0 +======================= +Universal Flash Storage +======================= -Contents --------- -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 +.. Contents + + 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 1. Overview ------------ +=========== Universal Flash Storage(UFS) is a storage specification for flash devices. It is aimed to provide a universal storage interface for both @@ -28,19 +30,25 @@ is defined by JEDEC Solid State Technology Association. UFS is based on MIPI M-PHY physical layer standard. UFS uses MIPI M-PHY as the physical layer and MIPI Unipro as the link layer. -The main goals of UFS is to provide, +The main goals of UFS is to provide: + * 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) + + 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) + + - Gear3 (rate A: 4992Mbps, rate B: 5830.4Mbps) + * Low power consumption * High random IOPs and low latency 2. UFS Architecture Overview ----------------------------- +============================ UFS has a layered communication architecture which is based on SCSI SAM-5 architectural model. @@ -48,16 +56,22 @@ SAM-5 architectural model. UFS communication architecture consists of following layers, 2.1 Application Layer +--------------------- The Application layer is composed of 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 UFS protocol layer. + UFS supports 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 + + * 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 + * 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 @@ -65,10 +79,12 @@ UFS communication architecture consists of following layers, information of the device. 2.2 UFS Transport Protocol(UTP) layer +------------------------------------- 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. @@ -76,20 +92,23 @@ UFS communication architecture consists of following layers, 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). 2.3 UFS Interconnect(UIC) Layer +------------------------------- UIC is the lowest layer of UFS layered architecture. It handles 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. 3. UFSHCD Overview ------------------- +================== The UFS host controller driver is based on Linux SCSI Framework. UFSHCD is a low level device driver which acts as an interface between @@ -98,12 +117,14 @@ SCSI Midlayer and PCIe based UFS host controllers. The current UFSHCD implementation supports following functionality, 3.1 UFS controller initialization +--------------------------------- The initialization module brings UFS host controller to active state and prepares the controller to transfer commands/response between UFSHCD and UFS device. 3.2 UTP Transfer requests +------------------------- Transfer request handling module of UFSHCD receives SCSI commands from SCSI Midlayer, forms UPIUs and issues the UPIUs to UFS Host @@ -112,11 +133,13 @@ The current UFSHCD implementation supports following functionality, of the status of the command. 3.3 UFS error handling +---------------------- Error handling module handles Host controller fatal errors, Device fatal errors and UIC interconnect layer related errors. 3.4 SCSI Error handling +----------------------- This is done through UFSHCD SCSI error handling routines registered with SCSI Midlayer. Examples of some of the error handling commands @@ -129,7 +152,7 @@ In this version of UFSHCD Query requests and power management functionality are not implemented. 4. BSG Support ------------------- +============== This transport driver supports exchanging UFS protocol information units (UPIUs) with a UFS device. Typically, user space will allocate @@ -138,7 +161,7 @@ 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: +send SG_IO with the applicable sg_io_v4:: io_hdr_v4.guard = 'Q'; io_hdr_v4.protocol = BSG_PROTOCOL_SCSI; @@ -166,6 +189,7 @@ upiu-based protocol is available at: For more detailed information about the tool and its supported features, please see the tool's README. -UFS Specifications can be found at, -UFS - http://www.jedec.org/sites/default/files/docs/JESD220.pdf -UFSHCI - http://www.jedec.org/sites/default/files/docs/JESD223.pdf +UFS Specifications can be found at: + +- UFS - http://www.jedec.org/sites/default/files/docs/JESD220.pdf +- UFSHCI - http://www.jedec.org/sites/default/files/docs/JESD223.pdf diff --git a/MAINTAINERS b/MAINTAINERS index a3bfe6813e5e..9ac2a10ca41f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -17204,7 +17204,7 @@ R: Alim Akhtar R: Avri Altman L: linux-scsi@vger.kernel.org S: Supported -F: Documentation/scsi/ufs.txt +F: Documentation/scsi/ufs.rst F: drivers/scsi/ufs/ UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER DWC HOOKS diff --git a/drivers/scsi/ufs/Kconfig b/drivers/scsi/ufs/Kconfig index d14c2243e02a..e2005aeddc2d 100644 --- a/drivers/scsi/ufs/Kconfig +++ b/drivers/scsi/ufs/Kconfig @@ -46,7 +46,7 @@ config SCSI_UFSHCD The module will be called ufshcd. To compile this driver as a module, choose M here and read - . + . However, do not compile this as a module if your root file system (the one containing the directory /) is located on a UFS device. -- 2.21.1