Index: uboot_davinci/cpu/arm926ejs/davinci/nand.c =================================================================== --- uboot_davinci.orig/cpu/arm926ejs/davinci/nand.c +++ uboot_davinci/cpu/arm926ejs/davinci/nand.c @@ -98,7 +98,11 @@ static struct nand_oobinfo davinci_nand_ static struct nand_oobinfo davinci_nand_oobinfo = { .useecc = MTD_NANDECC_AUTOPLACE, .eccbytes = 3, +#ifdef CFG_NAND_RBLECC + .eccpos = {0, 1, 2, 3}, +#else .eccpos = {0, 1, 2}, +#endif .oobfree = { {6, 2}, {8, 8} } }; #else @@ -150,9 +154,17 @@ static int nand_davinci_calculate_ecc(st region = 1; while (n--) { tmp = nand_davinci_readecc(mtd, region); +#ifdef CFG_NAND_RBLECC + *ecc_code++ = (tmp >> 24) & 0xff; + *ecc_code++ = (tmp >> 16) & 0xff; + *ecc_code++ = (tmp >> 8) & 0xff; + *ecc_code++ = (tmp ) & 0xff; + this->eccbytes = 4; +#else *ecc_code++ = tmp; *ecc_code++ = tmp >> 16; *ecc_code++ = ((tmp >> 8) & 0x0f) | ((tmp >> 20) & 0xf0); +#endif region++; } return(0); Index: uboot_davinci/include/configs/davinci_dvevm.h =================================================================== --- uboot_davinci.orig/include/configs/davinci_dvevm.h +++ uboot_davinci/include/configs/davinci_dvevm.h @@ -52,6 +52,11 @@ #define DV_EVM #define CFG_NAND_SMALLPAGE #define CFG_USE_NOR +/* #define CFG_USE_NAND */ +/* #define CFG_NAND_RBLECC */ +/* #define CONFIG_MTD_NAND_VERIFY_WRITE */ +/* #define CONFIG_MTD_DEBUG */ +/* #define CONFIG_MTD_DEBUG_VERBOSE 0 */ /*===================*/ /* SoC Configuration */ /*===================*/