From patchwork Mon Jun 8 18:08:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Punnaiah Choudary Kalluri X-Patchwork-Id: 481967 X-Patchwork-Delegate: boris.brezillon@free-electrons.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id BE28A1401DE for ; Tue, 9 Jun 2015 04:10:40 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z21U1-0004hg-5P; Mon, 08 Jun 2015 18:09:13 +0000 Received: from mail-bn1on0081.outbound.protection.outlook.com ([157.56.110.81] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z21Tx-0004VD-Gt for linux-mtd@lists.infradead.org; Mon, 08 Jun 2015 18:09:10 +0000 Received: from BL2FFO11FD051.protection.gbl (10.173.160.34) by BL2FFO11HUB053.protection.gbl (10.173.161.153) with Microsoft SMTP Server (TLS) id 15.1.190.9; Mon, 8 Jun 2015 18:08:47 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by BL2FFO11FD051.mail.protection.outlook.com (10.173.161.213) with Microsoft SMTP Server (TLS) id 15.1.190.9 via Frontend Transport; Mon, 8 Jun 2015 18:08:47 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1Z21Ta-0002kK-1p; Mon, 08 Jun 2015 11:08:46 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1Z21TZ-0007g0-Rw; Mon, 08 Jun 2015 11:08:45 -0700 Received: from xsj-pvapsmtp01 (xsj-mail.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id t58I8IRf025210; Mon, 8 Jun 2015 11:08:18 -0700 Received: from [172.23.64.208] (helo=xhdrdevl6.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1Z21TW-0007f0-8R; Mon, 08 Jun 2015 11:08:42 -0700 Received: by xhdrdevl6.xilinx.com (Postfix, from userid 12826) id 6FEF1EF81AE; Mon, 8 Jun 2015 23:38:41 +0530 (IST) From: Punnaiah Choudary Kalluri To: , , , , , , , , , , , , , , , , , , Subject: [PATCH v7 3/3] Documentation: nand: pl353: Add documentation for controller and driver Date: Mon, 8 Jun 2015 23:38:38 +0530 Message-ID: <1433786918-21500-4-git-send-email-punnaia@xilinx.com> X-Mailer: git-send-email 1.7.4 In-Reply-To: <1433786918-21500-1-git-send-email-punnaia@xilinx.com> References: <1433786918-21500-1-git-send-email-punnaia@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-21600.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD051; 1:P7KmDWnAvqLL2xLCzNPNhy7zISwQitz4zcaTjv3IwtLsGpUHQypekn9+h394Sjjl/ZbRMQS2HpSyim4i9378ND/LJMSa7tRW5IkSjL8dAU2JAro2ziae2kmlW2fmuTAjgqnE0FbtJUlqLMUVA1dXJjoBxYApWPnr38ZIi8u51r2njiajsxN9hN6pVbjUav7ajooCBKxERWmMR+rjbofXhHb3gzMlRVzZZtD+/grQfYO9XK79fDYIyLc2k1C6o2v2x8Yd+X30EYUFVIJeM9UQuZusJ/A7KuH3FNgiuoz/JbMLklRwL/De1HCqGUMyvLJUOXeehXfZUnPoZAsrWdTRaQ== X-Forefront-Antispam-Report: CIP:149.199.60.83; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(438002)(189002)(199003)(46386002)(107886002)(19580395003)(2950100001)(5001960100002)(45336002)(47776003)(52956003)(15975445007)(87936001)(2201001)(50986999)(19580405001)(5001770100001)(76176999)(50466002)(36386004)(48376002)(6806004)(86362001)(50226001)(62966003)(77156002)(103686003)(92566002)(63266004)(42186005)(36756003)(33646002)(229853001)(46102003)(189998001)(921003)(107986001)(4001430100001)(90966001)(83996005)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2FFO11HUB053; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; MLV:sfv; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11HUB053; 2:Nfis/adH3q8menAgz8PIyOWDV2dGKYm7LLN2lwibo2wbBtcoy2u079zyrzqskfG3; 2:dLAMssLvXDsnqfp2XiRgJpZpRa3kLP4Y/83BkosI1RWBF8Eprpu5N5dYnMynQwMX8DQUFCDYGQBzcy/LXcqoXTX+IsNW1Sc2XHmW7BNS2XPdBh//o/4gznybRCys0Qs0G3irZ8MwFb8siyihA8C3OV0ZHQj7dY9sg8MnlKMyizhKI34qyYF51FSUaK3pmYaa0BXFU5sqSjOUKUbdmljZWpIKwaxz1iVSwgeZwglXHjA=; 6:2G6RM8OYzoIorv9hmJsxDZd2D4vO+1knNnX3RFayr4isnuGfDZ0RjAI83ZXCiyn+d602QaDh3UvLJYoY2/y+FUEw73NgVmqSoZcKVrHiJYEEUCPygjwX1IwkA864SZNepIyj3V4c2/E7yykVzhl2ASnYE4V5KW52anUtESITD8B6xewEAV8LKq44cVgJWrGowc8W6wub11UNUaMWcmJmEIRjDZDlDsE69AKc/l+k0+n3zRTjo+O+gu6XlE/nPVfxjbzG3a4kZ2RcdCaPeCpoN5OmWS1Dh4uTJMSV9myRp7PD6ahimf7FYQFXkmQPgd8KHUslLGeTpzmNF2hwz2WKwl705RBl1ZSsPhHLjxdtzFOxyGs2YDmGAqK4HkBJ4Tv7hPtVWXNye3LgkluAfkhPGtevPzvPIgKkBDFnPTBLKTUE096xwCTlph30ewjucICmVJStY7FPGVahP9T1Scm99ZaFJiIzpVvQZEZSNS4NVj3InYsCEfJeaOgl5OhaZKpp X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2FFO11HUB053; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(520003)(3002001); SRVR:BL2FFO11HUB053; BCL:0; PCL:0; RULEID:; SRVR:BL2FFO11HUB053; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11HUB053; 3:JbddGKn4lunz/f474/cxtt+eGinK+rl8KeeTewhw//gtYyONREK5RJH7aUOJ5fUszMRjsECYdj6OS9zuGvAUDcQCOkWLVN4JqDxt0VX9A74t5IrvImRHd27S2eIo2yXzjW7F+jfNJZFk4rWiJ5/Lk4C6nnm1Py+VrKkV3kI4uEAQVWe570C3vVm17f76Ges2WI0OMfXej8y0LbQu4y0N8l9rswmKw+8O/j7vOzwKjCZ2wvntcmZMaSwgTvTOrQGB4vjIsVq5/iUaKf4JgjXjVGV9rgIlssyD7wiAVh32rlijKtYYUHwI7jNookPrP03c X-Forefront-PRVS: 060166847D X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL2FFO11HUB053; 9:PYCBSnrAn8uFFQV8RfVi7EwGNqYzmohG5ySnrNTLj?= =?us-ascii?Q?F6YjnAPl9hQ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-ascii?Q?tpluPZQcSTiasiQyKHO1ZFGZF4nsGWUOVMNLSQ2eykIXFpRtKJsdoCHQJ6c+?= =?us-ascii?Q?weLg65B40kqtxNWOPo07sNRKLExQd9+MPmrUWEJZGJT+do5RvE/Sv2Y1Z+Sj?= =?us-ascii?Q?ePibE0ZL3E09scitRVmM9Wiwt7g?= X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11HUB053; 3:jOrssK+bf5eDrV9X730U3BLfdQ0NE6I8izI5/hF3BJzNpguHCICAaLuSK56J4tntfPr7W4AiNXzFv1trOGusW28rxF5Om9MPq57+SLZ2y8bYNAjm1aoHwKZ0xfiNd1TKvarB0xPbmpw1zKLZ9BP/Bw==; 10:QvtMgN5LUdHKgl8wmcQjn9C29oLBAIHNF4kgylC5pN5/fxrIUbDRaPk/suUNRQPCmH7f0uFWdlu+b0Fi4qX8Vp0km8pgdsjy/4Hzs5OEJP0= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2015 18:08:47.0726 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2FFO11HUB053 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150608_110909_837117_721278E8 X-CRM114-Status: GOOD ( 16.15 ) X-Spam-Score: -1.1 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [157.56.110.81 listed in list.dnswl.org] -1.1 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [157.56.110.81 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record Cc: devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, kalluripunnaiahchoudary@gmail.com, kpc528@gmail.com, punnaia@xilinx.com X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Added notes about the controller and driver Signed-off-by: Punnaiah Choudary Kalluri --- Changes in v7: - None Changes in v6: - None Changes in v5: - Fixed the review comments Changes in v4: - None --- Documentation/mtd/nand/pl353-nand.txt | 92 +++++++++++++++++++++++++++++++++ 1 files changed, 92 insertions(+), 0 deletions(-) create mode 100644 Documentation/mtd/nand/pl353-nand.txt diff --git a/Documentation/mtd/nand/pl353-nand.txt b/Documentation/mtd/nand/pl353-nand.txt new file mode 100644 index 0000000..d91ad62 --- /dev/null +++ b/Documentation/mtd/nand/pl353-nand.txt @@ -0,0 +1,92 @@ +This documents provides some notes about the ARM pl353 smc controller used in +Zynq SOC and confined to NAND specific details. + +Overview of the controller +========================== + The SMC (PL353) supports two memory interfaces: + Interface 0 type SRAM. + Interface 1 type NAND. + This configuration supports the following configurable options: + . 32-bit or 64-bit AXI data width + . 8-bit, 16-bit, or 32-bit memory data width for interface 0 + . 8-bit, or 16-bit memory data width for interface 1 + . 1-4 chip selects on each interface + . SLC ECC block for interface 1 + +For more information, refer the below link for TRM +http://infocenter.arm.com/help/topic/com.arm.doc.ddi0380g/ +DDI0380G_smc_pl350_series_r2p1_trm.pdf + +NAND memory accesses +==================== + . Two phase NAND accesses + . NAND command phase transfers + . NAND data phase transfers + +Two phase NAND accesses + The SMC defines two phases of commands when transferring data to or from +NAND flash. + +Command phase + Commands and optional address information are written to the NAND flash. +The command and address can be associated with either a data phase operation to +write to or read from the array, or a status/ID register transfer. + +Data phase + Data is either written to or read from the NAND flash. This data can be either +data transferred to or from the array, or status/ID register information. + +NAND AXI address setup + AXI address Command phase Data phase + [31:24] Chip address Chip address + [23] NoOfAddCycles_2 Reserved + [22] NoOfAddCycles_1 Reserved + [21] NoOfAddCycles_0 ClearCS + [20] End command valid End command valid + [19] 0 1 + [18:11] End command End command + [10:3] Start command [10] ECC Last + [9:3] Reserved + [2:0] Reserved Reserved + +ECC +=== + It operates on a number of 512 byte blocks of NAND memory and can be +programmed to store the ECC codes after the data in memory. For writes, +the ECC is written to the spare area of the page. For reads, the result of +a block ECC check are made available to the device driver. + +------------------------------------------------------------------------ +| n * 512 blocks | extra | ecc | | +| | block | codes | | +------------------------------------------------------------------------ + +The ECC calculation uses a simple Hamming code, using 1-bit correction 2-bit +detection. It starts when a valid read or write command with a 512 byte aligned +address is detected on the memory interface. + +Driver details +============== + The NAND driver has dependency with the pl353_smc memory controller +driver for intializing the nand timing parameters, bus width, ECC modes, +control and status information. + +Since the controller expects that the chipselect bit should be cleared for the +last data transfer i.e last 4 data bytes, the existing nandbase page +read/write routines for soft ecc and ecc none modes will not work. So, inorder +to make this driver work, it always updates the ecc mode as HW ECC and +implemented the page read/write functions for supporting the SW ECC. + +HW ECC mode: + Upto 2K page size is supported and beyond that it retuns +-ENOSUPPORT error. If the flsh has ONDIE ecc controller then the +priority has given to the ONDIE ecc controller. Also the current +implementation has support for upto 64 byte oob area + +SW ECC mode: + It supports all the pgae sizes. But since, zynq soc bootrom uses +HW ECC for the devices that have pgae size <=2K so, to avoid any ecc related +issues during boot, prefer HW ECC over SW ECC. + +For devicetree binding information please refer the below dt binding file +Documentation/devicetree/bindings/memory-controllers/pl353-smc.txt