]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mtd: nand: ecc-bch: Move BCH code to the generic NAND layer
authorMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 29 Sep 2020 23:01:06 +0000 (01:01 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 30 Nov 2020 08:27:32 +0000 (09:27 +0100)
BCH ECC code might be later re-used by the SPI NAND layer.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200929230124.31491-3-miquel.raynal@bootlin.com
drivers/mtd/nand/Kconfig
drivers/mtd/nand/Makefile
drivers/mtd/nand/ecc-sw-bch.c [moved from drivers/mtd/nand/raw/nand_bch.c with 99% similarity]
drivers/mtd/nand/raw/Kconfig
drivers/mtd/nand/raw/Makefile
drivers/mtd/nand/raw/nand_base.c
drivers/mtd/nand/raw/nandsim.c
drivers/mtd/nand/raw/omap2.c
include/linux/mtd/nand-ecc-sw-bch.h [moved from include/linux/mtd/nand_bch.h with 92% similarity]

index 4a9aed4f01042e4b123343d45f3fbe2e26a101c7..55c17fb0dee12e14ac803b8375c009a9a92bf74c 100644 (file)
@@ -15,6 +15,17 @@ config MTD_NAND_ECC
        bool
        depends on MTD_NAND_CORE
 
+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
 
 endmenu
index 981372953b56ca066df178fcd5c03758bf4c09f5..c7179ff237532e53efd32c8143e81ee15d10f479 100644 (file)
@@ -8,3 +8,4 @@ obj-y   += raw/
 obj-y  += spi/
 
 nandcore-$(CONFIG_MTD_NAND_ECC) += ecc.o
+nandcore-$(CONFIG_MTD_NAND_ECC_SW_BCH) += ecc-sw-bch.o
similarity index 99%
rename from drivers/mtd/nand/raw/nand_bch.c
rename to drivers/mtd/nand/ecc-sw-bch.c
index 9d19ac14c19608f4423290168d7edd6150fca08a..6da14d0263d9cdaf9d55e15f26029e369a6b48df 100644 (file)
@@ -13,7 +13,7 @@
 #include <linux/bitops.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/rawnand.h>
-#include <linux/mtd/nand_bch.h>
+#include <linux/mtd/nand-ecc-sw-bch.h>
 #include <linux/bch.h>
 
 /**
index 6c46f25b57e2ab7ec949fd58ef8ceadffb93a970..b73860aa77c642fd5f2905af2b31fff2c496b0d9 100644 (file)
@@ -22,16 +22,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
index 2930f5b9015d4891be030fba9ca8e1b362d349bb..76904305d091f341b27b96eaa941876436ca36a3 100644 (file)
@@ -2,7 +2,6 @@
 
 obj-$(CONFIG_MTD_RAW_NAND)             += nand.o
 obj-$(CONFIG_MTD_NAND_ECC_SW_HAMMING)  += nand_ecc.o
-nand-$(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
index 1f0d542d59230c06d5277f5741d66831d23958fb..7edcf08a2e81817dc5e840830bfa3541190a37bd 100644 (file)
@@ -36,7 +36,7 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/nand_ecc.h>
-#include <linux/mtd/nand_bch.h>
+#include <linux/mtd/nand-ecc-sw-bch.h>
 #include <linux/interrupt.h>
 #include <linux/bitops.h>
 #include <linux/io.h>
index a8048cb8d220576be45ccbbf27e38edbd6ffc433..9c940ead66fdf90ec0ada903d9fcebd063b4f40c 100644 (file)
@@ -23,7 +23,7 @@
 #include <linux/string.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/rawnand.h>
-#include <linux/mtd/nand_bch.h>
+#include <linux/mtd/nand-ecc-sw-bch.h>
 #include <linux/mtd/partitions.h>
 #include <linux/delay.h>
 #include <linux/list.h>
index 512f60780a5018d9066dad4a9735a86f4a37c01e..0ef209e1cd87a2395b1f88b6b3ff9176b4a0bd3b 100644 (file)
@@ -23,7 +23,7 @@
 #include <linux/of.h>
 #include <linux/of_device.h>
 
-#include <linux/mtd/nand_bch.h>
+#include <linux/mtd/nand-ecc-sw-bch.h>
 #include <linux/platform_data/elm.h>
 
 #include <linux/omap-gpmc.h>
similarity index 92%
rename from include/linux/mtd/nand_bch.h
rename to include/linux/mtd/nand-ecc-sw-bch.h
index d5956cc48ba96e398857035e1e54e6fc79b38c08..1e1ee3af82b145b675fe2f04dadb98db20cbc86e 100644 (file)
@@ -5,8 +5,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;
@@ -63,4 +63,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__ */