Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp41776imm; Thu, 21 Jun 2018 13:33:17 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJDGRXw7/FfHEZTmcwwk7ZU1K70VdGwVXPujd7Qdv5B51pCgWbcQt/xoMsrY+WS1hb/igq/ X-Received: by 2002:a17:902:1025:: with SMTP id b34-v6mr9278059pla.112.1529613197026; Thu, 21 Jun 2018 13:33:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529613196; cv=none; d=google.com; s=arc-20160816; b=LU2nbWH6JZTHciKypry+n8NFTYP7bYDoKcDz9oR8UNiyLDDLeLve7sB0XWUS/16BJW dI41NYxIgZd6NEYwLfjJpvlVwSThqRvb8BtKkoYtfjaQESNepazvAMHn18qDrORw84aV lYgtkEJt1nHRvWAg5rZfGfa48TDoXIiq7LpoG2PB8lyy7WqiVztiKrSDqgBWjNBeoIC6 FxJxDmwuMLxs650PcySWPuoEHMtRPIV/ercgaHI8BTF8leDL4B0zgbjfreGHhyUyem8M vZdQ9hHcwu8GdQVW7myY9p8ivdPodMRNtPzWVj7bjAibPb/zOxak4PO3d1f1PeSS1WFh qkmA== 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=E0y4P/359z+kwwomWAP5CBbagG+PPG2tHrSW4fLVaNxf1u3R9j1sgKjVAS/2axYjEe A7L3LKCYddeirrDevh9QjIXoD4EHU8oVqtsn4pTHMuGxeDnkwTi1z2cSKwxfOP7tfOA8 UbKuKLXQ9Gaigqkz8Ctpmr6gtlD7HtrcjDPo7RPn6PTIZErmgyhHAcImhKC7wdq/Y7o3 m9Ojs/oEqhR53VU71SllyJklr6XwU5yk6r3Q21403oNnBQu2dd49hX6LmO188/euNHua M+aAp6B6GV/YsDdqhdAmjFEWHupEMLoYTDaklRY07/qUkAH60Vysz30j6mIr1nlljYUE xMHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b="iTJxF/TJ"; 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 k190-v6si1616836pge.421.2018.06.21.13.33.02; Thu, 21 Jun 2018 13:33:16 -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="iTJxF/TJ"; 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 S933490AbeFUUbx (ORCPT + 99 others); Thu, 21 Jun 2018 16:31:53 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:38578 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933018AbeFUUbt (ORCPT ); Thu, 21 Jun 2018 16:31:49 -0400 Received: from localhost.localdomain (unknown [IPv6:2a02:169:34d6:10::3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 414D35C16B5; Thu, 21 Jun 2018 22:31:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1529613107; 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=iTJxF/TJbCWiT8FJs29rdokiXlOgGSY6D3LRkurAqb/URt9HDWVbvvgahbmlt8m7Cu5HSO ahprc3mUG/ZyngrZXd9gSeiSH60H24FhwpgK4SbvuRT5I+TZudSexcoxo5R+JVRHZvSAzy v5KUkhhYNFlsrTqptiluwvzrEc4z+to= 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 v6 1/6] mtd: rawnand: add Reed-Solomon error correction algorithm Date: Thu, 21 Jun 2018 22:31:40 +0200 Message-Id: <20180621203145.7628-2-stefan@agner.ch> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180621203145.7628-1-stefan@agner.ch> References: <20180621203145.7628-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