mtd: nand: Clarify Kconfig entry for software Hamming ECC entries
authorMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 8 Feb 2019 07:48:37 +0000 (08:48 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 18 Apr 2019 06:54:00 +0000 (08:54 +0200)
The software Hamming ECC correction implementation is referred as
MTD_NAND_ECC which is too generic. Rename it
MTD_NAND_ECC_SW_HAMMING. Also rename MTD_NAND_ECC_SMC which is an
SMC quirk in the Hamming implementation as
MTD_NAND_ECC_SW_HAMMING_SMC.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
arch/arm/configs/nhk8815_defconfig
arch/mips/configs/generic/board-ni169445.config
arch/powerpc/configs/85xx/tqm8548_defconfig
drivers/mtd/Kconfig
drivers/mtd/nand/raw/Kconfig
drivers/mtd/nand/raw/Makefile
drivers/mtd/nand/raw/nand_base.c
drivers/mtd/sm_ftl.c
drivers/mtd/tests/mtd_nandecctest.c

index 5f4c6aaa07f628c21f28b03c0cb75f3e80911f0e..e0373989b32d9619e2805d4014bfd567ce23220d 100644 (file)
@@ -53,7 +53,7 @@ CONFIG_MTD_BLOCK=y
 CONFIG_MTD_ONENAND=y
 CONFIG_MTD_ONENAND_VERIFY_WRITE=y
 CONFIG_MTD_ONENAND_GENERIC=y
-CONFIG_MTD_NAND_ECC_SMC=y
+CONFIG_MTD_NAND_ECC_SW_HAMMING_SMC=y
 CONFIG_MTD_NAND=y
 CONFIG_MTD_NAND_FSMC=y
 CONFIG_BLK_DEV_LOOP=y
index 01f6ab0d47d5586b778e23054b23c9f7c0aa922c..e68da2e9dc7c0d865d97e9fcb4f38d3eea0947ff 100644 (file)
@@ -15,7 +15,7 @@ CONFIG_MTD=y
 CONFIG_MTD_BLOCK=y
 CONFIG_MTD_CMDLINE_PARTS=y
 
-CONFIG_MTD_NAND_ECC=y
+CONFIG_MTD_NAND_ECC_SW_HAMMING=y
 CONFIG_MTD_NAND_ECC_SW_BCH=y
 CONFIG_MTD_NAND=y
 CONFIG_MTD_NAND_GPIO=y
index 2697e4e8a761c9995791a93444d315c2e9fb823a..464ce192bc142424621c881e290e4bafb3db9a3c 100644 (file)
@@ -35,7 +35,7 @@ CONFIG_MTD=y
 CONFIG_MTD_CFI=y
 CONFIG_MTD_CFI_AMDSTD=y
 CONFIG_MTD_PHYSMAP_OF=y
-CONFIG_MTD_NAND_ECC_SMC=y
+CONFIG_MTD_NAND_ECC_SW_HAMMING_SMC=y
 CONFIG_MTD_NAND=y
 CONFIG_MTD_NAND_FSL_UPM=y
 CONFIG_BLK_DEV_LOOP=y
index 79a8ff5428839abf126dde0362be50478cdcb109..aa5a27fdfdd1820fd5bc783a35911a4f8ebe7543 100644 (file)
@@ -230,12 +230,11 @@ config SSFDC
          This enables read only access to SmartMedia formatted NAND
          flash. You can mount it with FAT file system.
 
-
 config SM_FTL
        tristate "SmartMedia/xD new translation layer"
        depends on BLOCK
        select MTD_BLKDEVS
-       select MTD_NAND_ECC
+       select MTD_NAND_ECC_SW_HAMMING
        help
          This enables EXPERIMENTAL R/W support for SmartMedia/xD
          FTL (Flash translation layer).
index 7a1bde4fe9f6d95e6a3741f7e34b06f00f6677e6..b521e9862e53bb0515f8f2ac74613d294a16a115 100644 (file)
@@ -1,20 +1,19 @@
-config MTD_NAND_ECC
+config MTD_NAND_ECC_SW_HAMMING
        tristate
 
-config MTD_NAND_ECC_SMC
+config MTD_NAND_ECC_SW_HAMMING_SMC
        bool "NAND ECC Smart Media byte order"
-       depends on MTD_NAND_ECC
+       depends on MTD_NAND_ECC_SW_HAMMING
        default n
        help
          Software ECC according to the Smart Media Specification.
          The original Linux implementation had byte 0 and 1 swapped.
 
-
 menuconfig MTD_NAND
        tristate "Raw/Parallel NAND Device Support"
        depends on MTD
-       select MTD_NAND_ECC
        select MTD_NAND_CORE
+       select MTD_NAND_ECC_SW_HAMMING
        help
          This enables support for accessing all type of raw/parallel
          NAND flash devices. For further information see
@@ -132,7 +131,7 @@ config MTD_NAND_S3C2410_DEBUG
 config MTD_NAND_NDFC
        tristate "NDFC NanD Flash Controller"
        depends on 4xx
-       select MTD_NAND_ECC_SMC
+       select MTD_NAND_ECC_SW_HAMMING_SMC
        help
          NDFC Nand Flash Controllers are integrated in IBM/AMCC's 4xx SoCs
 
index 9749ff00f9e4354dd53d2d9f3f53337a955943ef..a022931318ac9668e5d0e50091e68921fc9a6ec8 100644 (file)
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 
 obj-$(CONFIG_MTD_NAND)                 += nand.o
-obj-$(CONFIG_MTD_NAND_ECC)             += nand_ecc.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
 
index 95fac92d6b82df705e18062beee169a021f88465..fd7ce5b929c05be22a01bf98e4cff84128f69467 100644 (file)
@@ -5081,7 +5081,7 @@ static int nand_set_ecc_soft_ops(struct nand_chip *chip)
                ecc->bytes = 3;
                ecc->strength = 1;
 
-               if (IS_ENABLED(CONFIG_MTD_NAND_ECC_SMC))
+               if (IS_ENABLED(CONFIG_MTD_NAND_ECC_SW_HAMMING_SMC))
                        ecc->options |= NAND_ECC_SOFT_HAMMING_SM_ORDER;
 
                return 0;
index 89227b1d036afd1ab8d51a26ab070f90c56687be..e0955a98a0f4f6ced80060062394b999708a4c2a 100644 (file)
@@ -222,17 +222,17 @@ static int sm_correct_sector(uint8_t *buffer, struct sm_oob *oob)
        uint8_t ecc[3];
 
        __nand_calculate_ecc(buffer, SM_SMALL_PAGE, ecc,
-                            IS_ENABLED(CONFIG_MTD_NAND_ECC_SMC));
+                            IS_ENABLED(CONFIG_MTD_NAND_ECC_SW_HAMMING_SMC));
        if (__nand_correct_data(buffer, ecc, oob->ecc1, SM_SMALL_PAGE,
-                               IS_ENABLED(CONFIG_MTD_NAND_ECC_SMC)) < 0)
+                               IS_ENABLED(CONFIG_MTD_NAND_ECC_SW_HAMMING_SMC)) < 0)
                return -EIO;
 
        buffer += SM_SMALL_PAGE;
 
        __nand_calculate_ecc(buffer, SM_SMALL_PAGE, ecc,
-                            IS_ENABLED(CONFIG_MTD_NAND_ECC_SMC));
+                            IS_ENABLED(CONFIG_MTD_NAND_ECC_SW_HAMMING_SMC));
        if (__nand_correct_data(buffer, ecc, oob->ecc2, SM_SMALL_PAGE,
-                               IS_ENABLED(CONFIG_MTD_NAND_ECC_SMC)) < 0)
+                               IS_ENABLED(CONFIG_MTD_NAND_ECC_SW_HAMMING_SMC)) < 0)
                return -EIO;
        return 0;
 }
