Received: by 10.213.65.68 with SMTP id h4csp1819877imn; Mon, 19 Mar 2018 14:12:27 -0700 (PDT) X-Google-Smtp-Source: AG47ELvTRdqHjGbcV4dECVoXCDrh63uyyuG3gzTc4TRimVG4d0sDgA4Itow7dXE2TDlvGv/1IW/R X-Received: by 2002:a17:902:ab81:: with SMTP id f1-v6mr9660999plr.5.1521493947812; Mon, 19 Mar 2018 14:12:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521493947; cv=none; d=google.com; s=arc-20160816; b=q/8EyQXzxd3ady/VK+O8i9SsHVsJ5E+c1OxCUJ+Bcn2GTaR90lBUw5S1SSffHN5a8y c6okvAL26arhzVTooxdTutHoxjLmB2b2qi48b3j/MjV3Mq3ITODqofxlUBhVEUS4O+GW yvakdICzlidypQyyLWWko5CnWxHBV8B5yClQLY+T7XFkiR3pcg0mGgGftAL+omUlGhvD Nsq38OntMwRvn3YAz/B+Jd5xiJJ5EALs7mkNmmn5luX5ZZ4trMB3BmsDRqiJMDyOgQc9 x62qJuZpQbZcah1PiyaMZucjDuBZ5UXtj0K5hljnMzx5bzTsW9zQL8ABpWge3rOgrW0D Y9Dw== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=yoXTZPPjBw4hAZ0OFRzJtR/iuC8iDUJoFOXwXqfwDdw=; b=cDViB/oZIDBWrXD+W0npyA7ULN/9lWnILOIoPdKrSsRt0+H4rsTjI3Vezey9O4ajAS r0kYqGZPMLyhP9YCSlkIxt1hYubqnq0ac0f1GXQIc2EaP86jxS4mp22Y6sgqq7cSGAfK g8QCgLzFy3mVshcPK6Fa3pzaYsuBLjvQyp/pHs2gMCYU6pPII5iBm6BTKfKu56HlVlq1 m/N73juaFsf4S9i2fvk1L+wLakyzJTS903r5uNm1hBisV+x77rlwVmpZHzkisLyVtl6c /RNwnLARK9A1EJcVxudS+UnfRAFNQ0E+L3AlwIwN0RXC729/qnSxYv9mlA9vsiEq+IU9 PJiQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d191si24137pgc.659.2018.03.19.14.11.42; Mon, 19 Mar 2018 14:12:27 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965593AbeCSVIb convert rfc822-to-8bit (ORCPT + 99 others); Mon, 19 Mar 2018 17:08:31 -0400 Received: from mail.bootlin.com ([62.4.15.54]:49574 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965446AbeCSVIZ (ORCPT ); Mon, 19 Mar 2018 17:08:25 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 68B6020875; Mon, 19 Mar 2018 22:08:22 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from xps13 (unknown [91.224.148.103]) by mail.bootlin.com (Postfix) with ESMTPSA id 765C02084D; Mon, 19 Mar 2018 22:08:11 +0100 (CET) Date: Mon, 19 Mar 2018 22:08:11 +0100 From: Miquel Raynal To: Cc: , , , , , , , , , , Naga Sureshkumar Relli Subject: Re: [LINUX PATCH v8 1/2] Documentation: nand: pl353: Add documentation for controller and driver Message-ID: <20180319220811.34a99c3d@xps13> In-Reply-To: <1521024494-30632-1-git-send-email-nagasureshkumarrelli@gmail.com> References: <1521024494-30632-1-git-send-email-nagasureshkumarrelli@gmail.com> Organization: Bootlin X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi naga, On Wed, 14 Mar 2018 16:18:14 +0530, wrote: > From: Naga Sureshkumar Relli > > Added notes about the controller and driver > > Signed-off-by: Naga Sureshkumar Relli > --- > Changes in v8 > - None > 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 file changed, 92 insertions(+) > 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..ac6fbd5 > --- /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 I think it is better to do not break the links? > + > +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, ^NAND > +control and status information. > + > +Since the controller expects that the chipselect bit should be cleared for the ^chip select ^ would? is? > +last data transfer i.e last 4 data bytes, the existing nandbase page What is nandbase? > +read/write routines for soft ecc and ecc none modes will not work. So, inorder s/ecc/ECC/ in order^ > +to make this driver work, it always updates the ecc mode as HW ECC and can s/ecc/ECC/ > +implemented the page read/write functions for supporting the SW ECC. s/can implemented/implements/? I don't understand this paragraph, can you explain it please? I am not sure to understand the limitation nor how you address it. > + > +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 ^ -ENOTSUPP ^flash ^on-die ECC > +priority has given to the ONDIE ecc controller. Also the current ^ is given? ^on-die ECC > +implementation has support for upto 64 byte oob area ^up to 64 bytes of OOB data. > + > +SW ECC mode: > + It supports all the pgae sizes. But since, zynq soc bootrom uses ^ page ^Zync SOC > +HW ECC for the devices that have pgae size <=2K so, to avoid any ecc related ^ page <= 2K, ECC^ > +issues during boot, prefer HW ECC over SW ECC. I suppose this means that if no ECC mode is given ie. no nand-ecc-mode in the DT, the driver will use HW ECC by default, right? > + > +For devicetree binding information please refer the below dt binding file > +Documentation/devicetree/bindings/memory-controllers/pl353-smc.txt. This file does not exist in my tree. Thanks for contributing this driver, Miquèl -- Miquel Raynal, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com