Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3218942imm; Sun, 17 Jun 2018 14:11:58 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKttgJPUHGQsq+DxB9UR0a/D7DXEweyui5rXykRnrHti7cnkE3P8yYPrdgn3ZWY/uimtl39 X-Received: by 2002:a65:66c6:: with SMTP id c6-v6mr8838159pgw.76.1529269918455; Sun, 17 Jun 2018 14:11:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529269918; cv=none; d=google.com; s=arc-20160816; b=xhIzByO3DqMN5WfFjE8wsrQASvjVmkK39BmrvflKF4RWZfManxJvvDZdlSeEJTaQjU VqpDy92TPOfAK9jcJcEiXd74BQzwTyd/48etxAT5Fc2rbI5XEyQyR8zI9efQBL0JuIEl WNcUMT3CCK+BPUEY5KuGhLKBSZ5bzEk7lP34cDQ4b+uY00JqP1Ayc6ssa4Wwe+jwtwnd 0qUznBDhjoUHpEikiIKbjnqx6TfHWtz4mDMGj8hVWTHoHfkztoc6iR/qNdlgmr98jccY BwGfyZjfzs56uUeplWtzk2ywCz9fY+ceCHaGWBeWXDh4jefQMgcubv6qLEty3hnnd1p/ o6YQ== 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=f3Lumn9QC69mdDP3FuVDolsO23dcLYFbVQEMb+VW3QWjODh+efaUwJ0omDZ4FQ96yE UfoCu0rvTUGVLucN6BU3MTjU+6Ei/uB8CqexPrQVF9Q8gmRcCxQNovou8bBDpVHEkoOF KOtH7bqRxiGyTni8wVkKW0x89pwXcpnw5RzmT9wLJFJSa5yVgl1anVF1yEUE3FYpI+Hu Owu2a4UuwQZ3WJhZFhLaNZeRQnOaekNVNB8Ggzm4BLQegS4nVsQQhV1a+P1fmgsrWUSC dBarM+HuGBNB/4+Ke1IgjYwDV5e/0qwq8+bIdRkDVs5P3avPfP7W0GsSIRohUYIqi/bA AjPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=ejgnoLMW; 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 t5-v6si13859379plj.112.2018.06.17.14.11.16; Sun, 17 Jun 2018 14:11:58 -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=ejgnoLMW; 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 S934304AbeFQUqM (ORCPT + 99 others); Sun, 17 Jun 2018 16:46:12 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:50304 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754060AbeFQUqI (ORCPT ); Sun, 17 Jun 2018 16:46:08 -0400 Received: from trochilidae.lan (unknown [37.17.239.3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 820CC5C1279; Sun, 17 Jun 2018 22:46:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1529268366; 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=ejgnoLMWclzgLXO9X85/k4XE1BSst9XNUGBSHoaSyDgU9YckFdQT0vfwYsOnA6ErT7uLL4 pRt34WDP/2BSUprZ388rcfIwSX5+TqrIi6kZQzEst1WjVPAlclVxJQtaraOke6BZPXWpVv alBa1afbjUgr6CxpV4ac0GLEGLrJyd8= 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 v5 1/6] mtd: rawnand: add Reed-Solomon error correction algorithm Date: Sun, 17 Jun 2018 22:46:00 +0200 Message-Id: <20180617204605.4648-2-stefan@agner.ch> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180617204605.4648-1-stefan@agner.ch> References: <20180617204605.4648-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:37.17.238.0/23, 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