@@ -399,11 +399,11 @@ restart:
                if (ftl->smallpagenand) {
                        __nand_calculate_ecc(buf + boffset, SM_SMALL_PAGE,
                                        oob.ecc1,
-                                       IS_ENABLED(CONFIG_MTD_NAND_ECC_SMC));
+                                       IS_ENABLED(CONFIG_MTD_NAND_ECC_SW_HAMMING_SMC));
 
                        __nand_calculate_ecc(buf + boffset + SM_SMALL_PAGE,
                                        SM_SMALL_PAGE, oob.ecc2,
-                                       IS_ENABLED(CONFIG_MTD_NAND_ECC_SMC));
+                                       IS_ENABLED(CONFIG_MTD_NAND_ECC_SW_HAMMING_SMC));
                }
                if (!sm_write_sector(ftl, zone, block, boffset,
                                                        buf + boffset, &oob))
index c71523e945806c1e2f9147a6971b67679932be70..0c0091fb3708f4ad40ac0a30f381326deee0d09b 100644 (file)
@@ -122,9 +122,9 @@ static int no_bit_error_verify(void *error_data, void *error_ecc,
        int ret;
 
        __nand_calculate_ecc(error_data, size, calc_ecc,
-                            IS_ENABLED(CONFIG_MTD_NAND_ECC_SMC));
+                            IS_ENABLED(CONFIG_MTD_NAND_ECC_SW_HAMMING_SMC));
        ret = __nand_correct_data(error_data, error_ecc, calc_ecc, size,
-                                 IS_ENABLED(CONFIG_MTD_NAND_ECC_SMC));
+                                 IS_ENABLED(CONFIG_MTD_NAND_ECC_SW_HAMMING_SMC));
        if (ret == 0 && !memcmp(correct_data, error_data, size))
                return 0;
 
