Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932229AbbFHSI7 (ORCPT ); Mon, 8 Jun 2015 14:08:59 -0400 Received: from mail-bn1on0061.outbound.protection.outlook.com ([157.56.110.61]:48320 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753343AbbFHSIt (ORCPT ); Mon, 8 Jun 2015 14:08:49 -0400 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; From: Punnaiah Choudary Kalluri To: , , , , , , , , , , , , , , , , , , CC: , , , , , , 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 Content-Type: text/plain 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?F6YjnAPl9hQ1/L07H9/PB+rUneJqlR1SkdHiE2mf00WXUKeDS3rS11aohSyo?= =?us-ascii?Q?I49c42ALn8TricgAAsWiFkek24wNt7HXOVRsyFOwWgJxTf1XCTj7SP/sdFDW?= =?us-ascii?Q?X8cSyHPMZw1820MP6hUTelaV3aYlWmY13WPuq4f9jZxp0YwuLa0d8TTsmeM7?= =?us-ascii?Q?NDPvVBVcJhkm+KYU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UB053;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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4825 Lines: 123 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 -- 1.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/