Lines Matching refs:ecc
121 oob_region->length = chip->ecc.total; in ma35_ooblayout_ecc()
135 oob_region->length = mtd->oobsize - chip->ecc.total - 2; in ma35_ooblayout_free()
143 .ecc = ma35_ooblayout_ecc,
253 if (chip->ecc.strength != 0) { in ma35_nand_hwecc_init()
254 chip->ecc.steps = mtd->writesize / chip->ecc.size; in ma35_nand_hwecc_init()
255 nvtnand->eccstatus = (chip->ecc.steps < 4) ? 1 : chip->ecc.steps / 4; in ma35_nand_hwecc_init()
258 switch (chip->ecc.strength) { in ma35_nand_hwecc_init()
260 chip->ecc.total = chip->ecc.steps * MA35_PARITY_BCH8; in ma35_nand_hwecc_init()
264 chip->ecc.total = chip->ecc.steps * MA35_PARITY_BCH12; in ma35_nand_hwecc_init()
268 chip->ecc.total = chip->ecc.steps * MA35_PARITY_BCH24; in ma35_nand_hwecc_init()
276 chip->ecc.bytes = chip->ecc.total / chip->ecc.steps; in ma35_nand_hwecc_init()
294 if (chip->ecc.strength <= 8) { in ma35_nfi_correct()
297 } else if (chip->ecc.strength <= 12) { in ma35_nfi_correct()
300 } else if (chip->ecc.strength <= 24) { in ma35_nfi_correct()
341 addr += index * chip->ecc.size; in ma35_nfi_correct()
347 if (corrected_index < chip->ecc.size) { in ma35_nfi_correct()
350 } else if (corrected_index < (chip->ecc.size + 3)) { in ma35_nfi_correct()
352 corrected_index -= chip->ecc.size; in ma35_nfi_correct()
368 corrected_index -= (chip->ecc.size + padding_len - parity_len); in ma35_nfi_correct()
376 (parity_len * chip->ecc.steps) + in ma35_nfi_correct()
532 u32 page_off = round_down(offset, chip->ecc.size); in ma35_nand_format_subpage()
533 u32 end = DIV_ROUND_UP(page_off + len, chip->ecc.size); in ma35_nand_format_subpage()
534 u32 start = page_off / chip->ecc.size; in ma35_nand_format_subpage()
541 memcpy(nand->buffer + i * chip->ecc.size, in ma35_nand_format_subpage()
542 buf + i * chip->ecc.size, chip->ecc.size); in ma35_nand_format_subpage()
566 ma35_write_spare(chip, mtd->oobsize - chip->ecc.total, in ma35_nand_write_subpage_hwecc()
574 oobpoi = mtd->oobsize - chip->ecc.total; in ma35_nand_write_subpage_hwecc()
576 for (i = 0; i < chip->ecc.steps; i++) { in ma35_nand_write_subpage_hwecc()
577 index = i * chip->ecc.bytes; in ma35_nand_write_subpage_hwecc()
579 ma35_read_spare(chip, chip->ecc.bytes, in ma35_nand_write_subpage_hwecc()
607 ma35_write_spare(chip, mtd->oobsize - chip->ecc.total, in ma35_nand_write_page_hwecc()
614 ma35_read_spare(chip, chip->ecc.total, in ma35_nand_write_page_hwecc()
615 (u32 *)(chip->oob_poi + (mtd->oobsize - chip->ecc.total)), in ma35_nand_write_page_hwecc()
616 mtd->oobsize - chip->ecc.total); in ma35_nand_write_page_hwecc()
763 switch (chip->ecc.engine_type) { in ma35_nand_attach_chip()
769 chip->ecc.write_subpage = ma35_nand_write_subpage_hwecc; in ma35_nand_attach_chip()
770 chip->ecc.write_page = ma35_nand_write_page_hwecc; in ma35_nand_attach_chip()
771 chip->ecc.read_subpage = ma35_nand_read_subpage_hwecc; in ma35_nand_attach_chip()
772 chip->ecc.read_page = ma35_nand_read_page_hwecc; in ma35_nand_attach_chip()
773 chip->ecc.read_oob = ma35_nand_read_oob_hwecc; in ma35_nand_attach_chip()