@@ -152,9 +152,9 @@ static int single_bit_error_correct(void *error_data, void *error_ecc,
        int ret;
 
        __nand_calculate_ecc(error_data, size, calc_ecc,
-                            IS_ENABLED(CONFIG_MTD_NAND_ECC_SMC));
+                            IS_ENABLED(CONFIG_MTD_NAND_ECC_SW_HAMMING_SMC));
        ret = __nand_correct_data(error_data, error_ecc, calc_ecc, size,
-                                 IS_ENABLED(CONFIG_MTD_NAND_ECC_SMC));
+                                 IS_ENABLED(CONFIG_MTD_NAND_ECC_SW_HAMMING_SMC));
        if (ret == 1 && !memcmp(correct_data, error_data, size))
                return 0;
 
@@ -189,9 +189,9 @@ static int double_bit_error_detect(void *error_data, void *error_ecc,
        int ret;
 
        __nand_calculate_ecc(error_data, size, calc_ecc,
-                            IS_ENABLED(CONFIG_MTD_NAND_ECC_SMC));
+                            IS_ENABLED(CONFIG_MTD_NAND_ECC_SW_HAMMING_SMC));
        ret = __nand_correct_data(error_data, error_ecc, calc_ecc, size,
-                                 IS_ENABLED(CONFIG_MTD_NAND_ECC_SMC));
+                                 IS_ENABLED(CONFIG_MTD_NAND_ECC_SW_HAMMING_SMC));
 
        return (ret == -EBADMSG) ? 0 : -EINVAL;
 }
@@ -266,7 +266,7 @@ static int nand_ecc_test_run(const size_t size)
 
        prandom_bytes(correct_data, size);
        __nand_calculate_ecc(correct_data, size, correct_ecc,
-                            IS_ENABLED(CONFIG_MTD_NAND_ECC_SMC));
+                            IS_ENABLED(CONFIG_MTD_NAND_ECC_SW_HAMMING_SMC));
 
        for (i = 0; i < ARRAY_SIZE(nand_ecc_test); i++) {
                nand_ecc_test[i].prepare(error_data, error_ecc,