From patchwork Mon Nov 11 17:01:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 3168531 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 374209F68F for ; Mon, 11 Nov 2013 17:02:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 844F020161 for ; Mon, 11 Nov 2013 17:02:01 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 382E120150 for ; Mon, 11 Nov 2013 17:02:00 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vfus5-0000uh-GD; Mon, 11 Nov 2013 17:01:53 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vfus1-0006Sy-4B; Mon, 11 Nov 2013 17:01:49 +0000 Received: from devils.ext.ti.com ([198.47.26.153]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vfurw-0006Ru-RW; Mon, 11 Nov 2013 17:01:45 +0000 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id rABH158g019882; Mon, 11 Nov 2013 11:01:05 -0600 Received: from DNCE70.ent.ti.com (dncmailx.itg.ti.com [137.167.131.19]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id rABH14d0019825; Mon, 11 Nov 2013 11:01:04 -0600 Received: from DNCE04.ent.ti.com ([fe80::50a2:cda3:1471:a76]) by DNCE70.ent.ti.com ([fe80::78db:4901:78e8:69bb%20]) with mapi id 14.02.0342.003; Mon, 11 Nov 2013 18:01:04 +0100 From: "Khoronzhuk, Ivan" To: "Shilimkar, Santosh" , Rob Landley , Russell King Subject: [PATCH 06/12] mtd: nand: davinci: adjust DT properties to MTD generic Thread-Topic: [PATCH 06/12] mtd: nand: davinci: adjust DT properties to MTD generic Thread-Index: AQHO3vrWnwrfl1xiVkuqwjIht3CWx5ogQK/I Date: Mon, 11 Nov 2013 17:01:03 +0000 Message-ID: <4F5844B3A985794BA902E12C070812375F8D20@DNCE04.ent.ti.com> References: <1384187188-5776-1-git-send-email-ivan.khoronzhuk@ti.com>, <1384187188-5776-7-git-send-email-ivan.khoronzhuk@ti.com> In-Reply-To: <1384187188-5776-7-git-send-email-ivan.khoronzhuk@ti.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [157.170.170.56] x-exclaimer-md-config: f9c360f5-3d1e-4c3c-8703-f45bf52eff6b MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131111_120144_979609_0F82EA95 X-CRM114-Status: UNSURE ( 8.02 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -6.9 (------) Cc: Mark Rutland , "devicetree@vger.kernel.org" , "Strashko, Grygorii" , Pawel Moll , Stephen Warren , Ian Campbell , Kumar Gala , Rob Herring , "linux-kernel@vger.kernel.org" , "linux-mtd@lists.infradead.org" , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The properties davinci-ecc-mode, davinci-nand-use-bbt, davinci-nand-buswidth are MTD generic. Correct names for them are: nand-ecc-mode, nand-on-flash-bbt, nand-bus-width accordingly. So rename them in dts and documentation. Signed-off-by: Ivan Khoronzhuk --- .../devicetree/bindings/mtd/davinci-nand.txt | 25 ++++++++++++++++---- drivers/mtd/nand/davinci_nand.c | 11 ++++++--- 2 files changed, 28 insertions(+), 8 deletions(-) -- 1.7.9.5 diff --git a/Documentation/devicetree/bindings/mtd/davinci-nand.txt b/Documentation/devicetree/bindings/mtd/davinci-nand.txt index d2a3fc0..befaa5b 100644 --- a/Documentation/devicetree/bindings/mtd/davinci-nand.txt +++ b/Documentation/devicetree/bindings/mtd/davinci-nand.txt @@ -37,7 +37,7 @@ Recommended properties : - ti,davinci-mask-chipsel: mask for chipselect address. Needed to mask addresses for given chipselect. -- ti,davinci-ecc-mode: operation mode of the NAND ecc mode. ECC mode +- nand-ecc-mode: operation mode of the NAND ecc mode. ECC mode valid values for davinci driver: - "none" - "soft" @@ -45,10 +45,25 @@ Recommended properties : - ti,davinci-ecc-bits: used ECC bits, currently supported 1 or 4. -- ti,davinci-nand-buswidth: buswidth 8 or 16. +- nand-bus-width: buswidth 8 or 16. If not present 8. + +- nand-on-flash-bbt: use flash based bad block table support. OOB + identifier is saved in OOB area. If not present + false. + +Deprecated properties: + +- ti,davinci-ecc-mode: operation mode of the NAND ecc mode. ECC mode + valid values for davinci driver: + - "none" + - "soft" + - "hw" + +- ti,davinci-nand-buswidth: buswidth 8 or 16. If not present 8. - ti,davinci-nand-use-bbt: use flash based bad block table support. OOB - identifier is saved in OOB area. + identifier is saved in OOB area. If not present + false. Nand device bindings may contain additional sub-nodes describing partitions of the address space. See partition.txt for more detail. The NAND Flash timing @@ -66,9 +81,9 @@ nand_cs3@62000000 { ti,davinci-mask-ale = <0>; ti,davinci-mask-cle = <0>; ti,davinci-mask-chipsel = <0>; - ti,davinci-ecc-mode = "hw"; + nand-ecc-mode = "hw"; ti,davinci-ecc-bits = <4>; - ti,davinci-nand-use-bbt; + nand-on-flash-bbt; partition@180000 { label = "ubifs"; diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c index 9bcbaa9..78b8d66 100644 --- a/drivers/mtd/nand/davinci_nand.c +++ b/drivers/mtd/nand/davinci_nand.c @@ -534,7 +534,6 @@ static struct davinci_nand_pdata struct davinci_nand_pdata *pdata; const char *mode; u32 prop; - int len; pdata = devm_kzalloc(&pdev->dev, sizeof(struct davinci_nand_pdata), @@ -559,6 +558,8 @@ static struct davinci_nand_pdata "ti,davinci-mask-chipsel", &prop)) pdata->mask_chipsel = prop; if (!of_property_read_string(pdev->dev.of_node, + "nand-ecc-mode", &mode) || + !of_property_read_string(pdev->dev.of_node, "ti,davinci-ecc-mode", &mode)) { if (!strncmp("none", mode, 4)) pdata->ecc_mode = NAND_ECC_NONE; @@ -571,11 +572,15 @@ static struct davinci_nand_pdata "ti,davinci-ecc-bits", &prop)) pdata->ecc_bits = prop; if (!of_property_read_u32(pdev->dev.of_node, + "nand-bus-width", &prop) || + !of_property_read_u32(pdev->dev.of_node, "ti,davinci-nand-buswidth", &prop)) if (prop == 16) pdata->options |= NAND_BUSWIDTH_16; - if (of_find_property(pdev->dev.of_node, - "ti,davinci-nand-use-bbt", &len)) + if (of_property_read_bool(pdev->dev.of_node, + "nand-on-flash-bbt") || + of_property_read_bool(pdev->dev.of_node, + "ti,davinci-nand-use-bbt")) pdata->bbt_options = NAND_BBT_USE_FLASH; }