Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756276AbcDDVsr (ORCPT ); Mon, 4 Apr 2016 17:48:47 -0400 Received: from down.free-electrons.com ([37.187.137.238]:51878 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932444AbcDDVso (ORCPT ); Mon, 4 Apr 2016 17:48:44 -0400 Date: Mon, 4 Apr 2016 23:48:26 +0200 From: Boris Brezillon To: David Woodhouse , Brian Norris , linux-mtd@lists.infradead.org, Boris Brezillon , Richard Weinberger Cc: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Harvey Hunt , Jorge Ramirez-Ortiz Subject: Re: [PATCH v2] mtd: nand: document the NAND controller/NAND chip DT representation Message-ID: <20160404234826.767b582f@bbrezillon> In-Reply-To: <1459513595-14308-1-git-send-email-boris.brezillon@free-electrons.com> References: <1459513595-14308-1-git-send-email-boris.brezillon@free-electrons.com> X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.28; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2659 Lines: 78 On Fri, 1 Apr 2016 14:26:35 +0200 Boris Brezillon wrote: > Standardize the NAND controller/NAND chip DT representation. Now, all new > NAND controller drivers should comply with this representation, even if > they are only supporting a single NAND chip. > > Existing drivers can keep support for the old representation (where only > the NAND chip was described), but are encouraged to also support the new > one. > > Signed-off-by: Boris Brezillon Applied. > --- > Changes since v1: > - fix typo > --- > Documentation/devicetree/bindings/mtd/nand.txt | 37 +++++++++++++++++++++++++- > 1 file changed, 36 insertions(+), 1 deletion(-) > > diff --git a/Documentation/devicetree/bindings/mtd/nand.txt b/Documentation/devicetree/bindings/mtd/nand.txt > index b53f92e..a17662b 100644 > --- a/Documentation/devicetree/bindings/mtd/nand.txt > +++ b/Documentation/devicetree/bindings/mtd/nand.txt > @@ -1,4 +1,23 @@ > -* MTD generic binding > +* NAND chip and NAND controller generic binding > + > +NAND controller/NAND chip representation: > + > +The NAND controller should be represented with its own DT node, and all > +NAND chips attached to this controller should be defined as children nodes > +of the NAND controller. This representation should be enforced even for > +simple controllers supporting only one chip. > + > +Mandatory NAND controller properties: > +- #address-cells: depends on your controller. Should at least be 1 to > + encode the CS line id. > +- #size-cells: depends on your controller. Put zero unless you need a > + mapping between CS lines and dedicated memory regions > + > +Optional NAND controller properties > +- ranges: only needed if you need to define a mapping between CS lines and > + memory regions > + > +Optional NAND chip properties: > > - nand-ecc-mode : String, operation mode of the NAND ecc mode. > Supported values are: "none", "soft", "hw", "hw_syndrome", "hw_oob_first", > @@ -19,3 +38,19 @@ errors per {size} bytes". > The interpretation of these parameters is implementation-defined, so not all > implementations must support all possible combinations. However, implementations > are encouraged to further specify the value(s) they support. > + > +Example: > + > + nand-controller { > + #address-cells = <1>; > + #size-cells = <0>; > + > + /* controller specific properties */ > + > + nand@0 { > + reg = <0>; > + nand-ecc-mode = "soft_bch"; > + > + /* controller specific properties */ > + }; > + }; -- Boris Brezillon, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com