From patchwork Wed Feb 29 06:41:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Yaraganavi X-Patchwork-Id: 6997 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 75D4323EB0 for ; Wed, 29 Feb 2012 06:44:44 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 38CAEA180CF for ; Wed, 29 Feb 2012 06:44:44 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so2747544iag.11 for ; Tue, 28 Feb 2012 22:44:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:x-forwarded-to:x-forwarded-for:delivered-to :received-spf:received-spf:dkim-signature:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=kZlPkkenKg4iRxR9AzcZMbSycTR4Hd8tL6zSXaA7Xus=; b=lYtJDrryLhpNBVH6wxk0q43d5NHZy3TdfgmJMywviHeXDPuRqR0lUSNJSR+peZs78L FGI2qkcokBq2igNhvh+lOr0SFhzIugYQNWdESUfBUcWwD+flFUT6S1Png6Co6rGDwhFi X3RAtqwoX6Wo58/P3jK7gVtY6eTZZDit8m3sU= MIME-Version: 1.0 Received: by 10.50.89.201 with SMTP id bq9mr4704435igb.55.1330497884018; Tue, 28 Feb 2012 22:44:44 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.11.10 with SMTP id r10csp25900ibr; Tue, 28 Feb 2012 22:44:43 -0800 (PST) Received: by 10.68.221.73 with SMTP id qc9mr1994644pbc.139.1330497883365; Tue, 28 Feb 2012 22:44:43 -0800 (PST) Received: from mail-pw0-f50.google.com (mail-pw0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id h9si6754753pbb.226.2012.02.28.22.44.40 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 28 Feb 2012 22:44:43 -0800 (PST) Received-SPF: pass (google.com: domain of santoshsy@gmail.com designates 209.85.160.50 as permitted sender) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=pass (google.com: domain of santoshsy@gmail.com designates 209.85.160.50 as permitted sender) smtp.mail=santoshsy@gmail.com; dkim=pass header.i=@gmail.com Received: by mail-pw0-f50.google.com with SMTP id wz7so2907053pbc.37 for ; Tue, 28 Feb 2012 22:44:40 -0800 (PST) Received-SPF: pass (google.com: domain of santoshsy@gmail.com designates 10.68.134.198 as permitted sender) client-ip=10.68.134.198; Received: from mr.google.com ([10.68.134.198]) by 10.68.134.198 with SMTP id pm6mr2364965pbb.147.1330497880645 (num_hops = 1); Tue, 28 Feb 2012 22:44:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=kZlPkkenKg4iRxR9AzcZMbSycTR4Hd8tL6zSXaA7Xus=; b=dGcLu3UqDLoNdOcNFcrbepPVA1P1BLag3I9hhRQWiOWrBCxy/Er+V3W/3N5usupVl9 swz1eoTxbhS/4VmjB5bTB1fTGbajmyoETu6lbGtejMxwNGWHr9iZi6pZlKE+SAZpY3Zo ovdBukZQJlf/lFEXYNdE9tHmcPtv7ewkUMfEk= Received: by 10.68.134.198 with SMTP id pm6mr1986446pbb.147.1330497880593; Tue, 28 Feb 2012 22:44:40 -0800 (PST) Received: from girishks ([115.113.119.130]) by mx.google.com with ESMTPS id 3sm17830262pbx.66.2012.02.28.22.44.33 (version=SSLv3 cipher=OTHER); Tue, 28 Feb 2012 22:44:39 -0800 (PST) From: Santosh Y To: James.Bottomley@hansenpartnership.com Cc: linux-scsi@vger.kernel.org, patches@linaro.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, arnd.bergmann@linaro.org, saugata.das@linaro.org, dsaxena@linaro.org, stephen.doel@linaro.org, venkat@linaro.org, ilho215.lee@samsung.com, nala.la@samsung.com, girish.shivananjappa@linaro.org, vishak.g@samsung.com, k.rajesh@samsung.com, yejin.moon@samsung.com, sreekumar.c@samsung.com, vinholikatti@gmail.com, linkinjeon@gmail.com, michaelc@cs.wisc.edu, Santosh Yaraganavi Subject: [PATCH v3 5/5] Documentation: UFS Host Controller Driver Date: Wed, 29 Feb 2012 12:11:54 +0530 Message-Id: <1330497714-26504-6-git-send-email-santoshsy@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1330497714-26504-1-git-send-email-santoshsy@gmail.com> References: <1330497714-26504-1-git-send-email-santoshsy@gmail.com> X-Gm-Message-State: ALoCoQnJSYRDpTWsecYdKLYMOz5t4MbJ8ChEPlmleKTfnill0u6yJgGY8fh7IAJtZ2wBsh4OKaUT From: Santosh Yaraganavi The document provides Universal Flash Storage(UFS) and UFS host controller driver overview. Signed-off-by: Santosh Yaraganavi Reviewed-by: Vishak G Reviewed-by: Namjae Jeon --- Documentation/scsi/00-INDEX | 2 + Documentation/scsi/ufs.txt | 133 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 135 insertions(+), 0 deletions(-) create mode 100644 Documentation/scsi/ufs.txt diff --git a/Documentation/scsi/00-INDEX b/Documentation/scsi/00-INDEX index b48ded5..b7dd650 100644 --- a/Documentation/scsi/00-INDEX +++ b/Documentation/scsi/00-INDEX @@ -94,3 +94,5 @@ sym53c8xx_2.txt - info on second generation driver for sym53c8xx based adapters tmscsim.txt - info on driver for AM53c974 based adapters +ufs.txt + - info on Universal Flash Storage(UFS) and UFS host controller driver. diff --git a/Documentation/scsi/ufs.txt b/Documentation/scsi/ufs.txt new file mode 100644 index 0000000..41a6164 --- /dev/null +++ b/Documentation/scsi/ufs.txt @@ -0,0 +1,133 @@ + 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 + + +1. Overview +----------- + +Universal Flash Storage(UFS) is a storage specification for flash devices. +It is aimed 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 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, + * 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 + + +2. UFS Architecture Overview +---------------------------- + +UFS has a layered communication architecture which is based on SCSI +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 + 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. + +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. + * 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). + +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 +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 + controller. Also, the module decodes, responses received from UFS + host controller in the form of UPIUs and intimates the SCSI Midlayer + 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 + issues by 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. + +In this version of UFSHCD Query requests and power management +functionality are not implemented. + +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