大神好:
内核是3.2版本的 omap2.c
/* selsect the ecc type */
if (pdata->ecc_opt == OMAP_ECC_HAMMING_CODE_DEFAULT)
info->nand.ecc.mode = NAND_ECC_SOFT;
else {
if (pdata->ecc_opt == OMAP_ECC_BCH4_CODE_HW) {
info->nand.ecc.bytes = 4*7;
info->nand.ecc.size = 4*512;
} else if (pdata->ecc_opt == OMAP_ECC_BCH8_CODE_HW) {
info->nand.ecc.bytes = OMAP_BCH8_ECC_SECT_BYTES;
info->nand.ecc.size = 512;
info->nand.ecc.read_page = omap_read_page_bch;
} else {
info->nand.ecc.bytes = 3;
info->nand.ecc.size = 512;
}
info->nand.ecc.calculate = omap_calculate_ecc;
info->nand.ecc.hwctl = omap_enable_hwecc;
info->nand.ecc.correct = omap_correct_data;
info->nand.ecc.mode = NAND_ECC_HW;
}
求助,配置的是OMAP_ECC_BCH16_CODE_HW ,然后会走到
info->nand.ecc.bytes = 3;
info->nand.ecc.size = 512;
不明白,info->nand.ecc.bytes = 3; 为什么是3?是怎么算出来的呢?用的nand flash类型是page size :2K+64BYTE
Jian Zhou:
请问您是想ECC校验算法改成BCH16么?可能需要根据BCH16要求的修改byte和size参数。