Lines Matching full:ecc

25  * ECC4 and ECC1 have 13 bytes and 3 bytes of ecc respectively for 512 bytes of
63 * of OOB size is reserved for ECC, Byte no. 0 & 1 reserved for bad block & 118
98 * ECC placement definitions in oobfree type format
99 * There are 13 bytes of ecc for every 512 byte block and it has to be read
102 * Managing the ecc bytes in the following way makes it easier for software to
103 * read ecc bytes consecutive to data bytes. This way is similar to
197 /* The calculated ecc is actually the correction index in data */ in fsmc_bch8_correct_data()
210 * would result in an ecc error because the oob data is also in fsmc_bch8_correct_data()
211 * erased to FF and the calculated ecc for an FF data is not in fsmc_bch8_correct_data()
262 const u_char *data, u_char *ecc) in fsmc_read_hwecc() argument
273 * Busy waiting for ecc computation in fsmc_read_hwecc()
281 ecc[0] = (u_char) (ecc_tmp >> 0); in fsmc_read_hwecc()
282 ecc[1] = (u_char) (ecc_tmp >> 8); in fsmc_read_hwecc()
283 ecc[2] = (u_char) (ecc_tmp >> 16); in fsmc_read_hwecc()
284 ecc[3] = (u_char) (ecc_tmp >> 24); in fsmc_read_hwecc()
287 ecc[4] = (u_char) (ecc_tmp >> 0); in fsmc_read_hwecc()
288 ecc[5] = (u_char) (ecc_tmp >> 8); in fsmc_read_hwecc()
289 ecc[6] = (u_char) (ecc_tmp >> 16); in fsmc_read_hwecc()
290 ecc[7] = (u_char) (ecc_tmp >> 24); in fsmc_read_hwecc()
293 ecc[8] = (u_char) (ecc_tmp >> 0); in fsmc_read_hwecc()
294 ecc[9] = (u_char) (ecc_tmp >> 8); in fsmc_read_hwecc()
295 ecc[10] = (u_char) (ecc_tmp >> 16); in fsmc_read_hwecc()
296 ecc[11] = (u_char) (ecc_tmp >> 24); in fsmc_read_hwecc()
299 ecc[12] = (u_char) (ecc_tmp >> 16); in fsmc_read_hwecc()
304 ecc[0] = (u_char) (ecc_tmp >> 0); in fsmc_read_hwecc()
305 ecc[1] = (u_char) (ecc_tmp >> 8); in fsmc_read_hwecc()
306 ecc[2] = (u_char) (ecc_tmp >> 16); in fsmc_read_hwecc()
333 * data(512 byte) -> ecc(13 byte)
341 int i, j, s, stat, eccsize = chip->ecc.size; in fsmc_read_page_hwecc()
342 int eccbytes = chip->ecc.bytes; in fsmc_read_page_hwecc()
343 int eccsteps = chip->ecc.steps; in fsmc_read_page_hwecc()
350 /* Differentiate between small and large page ecc place definitions */ in fsmc_read_page_hwecc()
359 chip->ecc.hwctl(mtd, NAND_ECC_READ); in fsmc_read_page_hwecc()
380 chip->ecc.calculate(mtd, p, &ecc_calc[i]); in fsmc_read_page_hwecc()
382 stat = chip->ecc.correct(mtd, p, &ecc_code[i], in fsmc_read_page_hwecc()
395 * fsmc_nand_switch_ecc - switch the ECC operation between different engines
408 * 1 bit HW ECC. The BCH8 HW ECC (FSMC_VER8) from the ST-Ericsson in fsmc_nand_switch_ecc()
410 * function, as it doesn't need to switch to a different ECC layout. in fsmc_nand_switch_ecc()
415 /* Setup the ecc configurations again */ in fsmc_nand_switch_ecc()
417 nand->ecc.mode = NAND_ECC_HW; in fsmc_nand_switch_ecc()
418 nand->ecc.bytes = 3; in fsmc_nand_switch_ecc()
419 nand->ecc.strength = 1; in fsmc_nand_switch_ecc()
420 nand->ecc.layout = &fsmc_ecc1_layout; in fsmc_nand_switch_ecc()
421 nand->ecc.calculate = fsmc_read_hwecc; in fsmc_nand_switch_ecc()
422 nand->ecc.correct = nand_correct_data; in fsmc_nand_switch_ecc()
428 nand->ecc.mode = NAND_ECC_SOFT_BCH; in fsmc_nand_switch_ecc()
429 nand->ecc.strength = 4; in fsmc_nand_switch_ecc()
430 nand->ecc.layout = NULL; in fsmc_nand_switch_ecc()
432 printf("Error: ECC strength %d not supported!\n", eccstrength); in fsmc_nand_switch_ecc()
435 /* Update NAND handling after ECC mode switch */ in fsmc_nand_switch_ecc()
473 nand->ecc.mode = NAND_ECC_HW; in fsmc_nand_init()
474 nand->ecc.size = 512; in fsmc_nand_init()
475 nand->ecc.calculate = fsmc_read_hwecc; in fsmc_nand_init()
476 nand->ecc.hwctl = fsmc_enable_hwecc; in fsmc_nand_init()
486 nand->ecc.bytes = 13; in fsmc_nand_init()
487 nand->ecc.strength = 8; in fsmc_nand_init()
488 nand->ecc.correct = fsmc_bch8_correct_data; in fsmc_nand_init()
489 nand->ecc.read_page = fsmc_read_page_hwecc; in fsmc_nand_init()
491 nand->ecc.layout = &fsmc_ecc4_sp_layout; in fsmc_nand_init()
494 nand->ecc.layout = &fsmc_ecc4_224_layout; in fsmc_nand_init()
496 nand->ecc.layout = &fsmc_ecc4_lp_layout; in fsmc_nand_init()
501 nand->ecc.bytes = 3; in fsmc_nand_init()
502 nand->ecc.strength = 1; in fsmc_nand_init()
503 nand->ecc.layout = &fsmc_ecc1_layout; in fsmc_nand_init()
504 nand->ecc.correct = nand_correct_data; in fsmc_nand_init()