]> git.sur5r.net Git - u-boot/commitdiff
mtd: nand: omap: allow to switch to BCH16
authorHeiko Schocher <hs@denx.de>
Tue, 7 Jun 2016 06:55:42 +0000 (08:55 +0200)
committerTom Rini <trini@konsulko.com>
Thu, 9 Jun 2016 17:53:12 +0000 (13:53 -0400)
support in omap_nand_switch_ecc() also an eccstrength
from 16.

Signed-off-by: Heiko Schocher <hs@denx.de>
arch/arm/cpu/armv7/omap3/board.c
drivers/mtd/nand/omap_gpmc.c

index 0c44ea53e12ed34df596abb5ed0f285f273b0b2b..5f5597772b6daa99d090d7fb83f76de1649cdefe 100644 (file)
@@ -280,6 +280,8 @@ static int do_switch_ecc(cmd_tbl_t * cmdtp, int flag, int argc, char * const arg
                                omap_nand_switch_ecc(1, 1);
                        else if (strncmp(argv[2], "bch8", 4) == 0)
                                omap_nand_switch_ecc(1, 8);
+                       else if (strncmp(argv[2], "bch16", 5) == 0)
+                               omap_nand_switch_ecc(1, 16);
                        else
                                goto usage;
                }
@@ -308,8 +310,8 @@ usage:
 U_BOOT_CMD(
        nandecc, 3, 1,  do_switch_ecc,
        "switch OMAP3 NAND ECC calculation algorithm",
-       "hw [hamming|bch8] - Switch between NAND hardware 1-bit hamming and"
-       " 8-bit BCH\n"
+       "hw [hamming|bch8|bch16] - Switch between NAND hardware 1-bit hamming"
+       " and 8-bit/16-bit BCH\n"
        "                           ecc calculation (second parameter may"
        " be omitted).\n"
        "nandecc sw               - Switch to NAND software ecc algorithm."
index 37c4341763de7b45d9cc8c264ecd96b81842a516..67f293dcd0169de92b669d83cf7eeeb88b25735c 100644 (file)
@@ -917,6 +917,10 @@ int __maybe_unused omap_nand_switch_ecc(uint32_t hardware, uint32_t eccstrength)
                        err = omap_select_ecc_scheme(nand,
                                        OMAP_ECC_BCH8_CODE_HW,
                                        mtd->writesize, mtd->oobsize);
+               } else if (eccstrength == 16) {
+                       err = omap_select_ecc_scheme(nand,
+                                       OMAP_ECC_BCH16_CODE_HW,
+                                       mtd->writesize, mtd->oobsize);
                } else {
                        printf("nand: error: unsupported ECC scheme\n");
                        return -EINVAL;