Lines Matching full:ecc

24  * ECC4 and ECC1 have 13 bytes and 3 bytes of ecc respectively for 512 bytes of
62 * of OOB size is reserved for ECC, Byte no. 0 & 1 reserved for bad block & 118
97 * ECC placement definitions in oobfree type format
98 * There are 13 bytes of ecc for every 512 byte block and it has to be read
101 * Managing the ecc bytes in the following way makes it easier for software to
102 * read ecc bytes consecutive to data bytes. This way is similar to
196 /* The calculated ecc is actually the correction index in data */ in fsmc_bch8_correct_data()
209 * would result in an ecc error because the oob data is also in fsmc_bch8_correct_data()
210 * erased to FF and the calculated ecc for an FF data is not in fsmc_bch8_correct_data()
261 const u_char *data, u_char *ecc) in fsmc_read_hwecc() argument
272 * Busy waiting for ecc computation in fsmc_read_hwecc()
280 ecc[0] = (u_char) (ecc_tmp >> 0); in fsmc_read_hwecc()
281 ecc[1] = (u_char) (ecc_tmp >> 8); in fsmc_read_hwecc()
282 ecc[2] = (u_char) (ecc_tmp >> 16); in fsmc_read_hwecc()
283 ecc[3] = (u_char) (ecc_tmp >> 24); in fsmc_read_hwecc()
286 ecc[4] = (u_char) (ecc_tmp >> 0); in fsmc_read_hwecc()
287 ecc[5] = (u_char) (ecc_tmp >> 8); in fsmc_read_hwecc()
288 ecc[6] = (u_char) (ecc_tmp >> 16); in fsmc_read_hwecc()
289 ecc[7] = (u_char) (ecc_tmp >> 24); in fsmc_read_hwecc()
292 ecc[8] = (u_char) (ecc_tmp >> 0); in fsmc_read_hwecc()
293 ecc[9] = (u_char) (ecc_tmp >> 8); in fsmc_read_hwecc()
294 ecc[10] = (u_char) (ecc_tmp >> 16); in fsmc_read_hwecc()
295 ecc[11] = (u_char) (ecc_tmp >> 24); in fsmc_read_hwecc()
298 ecc[12] = (u_char) (ecc_tmp >> 16); in fsmc_read_hwecc()
303 ecc[0] = (u_char) (ecc_tmp >> 0); in fsmc_read_hwecc()
304 ecc[1] = (u_char) (ecc_tmp >> 8); in fsmc_read_hwecc()
305 ecc[2] = (u_char) (ecc_tmp >> 16); in fsmc_read_hwecc()
332 * data(512 byte) -> ecc(13 byte)
340 int i, j, s, stat, eccsize = chip->ecc.size; in fsmc_read_page_hwecc()
341 int eccbytes = chip->ecc.bytes; in fsmc_read_page_hwecc()
342 int eccsteps = chip->ecc.steps; in fsmc_read_page_hwecc()
349 /* Differentiate between small and large page ecc place definitions */ in fsmc_read_page_hwecc()
358 chip->ecc.hwctl(mtd, NAND_ECC_READ); in fsmc_read_page_hwecc()
379 chip->ecc.calculate(mtd, p, &ecc_calc[i]); in fsmc_read_page_hwecc()
381 stat = chip->ecc.correct(mtd, p, &ecc_code[i], in fsmc_read_page_hwecc()
394 * fsmc_nand_switch_ecc - switch the ECC operation between different engines
407 * 1 bit HW ECC. The BCH8 HW ECC (FSMC_VER8) from the ST-Ericsson in fsmc_nand_switch_ecc()
409 * function, as it doesn't need to switch to a different ECC layout. in fsmc_nand_switch_ecc()
414 /* Setup the ecc configurations again */ in fsmc_nand_switch_ecc()
416 nand->ecc.mode = NAND_ECC_HW; in fsmc_nand_switch_ecc()
417 nand->ecc.bytes = 3; in fsmc_nand_switch_ecc()
418 nand->ecc.strength = 1; in fsmc_nand_switch_ecc()
419 nand->ecc.layout = &fsmc_ecc1_layout; in fsmc_nand_switch_ecc()
420 nand->ecc.calculate = fsmc_read_hwecc; in fsmc_nand_switch_ecc()
421 nand->ecc.correct = nand_correct_data; in fsmc_nand_switch_ecc()
427 nand->ecc.mode = NAND_ECC_SOFT_BCH; in fsmc_nand_switch_ecc()
428 nand->ecc.strength = 4; in fsmc_nand_switch_ecc()
429 nand->ecc.layout = NULL; in fsmc_nand_switch_ecc()
431 printf("Error: ECC strength %d not supported!\n", eccstrength); in fsmc_nand_switch_ecc()
434 /* Update NAND handling after ECC mode switch */ in fsmc_nand_switch_ecc()
472 nand->ecc.mode = NAND_ECC_HW; in fsmc_nand_init()
473 nand->ecc.size = 512; in fsmc_nand_init()
474 nand->ecc.calculate = fsmc_read_hwecc; in fsmc_nand_init()
475 nand->ecc.hwctl = fsmc_enable_hwecc; in fsmc_nand_init()
485 nand->ecc.bytes = 13; in fsmc_nand_init()
486 nand->ecc.strength = 8; in fsmc_nand_init()
487 nand->ecc.correct = fsmc_bch8_correct_data; in fsmc_nand_init()
488 nand->ecc.read_page = fsmc_read_page_hwecc; in fsmc_nand_init()
490 nand->ecc.layout = &fsmc_ecc4_sp_layout; in fsmc_nand_init()
493 nand->ecc.layout = &fsmc_ecc4_224_layout; in fsmc_nand_init()
495 nand->ecc.layout = &fsmc_ecc4_lp_layout; in fsmc_nand_init()
500 nand->ecc.bytes = 3; in fsmc_nand_init()
501 nand->ecc.strength = 1; in fsmc_nand_init()
502 nand->ecc.layout = &fsmc_ecc1_layout; in fsmc_nand_init()
503 nand->ecc.correct = nand_correct_data; in fsmc_nand_init()