From patchwork Mon Mar 4 22:28:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10838805 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EA390922 for ; Mon, 4 Mar 2019 23:14:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D009A29F70 for ; Mon, 4 Mar 2019 23:14:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C20C92B8BC; Mon, 4 Mar 2019 23:14:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3E82529F70 for ; Mon, 4 Mar 2019 23:14:35 +0000 (UTC) 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=pIWgxVvwgf56buegT4Hn8LTMffnacgGyQQAx9D0Mf1s=; b=sPVUPUoQbJWWYn ajpk0NdUaFyqwsG/XVLpsGE78E16FGYQhD4CP0wyTJVTRrx7SbHWYaoKhGy52iOkW6UQlQ+5AxBpa /YUYcYe7IFeNONdkyFNAZ6Ar2vWNh3asWjoIz0NtQk1xTg+9Q3sVA4/mOJ8r6Befb5F4vA/qOiR/a hXfgeaH6vhcyQbrhNff2UQoaaw8qC/XOoGgGIgawN/4ZiFdUWIsBwUYzgQOWSYU3WqiGlGKVuRw7h ufJb2F+NNTzC3rILqPzk5Zug+yV4aawIvS2eATie0flCWuc4hZs2iGkMneUaf/tXAyUp4zrI7h7Ym d/Qn/0kdJLSuoDPj3FgA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h0wmz-0003Of-GI; Mon, 04 Mar 2019 23:14:29 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h0wjf-0007DE-Pf; Mon, 04 Mar 2019 23:11:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type: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=xbWXqrg0ZB3ED2Re70vaLXwEzgoOaFiRtW2rF/GI2bw=; b=YAE9PS9lMHutnhXIc0xja2rzdL 6RT+LzrcbV5GoAS4wy09XFR3icYMvg7QMUN+h2IFLUm0oZbqw8w2xQC3Sgm7TZDvq9aeNx8I22svy vvK4ZMol7BsiJEEGmSysmNMfuPk6Bbs0ATMu9e7r5ScL6mk3LVddGRHh3vg/Or4XsUGV4tiyYZJnz CvacRiA9JtUgbKkcmZvi0ZT7nnRBvkYgfdIsXiyhi9+k0XQ2611MkuqWMK4wg6czY6nflIT3HjFMT FRZBhwSLryRqTjHL6DHPJ/sG2jGCElBuekECdjS2DVkc4iwKh0qmgqj3P0TeQGl2lVp2OMOZeknul TB+1v/NQ==; Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h0w6H-00016O-Km; Mon, 04 Mar 2019 22:30:22 +0000 X-Originating-IP: 90.5.42.199 Received: from localhost.localdomain (atoulouse-657-1-1088-199.w90-5.abo.wanadoo.fr [90.5.42.199]) (Authenticated sender: miquel.raynal@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 5EF5D240006; Mon, 4 Mar 2019 22:29:55 +0000 (UTC) From: Miquel Raynal To: Boris Brezillon , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , Tudor Ambarus Subject: [PATCH v2 14/36] mtd: nand: ecc: Move BCH code into the ecc/ directory Date: Mon, 4 Mar 2019 23:28:19 +0100 Message-Id: <20190304222841.13899-15-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190304222841.13899-1-miquel.raynal@bootlin.com> References: <20190304222841.13899-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190304_173021_921101_91CB7C48 X-CRM114-Status: GOOD ( 16.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh R , Tudor Ambarus , Julien Su , Schrempf Frieder , Paul Cercueil , linux-mtd@lists.infradead.org, Thomas Petazzoni , Miquel Raynal , Mason Yang , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Move generic ECC code in the ecc/ sub-directory for later re-use by the SPI NAND layer. Signed-off-by: Miquel Raynal --- drivers/mtd/nand/ecc/Kconfig | 11 +++++++++++ drivers/mtd/nand/ecc/Makefile | 1 + drivers/mtd/nand/{raw/nand_bch.c => ecc/sw-bch.c} | 2 +- drivers/mtd/nand/raw/Kconfig | 10 ---------- drivers/mtd/nand/raw/Makefile | 1 - drivers/mtd/nand/raw/nand_base.c | 2 +- drivers/mtd/nand/raw/nandsim.c | 2 +- drivers/mtd/nand/raw/omap2.c | 2 +- include/linux/mtd/{nand_bch.h => nand-ecc-sw-bch.h} | 6 +++--- 9 files changed, 19 insertions(+), 18 deletions(-) rename drivers/mtd/nand/{raw/nand_bch.c => ecc/sw-bch.c} (99%) rename include/linux/mtd/{nand_bch.h => nand-ecc-sw-bch.h} (93%) diff --git a/drivers/mtd/nand/ecc/Kconfig b/drivers/mtd/nand/ecc/Kconfig index 01439f66ecbf..75a37f48e126 100644 --- a/drivers/mtd/nand/ecc/Kconfig +++ b/drivers/mtd/nand/ecc/Kconfig @@ -3,4 +3,15 @@ menu "ECC engine support" config MTD_NAND_ECC tristate +config MTD_NAND_ECC_SW_BCH + bool "Software BCH ECC engine" + select BCH + select MTD_NAND_ECC + default n + help + This enables support for software BCH error correction. Binary BCH + codes are more powerful and cpu intensive than traditional Hamming + ECC codes. They are used with NAND devices requiring more than 1 bit + of error correction. + endmenu diff --git a/drivers/mtd/nand/ecc/Makefile b/drivers/mtd/nand/ecc/Makefile index c7367f834d81..36b6ee57ad61 100644 --- a/drivers/mtd/nand/ecc/Makefile +++ b/drivers/mtd/nand/ecc/Makefile @@ -1,3 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_MTD_NAND_ECC) += engine.o +obj-$(CONFIG_MTD_NAND_ECC_SW_BCH) += sw-bch.o diff --git a/drivers/mtd/nand/raw/nand_bch.c b/drivers/mtd/nand/ecc/sw-bch.c similarity index 99% rename from drivers/mtd/nand/raw/nand_bch.c rename to drivers/mtd/nand/ecc/sw-bch.c index 574c0ca16160..b640d5771382 100644 --- a/drivers/mtd/nand/raw/nand_bch.c +++ b/drivers/mtd/nand/ecc/sw-bch.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include /** diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig index 621991a242c1..44dcac13fc0b 100644 --- a/drivers/mtd/nand/raw/Kconfig +++ b/drivers/mtd/nand/raw/Kconfig @@ -21,16 +21,6 @@ menuconfig MTD_RAW_NAND if MTD_RAW_NAND -config MTD_NAND_ECC_SW_BCH - bool "Support software BCH ECC" - select BCH - default n - help - This enables support for software BCH error correction. Binary BCH - codes are more powerful and cpu intensive than traditional Hamming - ECC codes. They are used with NAND devices requiring more than 1 bit - of error correction. - comment "Raw/parallel NAND flash controllers" config MTD_NAND_DENALI diff --git a/drivers/mtd/nand/raw/Makefile b/drivers/mtd/nand/raw/Makefile index ffe95b157131..18ae42077b05 100644 --- a/drivers/mtd/nand/raw/Makefile +++ b/drivers/mtd/nand/raw/Makefile @@ -2,7 +2,6 @@ obj-$(CONFIG_MTD_RAW_NAND) += nand.o obj-$(CONFIG_MTD_NAND_ECC_SW_HAMMING) += nand_ecc.o -obj-$(CONFIG_MTD_NAND_ECC_SW_BCH) += nand_bch.o obj-$(CONFIG_MTD_SM_COMMON) += sm_common.o obj-$(CONFIG_MTD_NAND_CAFE) += cafe_nand.o diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c index 9efe3dd578b5..8047e4f44601 100644 --- a/drivers/mtd/nand/raw/nand_base.c +++ b/drivers/mtd/nand/raw/nand_base.c @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c index 670abe8d59ca..ae913f65be45 100644 --- a/drivers/mtd/nand/raw/nandsim.c +++ b/drivers/mtd/nand/raw/nandsim.c @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/mtd/nand/raw/omap2.c b/drivers/mtd/nand/raw/omap2.c index eaf14813a3ab..3b77c36e43ee 100644 --- a/drivers/mtd/nand/raw/omap2.c +++ b/drivers/mtd/nand/raw/omap2.c @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include diff --git a/include/linux/mtd/nand_bch.h b/include/linux/mtd/nand-ecc-sw-bch.h similarity index 93% rename from include/linux/mtd/nand_bch.h rename to include/linux/mtd/nand-ecc-sw-bch.h index 06ce2b655c13..a682a15fa165 100644 --- a/include/linux/mtd/nand_bch.h +++ b/include/linux/mtd/nand-ecc-sw-bch.h @@ -8,8 +8,8 @@ * This file is the header for the NAND BCH ECC implementation. */ -#ifndef __MTD_NAND_BCH_H__ -#define __MTD_NAND_BCH_H__ +#ifndef __MTD_NAND_ECC_SW_BCH_H__ +#define __MTD_NAND_ECC_SW_BCH_H__ struct mtd_info; struct nand_chip; @@ -66,4 +66,4 @@ static inline void nand_bch_free(struct nand_bch_control *nbc) {} #endif /* CONFIG_MTD_NAND_ECC_SW_BCH */ -#endif /* __MTD_NAND_BCH_H__ */ +#endif /* __MTD_NAND_ECC_SW_BCH_H__ */