Lines Matching refs:ecc
887 if (info->nand.ecc.engine_type == NAND_ECC_ENGINE_TYPE_ON_HOST && in omap_correct_data()
888 info->nand.ecc.size == 2048) in omap_correct_data()
956 val = ((((info->nand.ecc.size >> 1) - 1) << ECCSIZE1_SHIFT) | in omap_enable_hwecc()
1055 nsectors = chip->ecc.steps; in omap_enable_hwecc_bch()
1075 nsectors = chip->ecc.steps; in omap_enable_hwecc_bch()
1088 nsectors = chip->ecc.steps; in omap_enable_hwecc_bch()
1144 int eccbytes = info->nand.ecc.bytes; in _omap_calculate_ecc_bch()
1286 int eccbytes = info->nand.ecc.bytes; in omap_calculate_ecc_bch_multi()
1317 for (i = 0; i < info->nand.ecc.size; i++) { in erased_sector_bitflips()
1319 if (flip_bits > info->nand.ecc.strength) in erased_sector_bitflips()
1323 for (i = 0; i < info->nand.ecc.bytes - 1; i++) { in erased_sector_bitflips()
1325 if (flip_bits > info->nand.ecc.strength) in erased_sector_bitflips()
1334 memset(data, 0xFF, info->nand.ecc.size); in erased_sector_bitflips()
1335 memset(oob, 0xFF, info->nand.ecc.bytes); in erased_sector_bitflips()
1356 struct nand_ecc_ctrl *ecc = &info->nand.ecc; in omap_elm_correct_data() local
1357 int eccsteps = info->nand.ecc.steps; in omap_elm_correct_data()
1373 actual_eccbytes = ecc->bytes - 1; in omap_elm_correct_data()
1378 actual_eccbytes = ecc->bytes - 1; in omap_elm_correct_data()
1382 actual_eccbytes = ecc->bytes; in omap_elm_correct_data()
1415 buf = &data[info->nand.ecc.size * i]; in omap_elm_correct_data()
1443 calc_ecc += ecc->bytes; in omap_elm_correct_data()
1444 read_ecc += ecc->bytes; in omap_elm_correct_data()
1475 error_max = (ecc->size + actual_eccbytes) * 8; in omap_elm_correct_data()
1507 data += ecc->size; in omap_elm_correct_data()
1508 spare_ecc += ecc->bytes; in omap_elm_correct_data()
1528 uint8_t *ecc_calc = chip->ecc.calc_buf; in omap_write_page_bch()
1533 chip->ecc.hwctl(chip, NAND_ECC_WRITE); in omap_write_page_bch()
1542 chip->ecc.total); in omap_write_page_bch()
1568 u8 *ecc_calc = chip->ecc.calc_buf; in omap_write_subpage_bch()
1569 int ecc_size = chip->ecc.size; in omap_write_subpage_bch()
1570 int ecc_bytes = chip->ecc.bytes; in omap_write_subpage_bch()
1571 int ecc_steps = chip->ecc.steps; in omap_write_subpage_bch()
1585 chip->ecc.hwctl(chip, NAND_ECC_WRITE); in omap_write_subpage_bch()
1606 ecc_calc = chip->ecc.calc_buf; in omap_write_subpage_bch()
1608 chip->ecc.total); in omap_write_subpage_bch()
1636 uint8_t *ecc_calc = chip->ecc.calc_buf; in omap_read_page_bch()
1637 uint8_t *ecc_code = chip->ecc.code_buf; in omap_read_page_bch()
1644 chip->ecc.hwctl(chip, NAND_ECC_READ); in omap_read_page_bch()
1653 chip->ecc.total, false); in omap_read_page_bch()
1659 chip->ecc.total); in omap_read_page_bch()
1663 stat = chip->ecc.correct(chip, buf, ecc_code, ecc_calc); in omap_read_page_bch()
1831 oobregion->length = chip->ecc.total; in omap_ooblayout_ecc()
1850 off += chip->ecc.total; in omap_ooblayout_free()
1861 .ecc = omap_ooblayout_ecc,
1871 if (section >= chip->ecc.steps) in omap_sw_ooblayout_ecc()
1878 oobregion->offset = off + (section * (chip->ecc.bytes + 1)); in omap_sw_ooblayout_ecc()
1879 oobregion->length = chip->ecc.bytes; in omap_sw_ooblayout_ecc()
1897 off += ((chip->ecc.bytes + 1) * chip->ecc.steps); in omap_sw_ooblayout_free()
1908 .ecc = omap_sw_ooblayout_ecc,
2013 chip->ecc.engine_type = NAND_ECC_ENGINE_TYPE_SOFT; in omap_nand_attach_chip()
2014 chip->ecc.algo = NAND_ECC_ALGO_HAMMING; in omap_nand_attach_chip()
2022 chip->ecc.engine_type = NAND_ECC_ENGINE_TYPE_ON_HOST; in omap_nand_attach_chip()
2023 chip->ecc.bytes = 3; in omap_nand_attach_chip()
2024 chip->ecc.size = 512; in omap_nand_attach_chip()
2025 chip->ecc.strength = 1; in omap_nand_attach_chip()
2026 chip->ecc.calculate = omap_calculate_ecc; in omap_nand_attach_chip()
2027 chip->ecc.hwctl = omap_enable_hwecc; in omap_nand_attach_chip()
2028 chip->ecc.correct = omap_correct_data; in omap_nand_attach_chip()
2030 oobbytes_per_step = chip->ecc.bytes; in omap_nand_attach_chip()
2039 chip->ecc.engine_type = NAND_ECC_ENGINE_TYPE_ON_HOST; in omap_nand_attach_chip()
2040 chip->ecc.size = 512; in omap_nand_attach_chip()
2041 chip->ecc.bytes = 7; in omap_nand_attach_chip()
2042 chip->ecc.strength = 4; in omap_nand_attach_chip()
2043 chip->ecc.hwctl = omap_enable_hwecc_bch; in omap_nand_attach_chip()
2044 chip->ecc.correct = nand_bch_correct_data; in omap_nand_attach_chip()
2045 chip->ecc.calculate = omap_calculate_ecc_bch_sw; in omap_nand_attach_chip()
2048 oobbytes_per_step = chip->ecc.bytes + 1; in omap_nand_attach_chip()
2050 chip->ecc.priv = nand_bch_init(mtd); in omap_nand_attach_chip()
2051 if (!chip->ecc.priv) { in omap_nand_attach_chip()
2059 chip->ecc.engine_type = NAND_ECC_ENGINE_TYPE_ON_HOST; in omap_nand_attach_chip()
2060 chip->ecc.size = 512; in omap_nand_attach_chip()
2062 chip->ecc.bytes = 7 + 1; in omap_nand_attach_chip()
2063 chip->ecc.strength = 4; in omap_nand_attach_chip()
2064 chip->ecc.hwctl = omap_enable_hwecc_bch; in omap_nand_attach_chip()
2065 chip->ecc.correct = omap_elm_correct_data; in omap_nand_attach_chip()
2066 chip->ecc.read_page = omap_read_page_bch; in omap_nand_attach_chip()
2067 chip->ecc.write_page = omap_write_page_bch; in omap_nand_attach_chip()
2068 chip->ecc.write_subpage = omap_write_subpage_bch; in omap_nand_attach_chip()
2070 oobbytes_per_step = chip->ecc.bytes; in omap_nand_attach_chip()
2073 mtd->writesize / chip->ecc.size, in omap_nand_attach_chip()
2074 chip->ecc.size, chip->ecc.bytes); in omap_nand_attach_chip()
2081 chip->ecc.engine_type = NAND_ECC_ENGINE_TYPE_ON_HOST; in omap_nand_attach_chip()
2082 chip->ecc.size = 512; in omap_nand_attach_chip()
2083 chip->ecc.bytes = 13; in omap_nand_attach_chip()
2084 chip->ecc.strength = 8; in omap_nand_attach_chip()
2085 chip->ecc.hwctl = omap_enable_hwecc_bch; in omap_nand_attach_chip()
2086 chip->ecc.correct = nand_bch_correct_data; in omap_nand_attach_chip()
2087 chip->ecc.calculate = omap_calculate_ecc_bch_sw; in omap_nand_attach_chip()
2090 oobbytes_per_step = chip->ecc.bytes + 1; in omap_nand_attach_chip()
2092 chip->ecc.priv = nand_bch_init(mtd); in omap_nand_attach_chip()
2093 if (!chip->ecc.priv) { in omap_nand_attach_chip()
2101 chip->ecc.engine_type = NAND_ECC_ENGINE_TYPE_ON_HOST; in omap_nand_attach_chip()
2102 chip->ecc.size = 512; in omap_nand_attach_chip()
2104 chip->ecc.bytes = 13 + 1; in omap_nand_attach_chip()
2105 chip->ecc.strength = 8; in omap_nand_attach_chip()
2106 chip->ecc.hwctl = omap_enable_hwecc_bch; in omap_nand_attach_chip()
2107 chip->ecc.correct = omap_elm_correct_data; in omap_nand_attach_chip()
2108 chip->ecc.read_page = omap_read_page_bch; in omap_nand_attach_chip()
2109 chip->ecc.write_page = omap_write_page_bch; in omap_nand_attach_chip()
2110 chip->ecc.write_subpage = omap_write_subpage_bch; in omap_nand_attach_chip()
2112 oobbytes_per_step = chip->ecc.bytes; in omap_nand_attach_chip()
2115 mtd->writesize / chip->ecc.size, in omap_nand_attach_chip()
2116 chip->ecc.size, chip->ecc.bytes); in omap_nand_attach_chip()
2124 chip->ecc.engine_type = NAND_ECC_ENGINE_TYPE_ON_HOST; in omap_nand_attach_chip()
2125 chip->ecc.size = 512; in omap_nand_attach_chip()
2126 chip->ecc.bytes = 26; in omap_nand_attach_chip()
2127 chip->ecc.strength = 16; in omap_nand_attach_chip()
2128 chip->ecc.hwctl = omap_enable_hwecc_bch; in omap_nand_attach_chip()
2129 chip->ecc.correct = omap_elm_correct_data; in omap_nand_attach_chip()
2130 chip->ecc.read_page = omap_read_page_bch; in omap_nand_attach_chip()
2131 chip->ecc.write_page = omap_write_page_bch; in omap_nand_attach_chip()
2132 chip->ecc.write_subpage = omap_write_subpage_bch; in omap_nand_attach_chip()
2134 oobbytes_per_step = chip->ecc.bytes; in omap_nand_attach_chip()
2137 mtd->writesize / chip->ecc.size, in omap_nand_attach_chip()
2138 chip->ecc.size, chip->ecc.bytes); in omap_nand_attach_chip()
2150 (mtd->writesize / chip->ecc.size)); in omap_nand_attach_chip()
2198 nand_chip->ecc.priv = NULL; in omap_nand_probe()
2274 if (nand_chip->ecc.priv) { in omap_nand_probe()
2275 nand_bch_free(nand_chip->ecc.priv); in omap_nand_probe()
2276 nand_chip->ecc.priv = NULL; in omap_nand_probe()
2288 if (nand_chip->ecc.priv) { in omap_nand_remove()
2289 nand_bch_free(nand_chip->ecc.priv); in omap_nand_remove()
2290 nand_chip->ecc.priv = NULL; in omap_nand_remove()