From patchwork Thu Nov 21 11:28:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 293093 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 90E1F2C00E9 for ; Thu, 21 Nov 2013 22:32:49 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754293Ab3KUL3l (ORCPT ); Thu, 21 Nov 2013 06:29:41 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:50550 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754326Ab3KUL3j (ORCPT ); Thu, 21 Nov 2013 06:29:39 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id rALBT9kN026919; Thu, 21 Nov 2013 05:29:09 -0600 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id rALBT98q027883; Thu, 21 Nov 2013 05:29:09 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.2.342.3; Thu, 21 Nov 2013 05:29:09 -0600 Received: from uglx0177649.ucm2.emeaucm.ext.ti.com (uglx0177649.ucm2.emeaucm.ext.ti.com [10.167.145.122]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id rALBSWdI022993; Thu, 21 Nov 2013 05:29:06 -0600 From: Ivan Khoronzhuk To: Santosh Shilimkar , Rob Landley , Russell King CC: , Pawel Moll , Mark Rutland , Rob Herring , Stephen Warren , Kumar Gala , Ian Campbell , , , , , Ivan Khoronzhuk Subject: [PATCH v2 07/10] mtd: nand: davinci: adjust DT properties to MTD generic Date: Thu, 21 Nov 2013 13:28:22 +0200 Message-ID: <1385033305-13179-8-git-send-email-ivan.khoronzhuk@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1385033305-13179-1-git-send-email-ivan.khoronzhuk@ti.com> References: <1385033305-13179-1-git-send-email-ivan.khoronzhuk@ti.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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 Reviewed-by: Grygorii Strashko --- .../devicetree/bindings/mtd/davinci-nand.txt | 25 ++++++++++++++++---- drivers/mtd/nand/davinci_nand.c | 11 ++++++--- 2 files changed, 28 insertions(+), 8 deletions(-) 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 c0be223..f7b21b8 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), @@ -558,6 +557,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; @@ -570,11 +571,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; }