Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3137075imm; Sun, 24 Jun 2018 12:25:26 -0700 (PDT) X-Google-Smtp-Source: ADUXVKINX2GUG9yX8fe2EZF57V8mCytpwVfuaPkx6p67/7qQlPMNtGzEa0Ype/8BOC3ifMliWifQ X-Received: by 2002:a63:69c4:: with SMTP id e187-v6mr8175916pgc.294.1529868326321; Sun, 24 Jun 2018 12:25:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529868326; cv=none; d=google.com; s=arc-20160816; b=Anllzjm1CnyHn82NUCUvxZ+QicsuJ97gPhjq4xOLdh5pGuUJRZQkpeXrRF4h855nNH jilrlMIulkF5kzqZDaKI1cAE9wCwVOdMgutzMHvUvFszx53a5mGUXdcaWFk68+eVn8+I hafiOP40O0q63y4NwKIUy/bvR4QXZ/Q5O4rs+agGkK2vo3D+wrXbrg84mNsu7VDUQQGz rkKk6V6fQu/ITCHcaSuynYtKyCDdninzRs9Hn0bt6O+e4T4LOKcJ4t26mtaluxPDHn3E vXT/vvPdACObQ873nl45Js88iHR6gpM4djBaUbMN5rW+Phq/2x9+85QMechzcu81JSQt hclA== 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:arc-authentication-results; bh=Sam56dJzffh/HgwJOXi79xAsu0HRMYX5+/Q/e7SsbuA=; b=mdApyDSdmMedoGMaSX88EdnhQzoNmeFFxV8SDR//Kb0Ckxdp5CVU/P5lDDztRR6inm yB2W5ImDPqNCQt+LLZMkKnWiFTzslE4WVfkSAEm+p1RrI+bH/2tLAIve7aVbRIPeVZRM 35aJaI38nOX2YivdTowaEu/ye4pXvLpds48kKdE11UYhFgixENOpJVpULS3Sr1HB1bzr 2BgViiRbzQqPlIUBYtooYMA4tywX5Lf1Bw5cgjHqhIqrMjFHLUBacJouRAh1YYoFhx+q Qd2RiwEIDoZnMZAPylIcnnn3l3Sfwtn8daBvPXs4JPDnh7R3PHFLVHOs8GkKbGzSfSxd IbwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=G+pcoQ35; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 a9-v6si1688042pgf.380.2018.06.24.12.24.49; Sun, 24 Jun 2018 12:25:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=G+pcoQ35; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751866AbeFXTWh (ORCPT + 99 others); Sun, 24 Jun 2018 15:22:37 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:36130 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751586AbeFXTWf (ORCPT ); Sun, 24 Jun 2018 15:22:35 -0400 Received: from trochilidae.lan (unknown [IPv6:2a02:169:34d6:10::3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 5F3EC5C10FE; Sun, 24 Jun 2018 21:22:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1529868153; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Sam56dJzffh/HgwJOXi79xAsu0HRMYX5+/Q/e7SsbuA=; b=G+pcoQ359khnjB7ds2Yf6KfKRxqkeweVX9aXphiOgDGrpePY+h9x5YDYslA20N3alNJec0 xBIM2yEXeVLbb2Xm9QnAQp2F9Jp1Tn1G4v2qgwAVxH+IZJxjemaB9KAv72quEUUTKWjfRm B1ljP8VL8Giwn9KyoZFbbeb3AVd+UFo= From: Stefan Agner To: boris.brezillon@bootlin.com, dwmw2@infradead.org, computersforpeace@gmail.com, marek.vasut@gmail.com, robh+dt@kernel.org, mark.rutland@arm.com, thierry.reding@gmail.com Cc: dev@lynxeye.de, miquel.raynal@bootlin.com, richard@nod.at, marcel@ziswiler.com, krzk@kernel.org, digetx@gmail.com, benjamin.lindqvist@endian.se, jonathanh@nvidia.com, pdeschrijver@nvidia.com, pgaikwad@nvidia.com, mirza.krak@gmail.com, gaireg@gaireg.de, linux-mtd@lists.infradead.org, linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Stefan Agner Subject: [PATCH v7 1/6] mtd: rawnand: add Reed-Solomon error correction algorithm Date: Sun, 24 Jun 2018 21:22:25 +0200 Message-Id: <20180624192230.4674-2-stefan@agner.ch> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180624192230.4674-1-stefan@agner.ch> References: <20180624192230.4674-1-stefan@agner.ch> X-Spamd-Result: default: False [-2.10 / 15.00]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_TWELVE(0.00)[24]; BAYES_HAM(-3.00)[100.00%]; TAGGED_RCPT(0.00)[dt]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; MID_CONTAINS_FROM(1.00)[]; ASN(0.00)[asn:13030, ipnet:2a02:169::/32, country:CH]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add Reed-Solomon (RS) to the enumeration of ECC algorithms. Signed-off-by: Stefan Agner Reviewed-by: Boris Brezillon Acked-by: Rob Herring --- Documentation/devicetree/bindings/mtd/nand.txt | 2 +- drivers/mtd/nand/raw/nand_base.c | 1 + include/linux/mtd/rawnand.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/mtd/nand.txt b/Documentation/devicetree/bindings/mtd/nand.txt index 8bb11d809429d..eaef8c657aa5c 100644 --- a/Documentation/devicetree/bindings/mtd/nand.txt +++ b/Documentation/devicetree/bindings/mtd/nand.txt @@ -25,7 +25,7 @@ Optional NAND chip properties: Deprecated values: "soft_bch": use "soft" and nand-ecc-algo instead - nand-ecc-algo: string, algorithm of NAND ECC. - Supported values are: "hamming", "bch". + Valid values are: "hamming", "bch", "rs". - nand-bus-width : 8 or 16 bus width if not present 8 - nand-on-flash-bbt: boolean to enable on flash bbt option if not present false diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c index 10c4f9919850c..47e9cb9063da4 100644 --- a/drivers/mtd/nand/raw/nand_base.c +++ b/drivers/mtd/nand/raw/nand_base.c @@ -5777,6 +5777,7 @@ static int of_get_nand_ecc_mode(struct device_node *np) static const char * const nand_ecc_algos[] = { [NAND_ECC_HAMMING] = "hamming", [NAND_ECC_BCH] = "bch", + [NAND_ECC_RS] = "rs", }; static int of_get_nand_ecc_algo(struct device_node *np) diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h index 3e8ec3b8a39c7..2d9cb7acbc3d8 100644 --- a/include/linux/mtd/rawnand.h +++ b/include/linux/mtd/rawnand.h @@ -121,6 +121,7 @@ enum nand_ecc_algo { NAND_ECC_UNKNOWN, NAND_ECC_HAMMING, NAND_ECC_BCH, + NAND_ECC_RS, }; /* -- 2.17.1