Hello TI:
I would like to completely use BCH8 ECC for NAND , (i.e., both U-BOOT firmware, and the kernel). However there seems to be a mistmatch in the ECC layout selected by the kernel. We are using the DVR-RDK release 1.09 on our board which has the same NAND as the EVM.
Since U-BOOT is already booting BCH8, I assume that U-BOOT has the desired ECC layout. (Right?) How can we get Linux to match?
Following the advice in the link below I changed to use BCH8 OMAP_ECC_BCH8_CODE_HW.
http://e2e.ti.com/support/dsp/integra_dsparm/f/625/t/158503.aspx#576107
By inspection of ti81xx_nand.c and nand.h U-BOOT uses........
#define GPMC_NAND_HW_BCH8_ECC_LAYOUT {\
.eccbytes = 56,\
.eccpos = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,\
28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,\
40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,\
52, 53, 54, 55, 56, 57},\
.oobfree = {\
{.offset = 58,\
.length = 6 } } \
}
Linux is reporting this as its table.
[ 0.800000] NAND device: Maf ID: 0x2c, Chip ID: 0xca (Micron, )
[ 0.800000] erasesize: 0x20000, writesize: 2048, oobsize: 64
[ 0.810000] omap_nand_probe OOBSIZE = 13 ECCBYTES 13 ECCSIZE=2048
[ 0.820000] pos[0]=40
[ 0.820000] pos[1]=41
[ 0.820000] pos[2]=42
[ 0.820000] pos[3]=43
[ 0.830000] pos[4]=44
[ 0.830000] pos[5]=45
[ 0.830000] pos[6]=46
[ 0.830000] pos[7]=47
[ 0.840000] pos[8]=48
[ 0.840000] pos[9]=49
[ 0.840000] pos[10]=50
[ 0.840000] pos[11]=51
[ 0.850000] pos[12]=52
This can be observed by adding the following printk in omap2.c
} else {
omap_oobinfo.oobfree->offset = offset;
omap_oobinfo.oobfree->length = info->mtd.oobsize -
offset - omap_oobinfo.eccbytes;
/*
offset is calculated considering the following :
1) 12 bytes and 24 bytes ECC for OOB_64 can be supported
2)Ecc bytes lie to the end of OOB area.
3)Ecc layout must match with u-boot's ECC layout.
*/
offset = info->mtd.oobsize - MAX_HWECC_BYTES_OOB_64;
for (i = 0; i < omap_oobinfo.eccbytes; i++) {
omap_oobinfo.eccpos[i] = i + offset;
printk(KERN_INFO "pos[%d]=%d\n",i,omap_oobinfo.eccpos[i]);
}
}
Regards,
--B