]> git.baikalelectronics.ru Git - uboot.git/commitdiff
Convert CONFIG_SYS_NAND_HW_ECC to Kconfig
authorTom Rini <trini@konsulko.com>
Sat, 12 Nov 2022 22:36:45 +0000 (17:36 -0500)
committerTom Rini <trini@konsulko.com>
Mon, 5 Dec 2022 21:05:38 +0000 (16:05 -0500)
This converts the following to Kconfig:
   CONFIG_SYS_NAND_HW_ECC

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
12 files changed:
configs/da850evm_nand_defconfig
configs/k2e_evm_defconfig
configs/k2e_hs_evm_defconfig
configs/k2hk_evm_defconfig
configs/k2hk_hs_evm_defconfig
configs/k2l_evm_defconfig
configs/k2l_hs_evm_defconfig
configs/omapl138_lcdk_defconfig
drivers/mtd/nand/raw/Kconfig
drivers/mtd/nand/raw/davinci_nand.c
include/configs/da850evm.h
include/configs/omapl138_lcdk.h

index 84563b2a3c7f5a9891bc691e61e508bcc392bb7d..a7aaf46ea5172728a4d1053bf29ce4bc1a537587 100644 (file)
@@ -86,7 +86,6 @@ CONFIG_DM_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_DAVINCI=y
-CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST=y
 CONFIG_SYS_NAND_HW_ECC_OOBFIRST=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
 CONFIG_SYS_NAND_PAGE_COUNT=0x40
index 9bf2e862b063ef38573b039a7c75b4ec8567e148..977348e73fcc1c519526eba588d17c48407ddb73 100644 (file)
@@ -79,7 +79,6 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_DAVINCI=y
-CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_STMICRO=y
index afa4dc1b41983c20df8d265a656e9c14d7464b53..afba285ffb22d822c99c5ebe811dc4dc8a7780a6 100644 (file)
@@ -54,7 +54,6 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_DAVINCI=y
-CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_STMICRO=y
index cbf948f578ee9cac29e17479622032630c3ce293..6c4563912b5b7eec45322fdc4d4911ba3bf5a716 100644 (file)
@@ -79,7 +79,6 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_DAVINCI=y
-CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_STMICRO=y
index 2480547a51c68073e7320cc7ade7cc7480879b95..33624badae0e36265ea142b86654013623cd0e54 100644 (file)
@@ -54,7 +54,6 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_DAVINCI=y
-CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_STMICRO=y
index f4c8c5e233a64f604af06cb8636e928fa23256d6..e28054bcc72cc5d993047615cce5ba36c29213be 100644 (file)
@@ -79,7 +79,6 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_DAVINCI=y
-CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_STMICRO=y
index 051cd234818f39327a325a7dbc5009a4f41091dc..8f8bb5491305f5ac311be633d1c73ca6fb273c18 100644 (file)
@@ -57,7 +57,6 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_DAVINCI=y
-CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_STMICRO=y
index a067c017794070fba6b82281d0d6963ea149c45c..ff3b5f0857bfed2265fd65dd020e29e747e5e495 100644 (file)
@@ -83,7 +83,6 @@ CONFIG_DM_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_DAVINCI=y
-CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST=y
 CONFIG_SYS_NAND_HW_ECC_OOBFIRST=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
 CONFIG_SYS_NAND_PAGE_COUNT=0x40
index 49b7a4b04bb4e15b307d6721fde150beee97c3bc..0e428418b25d880e44640978775df6be5fe84c03 100644 (file)
@@ -148,9 +148,21 @@ config NAND_DAVINCI
          Enable this driver for NAND flash controllers available in TI Davinci
          and Keystone2 platforms
 
+choice
+       prompt "Type of ECC used on NAND"
+       default SYS_NAND_4BIT_HW_ECC_OOBFIRST
+       depends on NAND_DAVINCI
+
+config SYS_NAND_HW_ECC
+       bool "Use 1-bit HW ECC"
+
 config SYS_NAND_4BIT_HW_ECC_OOBFIRST
        bool "Use 4-bit HW ECC with OOB at the front"
-       depends on NAND_DAVINCI
+
+config SYS_NAND_SOFT_ECC
+       bool "Use software ECC"
+
+endchoice
 
 config KEYSTONE_RBL_NAND
        depends on ARCH_KEYSTONE
index 9158d94de25a36d2db217484ae49d2ff9ef21d63..54aed1363889742e72c861f0adcfcbe1b044b4de 100644 (file)
@@ -766,10 +766,7 @@ static void davinci_nand_init(struct nand_chip *nand)
        nand->ecc.calculate = nand_davinci_calculate_ecc;
        nand->ecc.correct  = nand_davinci_correct_data;
        nand->ecc.hwctl  = nand_davinci_enable_hwecc;
-#else
-       nand->ecc.mode = NAND_ECC_SOFT;
-#endif /* CONFIG_SYS_NAND_HW_ECC */
-#ifdef CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST
+#elif defined(CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST)
        nand->ecc.mode = NAND_ECC_HW_OOB_FIRST;
        nand->ecc.size = 512;
        nand->ecc.bytes = 10;
@@ -778,6 +775,8 @@ static void davinci_nand_init(struct nand_chip *nand)
        nand->ecc.correct = nand_davinci_4bit_correct_data;
        nand->ecc.hwctl = nand_davinci_4bit_enable_hwecc;
        nand->ecc.layout = &nand_davinci_4bit_layout_oobfirst;
+#elif defined(CONFIG_SYS_NAND_SOFT_ECC)
+       nand->ecc.mode = NAND_ECC_SOFT;
 #endif
        /* Set address of hardware control function */
        nand->cmd_ctrl = nand_davinci_hwcontrol;
index abf5db934c50a0c0b7e9ec3bf9698551bdd32309..11f104bcb86dd19135a138e5b641f5939b924e05 100644 (file)
 #define CONFIG_SYS_NAND_BASE           DAVINCI_ASYNC_EMIF_DATA_CE3_BASE
 #define CONFIG_SYS_NAND_MASK_CLE               0x10
 #define CONFIG_SYS_NAND_MASK_ALE               0x8
-#undef CONFIG_SYS_NAND_HW_ECC
 #define CONFIG_SYS_NAND_U_BOOT_SIZE    0x40000
 #define CONFIG_SYS_NAND_U_BOOT_DST     0xc1080000
 #define CONFIG_SYS_NAND_U_BOOT_START   CONFIG_SYS_NAND_U_BOOT_DST
index 184360f7e9001b60b23a8928d45a1cdf4aa48250..233e7b4ee53e6c4762804fcc30e8245c6ae2ac6c 100644 (file)
 #define CONFIG_SYS_NAND_BASE           DAVINCI_ASYNC_EMIF_DATA_CE3_BASE
 #define CONFIG_SYS_NAND_MASK_CLE       0x10
 #define CONFIG_SYS_NAND_MASK_ALE       0x8
-#undef CONFIG_SYS_NAND_HW_ECC
 #define CONFIG_NAND_6BYTES_OOB_FREE_10BYTES_ECC
 #define CONFIG_SYS_NAND_U_BOOT_SIZE    SZ_512K
 #define CONFIG_SYS_NAND_U_BOOT_DST     0xc1080000