From patchwork Mon Jun 5 23:21:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 103120 Delivered-To: patch@linaro.org Received: by 10.182.29.35 with SMTP id g3csp1009897obh; Mon, 5 Jun 2017 16:30:23 -0700 (PDT) X-Received: by 10.84.167.74 with SMTP id j10mr17843994plg.144.1496705423079; Mon, 05 Jun 2017 16:30:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496705423; cv=none; d=google.com; s=arc-20160816; b=IHvdGZ3gBlpWsL7DhOoa/xO9JRyq9VZ0DSz/gY38CzFQ9DfYNrqyzUeIqrvbNaS784 3/F1Klf3kOVW4LNkyKRVjvjRevFqJEwaf6p14kjxx2WcsoZfd3lePnAoMmJSVJvSf3Ss 6E9OZYvD4S8y9LlRdb+7lrs+A9A1INxUkfsg+iiqYRlxq5MvTk2GQqTOWdC0Ajyes+Mp JfYUlv6ncGktbXH+a6p4uCtmXolJE1C9wV8VX37GvpRGMXERvhE/f8kFyABh0wuGTUws 3DOxgJ7neoLPDC2fzvDVOaz9DmezfMThW3BjlQpdMRE7KKXZj6YDXzAsUSWc7Tz8r9wF BSQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=KFS93Y8nIJXlmJXcsF6IbpIQdyx+ZtBGll5qooN12xI=; b=jRLJ8vvCeirzmBbGzR/C0k2r+XL17Tp/1mI6XH1fhZxEAftd3qx00T/UyPe1jWmTkv pddhPPGheV2/MouW8BcXnf5wwWqxbdh1Xk7olidnzpJol9tEA68pirNo0pgNVIj6gU3s PWGs+zn1OqOZBCKIUIuzant2sZyLfdkz1vjUH3UModiXdyhRieUtoxC9hoqBNOPG8z+w iDLOefJStM5I5GUh0syKl8LecC9O/Gg9dYh+ZvcVauh3PKaS8Ew8sYbKO3SevBar1N/C KE8vgf/+8zwU1UMVPBe9GilKmucFhpyiKbyLTPSmOoJC7ZFPgI5ZzWEvKbur496yoSjY yXJA== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z2si9975978pge.206.2017.06.05.16.30.22; Mon, 05 Jun 2017 16:30:23 -0700 (PDT) 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 S1751194AbdFEXaK (ORCPT + 7 others); Mon, 5 Jun 2017 19:30:10 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:32114 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751258AbdFEXZQ (ORCPT ); Mon, 5 Jun 2017 19:25:16 -0400 Received: from grover.sesame (FL1-118-110-19-204.osk.mesh.ad.jp [118.110.19.204]) (authenticated) by conuserg-10.nifty.com with ESMTP id v55NMD5g004412; Tue, 6 Jun 2017 08:22:34 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com v55NMD5g004412 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1496704955; bh=Vid9UJkWWQVAhP0gdkW2mfNuboZc0lLCAwtXGn/D6c4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d6D/PHb4vTNNDxUZfshDjjIhte3nMvPo7XxqTLTkSbFl9iIOKpQ4qbOpHB7D/QxXH 7P2y9r3HNQu0NfHqo68s6VqS9mUQYzl5CWncvdr18G1Zwc7SqVlce7wmsAesWJZHrb x43uykxwziWF0XyCH5f1FWQUu4nqrnC70LhSix6zLTbVRyZiVr7UW2MWOb09VSAqr+ X8YfHhmNZsBiYZb5VgkF3k1K8qlNcneF6ph6nBWDIb1LHf4BxLaGNTf4AwplbwYL95 LadYCcig6Aya0XN2U6t8Isn+cB5JDVhH0hABEDsIpvhlsZLmmY7Z1aE9TB4oIwtOvR mpLN4WidaXf/w== X-Nifty-SrcIP: [118.110.19.204] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Cc: Enrico Jorns , Artem Bityutskiy , Dinh Nguyen , Boris Brezillon , Marek Vasut , Graham Moore , David Woodhouse , Masami Hiramatsu , Chuanxiao Dong , Jassi Brar , Masahiro Yamada , Cyrille Pitchen , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Brian Norris , Richard Weinberger , Rob Herring , Mark Rutland Subject: [PATCH v4 06/23] mtd: nand: denali_dt: add compatible strings for UniPhier SoC variants Date: Tue, 6 Jun 2017 08:21:45 +0900 Message-Id: <1496704922-12261-7-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1496704922-12261-1-git-send-email-yamada.masahiro@socionext.com> References: <1496704922-12261-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 SoC family. "socionext,uniphier-denali-nand-v5a" is used on UniPhier sLD3, LD4, Pro4, sLD8. "socionext,uniphier-denali-nand-v5b" is used on UniPhier Pro5, PXs2, LD6b, LD11, LD20. Signed-off-by: Masahiro Yamada --- Changes in v4: - Adjusted to generic helpers for ECC engine caps Changes in v3: None Changes in v2: - Change the compatible strings - Fix the ecc_strength_capability - Override revision number for the newer one .../devicetree/bindings/mtd/denali-nand.txt | 6 +++++ drivers/mtd/nand/denali_dt.c | 31 ++++++++++++++++++++++ 2 files changed, 37 insertions(+) -- 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 b7742a7..504291d 100644 --- a/Documentation/devicetree/bindings/mtd/denali-nand.txt +++ b/Documentation/devicetree/bindings/mtd/denali-nand.txt @@ -3,6 +3,8 @@ Required properties: - compatible : should be one of the following: "altr,socfpga-denali-nand" - for Altera SOCFPGA + "socionext,uniphier-denali-nand-v5a" - for Socionext UniPhier (v5a) + "socionext,uniphier-denali-nand-v5b" - for Socionext 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. @@ -10,8 +12,12 @@ Required properties: Optional properties: - nand-ecc-step-size: see nand.txt for details. If present, the value must be 512 for "altr,socfpga-denali-nand" + 1024 for "socionext,uniphier-denali-nand-v5a" + 1024 for "socionext,uniphier-denali-nand-v5b" - nand-ecc-strength: see nand.txt for details. Valid values are: 8, 15 for "altr,socfpga-denali-nand" + 8, 16, 24 for "socionext,uniphier-denali-nand-v5a" + 8, 16 for "socionext,uniphier-denali-nand-v5b" - nand-ecc-maximize: see nand.txt for details The device tree may optionally contain sub-nodes describing partitions of the diff --git a/drivers/mtd/nand/denali_dt.c b/drivers/mtd/nand/denali_dt.c index 8c09bbe..38800ae 100644 --- a/drivers/mtd/nand/denali_dt.c +++ b/drivers/mtd/nand/denali_dt.c @@ -45,11 +45,42 @@ static const struct denali_dt_data denali_socfpga_data = { }, }; +static const int denali_uniphier_strengths[] = {8, 16, 24}; +static const struct denali_dt_data denali_uniphier_v5a_data = { + .caps = DENALI_CAP_HW_ECC_FIXUP | + DENALI_CAP_DMA_64BIT, + .stepinfo = { + .stepsize = 1024, + .strengths = denali_uniphier_strengths, + .nstrengths = ARRAY_SIZE(denali_uniphier_strengths), + }, +}; + +static const struct denali_dt_data denali_uniphier_v5b_data = { + .revision = 0x0501, + .caps = DENALI_CAP_HW_ECC_FIXUP | + DENALI_CAP_DMA_64BIT, + .stepinfo = { + .stepsize = 1024, + .strengths = denali_uniphier_strengths, + /* no support for strength=24 */ + .nstrengths = ARRAY_SIZE(denali_uniphier_strengths) - 1, + }, +}; + static const struct of_device_id denali_nand_dt_ids[] = { { .compatible = "altr,socfpga-denali-nand", .data = &denali_socfpga_data, }, + { + .compatible = "socionext,uniphier-denali-nand-v5a", + .data = &denali_uniphier_v5a_data, + }, + { + .compatible = "socionext,uniphier-denali-nand-v5b", + .data = &denali_uniphier_v5b_data, + }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, denali_nand_dt_ids);