From patchwork Wed Mar 22 14:07:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 95775 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp261996qgd; Wed, 22 Mar 2017 07:19:25 -0700 (PDT) X-Received: by 10.98.22.87 with SMTP id 84mr47868685pfw.145.1490192365823; Wed, 22 Mar 2017 07:19:25 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id e70si1426065pfc.37.2017.03.22.07.19.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Mar 2017 07:19:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) client-ip=65.50.211.133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@infradead.org; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=dmw+YkURRbJm3VdTUJdq/8la5NsDsSQjHK50eBPVdCM=; b=QkMg0VO2GRwGJlr3Xf9hjTf94q R6+511asSK5ObthPPK5bBS1JdKNxmQdXz+kUZ9jSwEaSceIfecCV+LT6EA85EBhnpbYIv8+FjgsK/ vhCbuN21SbRw5Km5WTon3sBZBPDm4V2LdF+Ig4V4VQmpBXcESJd4cijr82IA8kJTnEG4ItonAEBO5 ELdsclMy8EnkKxF7W3oL/6j7ah58/rVvk0bIJYc5CmAqquqlq+g5zVPD/VzhTMoPCypf8CArSY4yO mbdy7JbNPPYgf1KI241pbyJhAfFBIPtgzbiF8WQ5GLWeJ6HndhgTyY9zbc0QhWttdZbaV7EwHIzMs F2XQYdPg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cqh6e-0001Ej-5P; Wed, 22 Mar 2017 14:19:20 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cqh5d-00082C-VX for linux-mtd@bombadil.infradead.org; Wed, 22 Mar 2017 14:18:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=bglpfXFek063mgot4aXMAWb6gQhcBaplpfasDr1oDxI=; b=CwrJ/s+RmfDulcMevjdWmUWui yjFJZX4id0Yh5SZ7FEzlAJrSnotpunG84fFMRaTvX3aucfdPkPbb+04zf+LgHTKGFRWaKdtodHNNl xXmw+NEeD2+WPsn64QQ0gWIpv/1oVRJXpscTIEK3sxXusB45+hCL1K7Vuxrx8oavcGgjNZtHyYgR9 bNkxi8bWZfj63u9DaJs+dORMTD8z4CcKTZYJA2ls5fEIMuij/MCQrjicPJ72SgF+G8wFln2ubUDJb fUqEKMyzRF9O220kVIDLBDtch1KUc25OmnZSoTKjjqNnrx6bOZJJ1uEkKYb4MWlv2Q5NE6NOh9M6D 0rzRexRdQ==; Received: from conuserg-07.nifty.com ([210.131.2.74]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cqgxZ-0007so-12 for linux-mtd@lists.infradead.org; Wed, 22 Mar 2017 14:10:01 +0000 Received: from pug.jp.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id v2ME8LDW010154; Wed, 22 Mar 2017 23:08:41 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com v2ME8LDW010154 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1490191723; bh=bglpfXFek063mgot4aXMAWb6gQhcBaplpfasDr1oDxI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KnPA5j3tMSwvJmSjvbAluRpWGcWCBRW6UyD+cvXipLtkBzPmEe/goG49dpLpPiLnA 7AWYkxDINGiuFHjSSi+d/e7oL9b637It8J4sf5GoDAhkG88TmAHmAjp71EyWBhomGe FIsxOTB7sJNOSebwKMcH1tYib4hRmuJ+O0CkouFCIvpTdOrZER8wb/HwTQZrZpm9y2 8HjmqkK5bf02qwlqx2bzY6Brkv1vUby3ZrlAlEhMpJ2wO+W4qXjq6s5UBtKbLwTMG/ Hs+lfphAQxqR+YP4zwFbqjChDVyAlYaEyFziAgEsVnFCWUfT+2xanMiXowChcZMs/O EA1WYWN6OUqjg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Subject: [PATCH v2 13/53] mtd: nand: denali_dt: enable HW_ECC_FIXUP for Altera SOCFPGA variant Date: Wed, 22 Mar 2017 23:07:20 +0900 Message-Id: <1490191680-14481-14-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490191680-14481-1-git-send-email-yamada.masahiro@socionext.com> References: <1490191680-14481-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170322_140957_679827_3C1C4B2D X-CRM114-Status: GOOD ( 16.15 ) X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.4.1 on casper.infradead.org summary: Content analysis details: (-1.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent.monat@idquantique.com, Boris Brezillon , thorsten.christiansson@idquantique.com, Richard Weinberger , Marek Vasut , Masahiro Yamada , Artem Bityutskiy , Cyrille Pitchen , Jason Roberts , linux-kernel@vger.kernel.org, Mark Rutland , Dinh Nguyen , devicetree@vger.kernel.org, Rob Herring , Masami Hiramatsu , Chuanxiao Dong , Jassi Brar , Brian Norris , Enrico Jorns , David Woodhouse , Graham Moore MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org There are various customizable parameters, so several variants for this IP. A generic compatible like "denali,denali-nand-dt" is useless. Moreover, there are multiple things wrong with this string. (Refer to Rob's comment [1]) The denali_dt.c was split out and this compatible was added by Altera for the SOCFPGA port. So, replace it with a more specific string. The Denali IP on SOCFPGA incorporates the hardware ECC fixup feature. So, this capability should be associated with the compatible string. [1] https://lkml.org/lkml/2016/12/1/450 Signed-off-by: Masahiro Yamada --- Changes in v2: - Add caps flag to of_device_id data, not hard-code in driver code - Add Altera-specific compatible. Documentation/devicetree/bindings/mtd/denali-nand.txt | 5 +++-- drivers/mtd/nand/denali_dt.c | 14 ++++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) -- 2.7.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/Documentation/devicetree/bindings/mtd/denali-nand.txt b/Documentation/devicetree/bindings/mtd/denali-nand.txt index b04d03a..6f4ab4c 100644 --- a/Documentation/devicetree/bindings/mtd/denali-nand.txt +++ b/Documentation/devicetree/bindings/mtd/denali-nand.txt @@ -1,7 +1,8 @@ * Denali NAND controller Required properties: - - compatible : should be "denali,denali-nand-dt" + - compatible : should be one of the following: + "altr,socfpga-denali-nand" - for Altera SOCFPGA - 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. @@ -15,7 +16,7 @@ Examples: nand: nand@ff900000 { #address-cells = <1>; #size-cells = <1>; - compatible = "denali,denali-nand-dt"; + compatible = "altr,socfpga-denali-nand"; reg = <0xff900000 0x100000>, <0xffb80000 0x10000>; reg-names = "nand_data", "denali_reg"; interrupts = <0 144 4>; diff --git a/drivers/mtd/nand/denali_dt.c b/drivers/mtd/nand/denali_dt.c index 293ddb8..9577bfd 100644 --- a/drivers/mtd/nand/denali_dt.c +++ b/drivers/mtd/nand/denali_dt.c @@ -33,11 +33,17 @@ struct denali_dt_data { unsigned int caps; }; -static const struct of_device_id denali_nand_dt_ids[] = { - { .compatible = "denali,denali-nand-dt" }, - { /* sentinel */ } - }; +static const struct denali_dt_data denali_socfpga_data = { + .caps = DENALI_CAP_HW_ECC_FIXUP, +}; +static const struct of_device_id denali_nand_dt_ids[] = { + { + .compatible = "altr,socfpga-denali-nand", + .data = &denali_socfpga_data, + }, + { /* sentinel */ } +}; MODULE_DEVICE_TABLE(of, denali_nand_dt_ids); static u64 denali_dma_mask;