From patchwork Sat Nov 26 18:06:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 84283 Delivered-To: patch@linaro.org Received: by 10.182.1.168 with SMTP id 8csp786805obn; Sat, 26 Nov 2016 10:10:51 -0800 (PST) X-Received: by 10.84.216.6 with SMTP id m6mr31301864pli.130.1480183851867; Sat, 26 Nov 2016 10:10:51 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l65si49331277pge.112.2016.11.26.10.10.51; Sat, 26 Nov 2016 10:10:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753208AbcKZSKu (ORCPT + 7 others); Sat, 26 Nov 2016 13:10:50 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:48712 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753039AbcKZSIx (ORCPT ); Sat, 26 Nov 2016 13:08:53 -0500 Received: from grover.sesame (FL1-111-169-71-157.osk.mesh.ad.jp [111.169.71.157]) (authenticated) by conuserg-11.nifty.com with ESMTP id uAQI6UfB018512; Sun, 27 Nov 2016 03:07:04 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com uAQI6UfB018512 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1480183625; bh=HtdlNLOIfMIK6fgVj23c5IUvkI4a+443pxVGE1d73Wo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ubjdnq2HBRJUPwiKGmh4bm/tKY4VEEOzxMV8rNpjWJlDvIGbu1RV3RXbPzSIeAhzd OgAB+9fPpACYWa7juu4MC6c7UA+tnhDi33E4uAZSh0Iw/17wuM/6RBCjcHtLICbyZ3 1nv2bmcbbsLAXiMIF+ngxIbRP7xXP3+BpuGiz+0XiPN8lfzQ+aZ6Fyj1ihWb0LpQgo agILiHes8KYXSCfhW/CvJqzJcl3yIDjNrQu/9qJUZzhztTI+Eszebj4K5ilCeLu1Rq xMdAnfdMRZo9f3lfh3r6+VJjO7Qgr5NakCevITaCI2bqykAmcFODnoSWdUZi5FFAdI MuTdTJ7X3lwFA== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Cc: Masahiro Yamada , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Boris Brezillon , Marek Vasut , Brian Norris , Richard Weinberger , David Woodhouse , Cyrille Pitchen , Rob Herring , Mark Rutland Subject: [PATCH 39/39] mtd: nand: denali_dt: add compatible strings for UniPhier SoC variants Date: Sun, 27 Nov 2016 03:06:25 +0900 Message-Id: <1480183585-592-40-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1480183585-592-1-git-send-email-yamada.masahiro@socionext.com> References: <1480183585-592-1-git-send-email-yamada.masahiro@socionext.com> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add two compatible strings for UniPhier SoCs. The revision register on both shows revision 5.0, but they are different hardware. Features: - DMA engine with 64 bit physical address support - 1024 byte ECC step size - 8 / 16 / 24 bit ECC strength - The n_banks format depends on SoC Signed-off-by: Masahiro Yamada --- .../devicetree/bindings/mtd/denali-nand.txt | 10 +++++-- drivers/mtd/nand/denali_dt.c | 33 ++++++++++++++++++++-- 2 files changed, 38 insertions(+), 5 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Documentation/devicetree/bindings/mtd/denali-nand.txt b/Documentation/devicetree/bindings/mtd/denali-nand.txt index 51fe195..cea46e2 100644 --- a/Documentation/devicetree/bindings/mtd/denali-nand.txt +++ b/Documentation/devicetree/bindings/mtd/denali-nand.txt @@ -1,13 +1,19 @@ * Denali NAND controller Required properties: - - compatible : should be "denali,denali-nand-dt" + - compatible : should be one of the following: + "denali,denali-nand-dt" + "denali,denali-nand-uniphier-v5a" + "denali,denali-nand-uniphier-v5b" - reg : should contain registers location and length for data and reg. - reg-names: Should contain the reg names "nand_data" and "denali_reg" - interrupts : The interrupt number. Optional properties: - - nand-ecc-step-size: must be 512 or 1024. If not specified, default to 512. + - nand-ecc-step-size: must be 512 or 1024. If not specified, default to: + 512 for "denali,denali-nand-dt" + 1024 for "denali,denali-nand-uniphier-v5a" + 1024 for "denali,denali-nand-uniphier-v5b" see nand.txt for details. - nand-ecc-strength: see nand.txt for details - nand-ecc-maximize: see nand.txt for details diff --git a/drivers/mtd/nand/denali_dt.c b/drivers/mtd/nand/denali_dt.c index aa1e032..b411889 100644 --- a/drivers/mtd/nand/denali_dt.c +++ b/drivers/mtd/nand/denali_dt.c @@ -34,10 +34,37 @@ struct denali_dt_data { unsigned int caps; }; +static const int denali_uniphier_ecc_strength[] = { + 24, 16, 8, 0, +}; + +static const struct denali_dt_data denali_uniphier_v5a_data = { + .ecc_strength_avail = denali_uniphier_ecc_strength, + .caps = DENALI_CAPS_DMA_64BIT | + DENALI_CAPS_ECC_SIZE_1024, +}; + +static const struct denali_dt_data denali_uniphier_v5b_data = { + .ecc_strength_avail = denali_uniphier_ecc_strength, + .caps = DENALI_CAPS_DMA_64BIT | + DENALI_CAPS_NEW_N_BANKS_FORMAT | + DENALI_CAPS_ECC_SIZE_1024, +}; + static const struct of_device_id denali_nand_dt_ids[] = { - { .compatible = "denali,denali-nand-dt" }, - { /* sentinel */ } - }; + { + .compatible = "denali,denali-nand-dt", + }, + { + .compatible = "denali,denali-nand-uniphier-v5a", + .data = &denali_uniphier_v5a_data, + }, + { + .compatible = "denali,denali-nand-uniphier-v5b", + .data = &denali_uniphier_v5b_data, + }, + { /* sentinel */ } +}; MODULE_DEVICE_TABLE(of, denali_nand_dt_ids);