Lines Matching refs:ecc
262 res = chip->ecc.read_oob(chip, first_page + page_offset); in nand_block_bad()
433 status = chip->ecc.write_oob_raw(chip, page & chip->pagemask); in nand_do_write_oob()
435 status = chip->ecc.write_oob(chip, page & chip->pagemask); in nand_do_write_oob()
2535 void *ecc, int ecclen, in nand_check_erased_ecc_chunk() argument
2548 ecc_bitflips = nand_check_erased_buf(ecc, ecclen, bitflips_threshold); in nand_check_erased_ecc_chunk()
2563 memset(ecc, 0xff, ecclen); in nand_check_erased_ecc_chunk()
2671 int eccsize = chip->ecc.size; in nand_read_page_raw_syndrome()
2672 int eccbytes = chip->ecc.bytes; in nand_read_page_raw_syndrome()
2680 for (steps = chip->ecc.steps; steps > 0; steps--) { in nand_read_page_raw_syndrome()
2687 if (chip->ecc.prepad) { in nand_read_page_raw_syndrome()
2688 ret = nand_read_data_op(chip, oob, chip->ecc.prepad, in nand_read_page_raw_syndrome()
2693 oob += chip->ecc.prepad; in nand_read_page_raw_syndrome()
2702 if (chip->ecc.postpad) { in nand_read_page_raw_syndrome()
2703 ret = nand_read_data_op(chip, oob, chip->ecc.postpad, in nand_read_page_raw_syndrome()
2708 oob += chip->ecc.postpad; in nand_read_page_raw_syndrome()
2733 int i, eccsize = chip->ecc.size, ret; in nand_read_page_swecc()
2734 int eccbytes = chip->ecc.bytes; in nand_read_page_swecc()
2735 int eccsteps = chip->ecc.steps; in nand_read_page_swecc()
2737 uint8_t *ecc_calc = chip->ecc.calc_buf; in nand_read_page_swecc()
2738 uint8_t *ecc_code = chip->ecc.code_buf; in nand_read_page_swecc()
2741 chip->ecc.read_page_raw(chip, buf, 1, page); in nand_read_page_swecc()
2744 chip->ecc.calculate(chip, p, &ecc_calc[i]); in nand_read_page_swecc()
2747 chip->ecc.total); in nand_read_page_swecc()
2751 eccsteps = chip->ecc.steps; in nand_read_page_swecc()
2757 stat = chip->ecc.correct(chip, p, &ecc_code[i], &ecc_calc[i]); in nand_read_page_swecc()
2790 start_step = data_offs / chip->ecc.size; in nand_read_subpage()
2791 end_step = (data_offs + readlen - 1) / chip->ecc.size; in nand_read_subpage()
2793 index = start_step * chip->ecc.bytes; in nand_read_subpage()
2796 datafrag_len = num_steps * chip->ecc.size; in nand_read_subpage()
2797 eccfrag_len = num_steps * chip->ecc.bytes; in nand_read_subpage()
2799 data_col_addr = start_step * chip->ecc.size; in nand_read_subpage()
2807 for (i = 0; i < eccfrag_len ; i += chip->ecc.bytes, p += chip->ecc.size) in nand_read_subpage()
2808 chip->ecc.calculate(chip, p, &chip->ecc.calc_buf[i]); in nand_read_subpage()
2836 if ((oobregion.offset + (num_steps * chip->ecc.bytes)) & in nand_read_subpage()
2848 ret = mtd_ooblayout_get_eccbytes(mtd, chip->ecc.code_buf, in nand_read_subpage()
2854 for (i = 0; i < eccfrag_len ; i += chip->ecc.bytes, p += chip->ecc.size) { in nand_read_subpage()
2857 stat = chip->ecc.correct(chip, p, &chip->ecc.code_buf[i], in nand_read_subpage()
2858 &chip->ecc.calc_buf[i]); in nand_read_subpage()
2860 (chip->ecc.options & NAND_ECC_GENERIC_ERASED_CHECK)) { in nand_read_subpage()
2862 stat = nand_check_erased_ecc_chunk(p, chip->ecc.size, in nand_read_subpage()
2863 &chip->ecc.code_buf[i], in nand_read_subpage()
2864 chip->ecc.bytes, in nand_read_subpage()
2866 chip->ecc.strength); in nand_read_subpage()
2892 int i, eccsize = chip->ecc.size, ret; in nand_read_page_hwecc()
2893 int eccbytes = chip->ecc.bytes; in nand_read_page_hwecc()
2894 int eccsteps = chip->ecc.steps; in nand_read_page_hwecc()
2896 uint8_t *ecc_calc = chip->ecc.calc_buf; in nand_read_page_hwecc()
2897 uint8_t *ecc_code = chip->ecc.code_buf; in nand_read_page_hwecc()
2905 chip->ecc.hwctl(chip, NAND_ECC_READ); in nand_read_page_hwecc()
2911 chip->ecc.calculate(chip, p, &ecc_calc[i]); in nand_read_page_hwecc()
2920 chip->ecc.total); in nand_read_page_hwecc()
2924 eccsteps = chip->ecc.steps; in nand_read_page_hwecc()
2930 stat = chip->ecc.correct(chip, p, &ecc_code[i], &ecc_calc[i]); in nand_read_page_hwecc()
2932 (chip->ecc.options & NAND_ECC_GENERIC_ERASED_CHECK)) { in nand_read_page_hwecc()
2937 chip->ecc.strength); in nand_read_page_hwecc()
2964 int ret, i, eccsize = chip->ecc.size; in nand_read_page_syndrome()
2965 int eccbytes = chip->ecc.bytes; in nand_read_page_syndrome()
2966 int eccsteps = chip->ecc.steps; in nand_read_page_syndrome()
2967 int eccpadbytes = eccbytes + chip->ecc.prepad + chip->ecc.postpad; in nand_read_page_syndrome()
2979 chip->ecc.hwctl(chip, NAND_ECC_READ); in nand_read_page_syndrome()
2985 if (chip->ecc.prepad) { in nand_read_page_syndrome()
2986 ret = nand_read_data_op(chip, oob, chip->ecc.prepad, in nand_read_page_syndrome()
2991 oob += chip->ecc.prepad; in nand_read_page_syndrome()
2994 chip->ecc.hwctl(chip, NAND_ECC_READSYN); in nand_read_page_syndrome()
3000 stat = chip->ecc.correct(chip, p, oob, NULL); in nand_read_page_syndrome()
3004 if (chip->ecc.postpad) { in nand_read_page_syndrome()
3005 ret = nand_read_data_op(chip, oob, chip->ecc.postpad, in nand_read_page_syndrome()
3010 oob += chip->ecc.postpad; in nand_read_page_syndrome()
3014 (chip->ecc.options & NAND_ECC_GENERIC_ERASED_CHECK)) { in nand_read_page_syndrome()
3016 stat = nand_check_erased_ecc_chunk(p, chip->ecc.size, in nand_read_page_syndrome()
3020 chip->ecc.strength); in nand_read_page_syndrome()
3172 ret = chip->ecc.read_page_raw(chip, bufpoi, in nand_do_read_ops()
3177 ret = chip->ecc.read_subpage(chip, col, bytes, in nand_do_read_ops()
3180 ret = chip->ecc.read_page(chip, bufpoi, in nand_do_read_ops()
3308 int chunk = chip->ecc.bytes + chip->ecc.prepad + chip->ecc.postpad; in nand_read_oob_syndrome()
3309 int eccsize = chip->ecc.size; in nand_read_oob_syndrome()
3313 ret = nand_read_page_op(chip, page, chip->ecc.size, NULL, 0); in nand_read_oob_syndrome()
3317 for (i = 0; i < chip->ecc.steps; i++) { in nand_read_oob_syndrome()
3375 int chunk = chip->ecc.bytes + chip->ecc.prepad + chip->ecc.postpad; in nand_write_oob_syndrome()
3376 int eccsize = chip->ecc.size, length = mtd->oobsize; in nand_write_oob_syndrome()
3377 int ret, i, len, pos, sndcmd = 0, steps = chip->ecc.steps; in nand_write_oob_syndrome()
3385 if (!chip->ecc.prepad && !chip->ecc.postpad) { in nand_write_oob_syndrome()
3475 ret = chip->ecc.read_oob_raw(chip, page); in nand_do_read_oob()
3477 ret = chip->ecc.read_oob(chip, page); in nand_do_read_oob()
3644 int eccsize = chip->ecc.size; in nand_write_page_raw_syndrome()
3645 int eccbytes = chip->ecc.bytes; in nand_write_page_raw_syndrome()
3653 for (steps = chip->ecc.steps; steps > 0; steps--) { in nand_write_page_raw_syndrome()
3660 if (chip->ecc.prepad) { in nand_write_page_raw_syndrome()
3661 ret = nand_write_data_op(chip, oob, chip->ecc.prepad, in nand_write_page_raw_syndrome()
3666 oob += chip->ecc.prepad; in nand_write_page_raw_syndrome()
3675 if (chip->ecc.postpad) { in nand_write_page_raw_syndrome()
3676 ret = nand_write_data_op(chip, oob, chip->ecc.postpad, in nand_write_page_raw_syndrome()
3681 oob += chip->ecc.postpad; in nand_write_page_raw_syndrome()
3705 int i, eccsize = chip->ecc.size, ret; in nand_write_page_swecc()
3706 int eccbytes = chip->ecc.bytes; in nand_write_page_swecc()
3707 int eccsteps = chip->ecc.steps; in nand_write_page_swecc()
3708 uint8_t *ecc_calc = chip->ecc.calc_buf; in nand_write_page_swecc()
3713 chip->ecc.calculate(chip, p, &ecc_calc[i]); in nand_write_page_swecc()
3716 chip->ecc.total); in nand_write_page_swecc()
3720 return chip->ecc.write_page_raw(chip, buf, 1, page); in nand_write_page_swecc()
3734 int i, eccsize = chip->ecc.size, ret; in nand_write_page_hwecc()
3735 int eccbytes = chip->ecc.bytes; in nand_write_page_hwecc()
3736 int eccsteps = chip->ecc.steps; in nand_write_page_hwecc()
3737 uint8_t *ecc_calc = chip->ecc.calc_buf; in nand_write_page_hwecc()
3745 chip->ecc.hwctl(chip, NAND_ECC_WRITE); in nand_write_page_hwecc()
3751 chip->ecc.calculate(chip, p, &ecc_calc[i]); in nand_write_page_hwecc()
3755 chip->ecc.total); in nand_write_page_hwecc()
3782 uint8_t *ecc_calc = chip->ecc.calc_buf; in nand_write_subpage_hwecc()
3783 int ecc_size = chip->ecc.size; in nand_write_subpage_hwecc()
3784 int ecc_bytes = chip->ecc.bytes; in nand_write_subpage_hwecc()
3785 int ecc_steps = chip->ecc.steps; in nand_write_subpage_hwecc()
3797 chip->ecc.hwctl(chip, NAND_ECC_WRITE); in nand_write_subpage_hwecc()
3808 chip->ecc.calculate(chip, buf, ecc_calc); in nand_write_subpage_hwecc()
3822 ecc_calc = chip->ecc.calc_buf; in nand_write_subpage_hwecc()
3824 chip->ecc.total); in nand_write_subpage_hwecc()
3851 int i, eccsize = chip->ecc.size; in nand_write_page_syndrome()
3852 int eccbytes = chip->ecc.bytes; in nand_write_page_syndrome()
3853 int eccsteps = chip->ecc.steps; in nand_write_page_syndrome()
3863 chip->ecc.hwctl(chip, NAND_ECC_WRITE); in nand_write_page_syndrome()
3869 if (chip->ecc.prepad) { in nand_write_page_syndrome()
3870 ret = nand_write_data_op(chip, oob, chip->ecc.prepad, in nand_write_page_syndrome()
3875 oob += chip->ecc.prepad; in nand_write_page_syndrome()
3878 chip->ecc.calculate(chip, p, oob); in nand_write_page_syndrome()
3886 if (chip->ecc.postpad) { in nand_write_page_syndrome()
3887 ret = nand_write_data_op(chip, oob, chip->ecc.postpad, in nand_write_page_syndrome()
3892 oob += chip->ecc.postpad; in nand_write_page_syndrome()
3925 chip->ecc.write_subpage) in nand_write_page()
3931 status = chip->ecc.write_page_raw(chip, buf, oob_required, in nand_write_page()
3934 status = chip->ecc.write_subpage(chip, offset, data_len, buf, in nand_write_page()
3937 status = chip->ecc.write_page(chip, buf, oob_required, page); in nand_write_page()
4960 struct nand_ecc_props *user_conf = &chip->base.ecc.user_conf; in of_get_nand_ecc_legacy_user_config()
5017 nand->ecc.defaults.engine_type = NAND_ECC_ENGINE_TYPE_ON_HOST; in rawnand_dt_init()
5024 if (nand->ecc.user_conf.engine_type != NAND_ECC_ENGINE_TYPE_INVALID) in rawnand_dt_init()
5025 chip->ecc.engine_type = nand->ecc.user_conf.engine_type; in rawnand_dt_init()
5026 if (chip->ecc.engine_type == NAND_ECC_ENGINE_TYPE_INVALID) in rawnand_dt_init()
5027 chip->ecc.engine_type = nand->ecc.defaults.engine_type; in rawnand_dt_init()
5029 chip->ecc.placement = nand->ecc.user_conf.placement; in rawnand_dt_init()
5030 chip->ecc.algo = nand->ecc.user_conf.algo; in rawnand_dt_init()
5031 chip->ecc.strength = nand->ecc.user_conf.strength; in rawnand_dt_init()
5032 chip->ecc.size = nand->ecc.user_conf.step_size; in rawnand_dt_init()
5140 struct nand_ecc_ctrl *ecc = &chip->ecc; in nand_set_ecc_on_host_ops() local
5142 switch (ecc->placement) { in nand_set_ecc_on_host_ops()
5146 if (!ecc->read_page) in nand_set_ecc_on_host_ops()
5147 ecc->read_page = nand_read_page_hwecc; in nand_set_ecc_on_host_ops()
5148 if (!ecc->write_page) in nand_set_ecc_on_host_ops()
5149 ecc->write_page = nand_write_page_hwecc; in nand_set_ecc_on_host_ops()
5150 if (!ecc->read_page_raw) in nand_set_ecc_on_host_ops()
5151 ecc->read_page_raw = nand_read_page_raw; in nand_set_ecc_on_host_ops()
5152 if (!ecc->write_page_raw) in nand_set_ecc_on_host_ops()
5153 ecc->write_page_raw = nand_write_page_raw; in nand_set_ecc_on_host_ops()
5154 if (!ecc->read_oob) in nand_set_ecc_on_host_ops()
5155 ecc->read_oob = nand_read_oob_std; in nand_set_ecc_on_host_ops()
5156 if (!ecc->write_oob) in nand_set_ecc_on_host_ops()
5157 ecc->write_oob = nand_write_oob_std; in nand_set_ecc_on_host_ops()
5158 if (!ecc->read_subpage) in nand_set_ecc_on_host_ops()
5159 ecc->read_subpage = nand_read_subpage; in nand_set_ecc_on_host_ops()
5160 if (!ecc->write_subpage && ecc->hwctl && ecc->calculate) in nand_set_ecc_on_host_ops()
5161 ecc->write_subpage = nand_write_subpage_hwecc; in nand_set_ecc_on_host_ops()
5165 if ((!ecc->calculate || !ecc->correct || !ecc->hwctl) && in nand_set_ecc_on_host_ops()
5166 (!ecc->read_page || in nand_set_ecc_on_host_ops()
5167 ecc->read_page == nand_read_page_hwecc || in nand_set_ecc_on_host_ops()
5168 !ecc->write_page || in nand_set_ecc_on_host_ops()
5169 ecc->write_page == nand_write_page_hwecc)) { in nand_set_ecc_on_host_ops()
5174 if (!ecc->read_page) in nand_set_ecc_on_host_ops()
5175 ecc->read_page = nand_read_page_syndrome; in nand_set_ecc_on_host_ops()
5176 if (!ecc->write_page) in nand_set_ecc_on_host_ops()
5177 ecc->write_page = nand_write_page_syndrome; in nand_set_ecc_on_host_ops()
5178 if (!ecc->read_page_raw) in nand_set_ecc_on_host_ops()
5179 ecc->read_page_raw = nand_read_page_raw_syndrome; in nand_set_ecc_on_host_ops()
5180 if (!ecc->write_page_raw) in nand_set_ecc_on_host_ops()
5181 ecc->write_page_raw = nand_write_page_raw_syndrome; in nand_set_ecc_on_host_ops()
5182 if (!ecc->read_oob) in nand_set_ecc_on_host_ops()
5183 ecc->read_oob = nand_read_oob_syndrome; in nand_set_ecc_on_host_ops()
5184 if (!ecc->write_oob) in nand_set_ecc_on_host_ops()
5185 ecc->write_oob = nand_write_oob_syndrome; in nand_set_ecc_on_host_ops()
5190 ecc->placement); in nand_set_ecc_on_host_ops()
5201 struct nand_ecc_ctrl *ecc = &chip->ecc; in nand_set_ecc_soft_ops() local
5203 if (WARN_ON(ecc->engine_type != NAND_ECC_ENGINE_TYPE_SOFT)) in nand_set_ecc_soft_ops()
5206 switch (ecc->algo) { in nand_set_ecc_soft_ops()
5208 ecc->calculate = nand_calculate_ecc; in nand_set_ecc_soft_ops()
5209 ecc->correct = nand_correct_data; in nand_set_ecc_soft_ops()
5210 ecc->read_page = nand_read_page_swecc; in nand_set_ecc_soft_ops()
5211 ecc->read_subpage = nand_read_subpage; in nand_set_ecc_soft_ops()
5212 ecc->write_page = nand_write_page_swecc; in nand_set_ecc_soft_ops()
5213 if (!ecc->read_page_raw) in nand_set_ecc_soft_ops()
5214 ecc->read_page_raw = nand_read_page_raw; in nand_set_ecc_soft_ops()
5215 if (!ecc->write_page_raw) in nand_set_ecc_soft_ops()
5216 ecc->write_page_raw = nand_write_page_raw; in nand_set_ecc_soft_ops()
5217 ecc->read_oob = nand_read_oob_std; in nand_set_ecc_soft_ops()
5218 ecc->write_oob = nand_write_oob_std; in nand_set_ecc_soft_ops()
5219 if (!ecc->size) in nand_set_ecc_soft_ops()
5220 ecc->size = 256; in nand_set_ecc_soft_ops()
5221 ecc->bytes = 3; in nand_set_ecc_soft_ops()
5222 ecc->strength = 1; in nand_set_ecc_soft_ops()
5225 ecc->options |= NAND_ECC_SOFT_HAMMING_SM_ORDER; in nand_set_ecc_soft_ops()
5233 ecc->calculate = nand_bch_calculate_ecc; in nand_set_ecc_soft_ops()
5234 ecc->correct = nand_bch_correct_data; in nand_set_ecc_soft_ops()
5235 ecc->read_page = nand_read_page_swecc; in nand_set_ecc_soft_ops()
5236 ecc->read_subpage = nand_read_subpage; in nand_set_ecc_soft_ops()
5237 ecc->write_page = nand_write_page_swecc; in nand_set_ecc_soft_ops()
5238 if (!ecc->read_page_raw) in nand_set_ecc_soft_ops()
5239 ecc->read_page_raw = nand_read_page_raw; in nand_set_ecc_soft_ops()
5240 if (!ecc->write_page_raw) in nand_set_ecc_soft_ops()
5241 ecc->write_page_raw = nand_write_page_raw; in nand_set_ecc_soft_ops()
5242 ecc->read_oob = nand_read_oob_std; in nand_set_ecc_soft_ops()
5243 ecc->write_oob = nand_write_oob_std; in nand_set_ecc_soft_ops()
5250 if (!ecc->size && (mtd->oobsize >= 64)) { in nand_set_ecc_soft_ops()
5251 ecc->size = 512; in nand_set_ecc_soft_ops()
5252 ecc->strength = 4; in nand_set_ecc_soft_ops()
5276 nanddev->ecc.user_conf.flags & NAND_ECC_MAXIMIZE_STRENGTH) { in nand_set_ecc_soft_ops()
5280 ecc->size = 1024; in nand_set_ecc_soft_ops()
5281 steps = mtd->writesize / ecc->size; in nand_set_ecc_soft_ops()
5285 ecc->strength = bytes * 8 / fls(8 * ecc->size); in nand_set_ecc_soft_ops()
5289 ecc->bytes = 0; in nand_set_ecc_soft_ops()
5290 ecc->priv = nand_bch_init(mtd); in nand_set_ecc_soft_ops()
5291 if (!ecc->priv) { in nand_set_ecc_soft_ops()
5318 int preset_step = chip->ecc.size; in nand_check_ecc_caps()
5319 int preset_strength = chip->ecc.strength; in nand_check_ecc_caps()
5344 chip->ecc.bytes = ecc_bytes; in nand_check_ecc_caps()
5433 chip->ecc.size = best_step; in nand_match_ecc_req()
5434 chip->ecc.strength = best_strength; in nand_match_ecc_req()
5435 chip->ecc.bytes = best_ecc_bytes; in nand_match_ecc_req()
5466 if (chip->ecc.size && step_size != chip->ecc.size) in nand_maximize_ecc()
5503 chip->ecc.size = best_step; in nand_maximize_ecc()
5504 chip->ecc.strength = best_strength; in nand_maximize_ecc()
5505 chip->ecc.bytes = best_ecc_bytes; in nand_maximize_ecc()
5537 if (chip->ecc.size && chip->ecc.strength) in nand_ecc_choose_conf()
5540 if (nanddev->ecc.user_conf.flags & NAND_ECC_MAXIMIZE_STRENGTH) in nand_ecc_choose_conf()
5605 struct nand_ecc_ctrl *ecc = &chip->ecc; in nand_scan_tail() local
5637 !(ecc->engine_type == NAND_ECC_ENGINE_TYPE_SOFT && in nand_scan_tail()
5638 ecc->algo == NAND_ECC_ALGO_BCH)) { in nand_scan_tail()
5657 if (ecc->engine_type == NAND_ECC_ENGINE_TYPE_NONE) { in nand_scan_tail()
5675 switch (ecc->engine_type) { in nand_scan_tail()
5681 if (mtd->writesize >= ecc->size) { in nand_scan_tail()
5682 if (!ecc->strength) { in nand_scan_tail()
5690 ecc->size, mtd->writesize); in nand_scan_tail()
5691 ecc->engine_type = NAND_ECC_ENGINE_TYPE_SOFT; in nand_scan_tail()
5692 ecc->algo = NAND_ECC_ALGO_HAMMING; in nand_scan_tail()
5702 if (!ecc->read_page || !ecc->write_page) { in nand_scan_tail()
5707 if (!ecc->read_oob) in nand_scan_tail()
5708 ecc->read_oob = nand_read_oob_std; in nand_scan_tail()
5709 if (!ecc->write_oob) in nand_scan_tail()
5710 ecc->write_oob = nand_write_oob_std; in nand_scan_tail()
5715 ecc->read_page = nand_read_page_raw; in nand_scan_tail()
5716 ecc->write_page = nand_write_page_raw; in nand_scan_tail()
5717 ecc->read_oob = nand_read_oob_std; in nand_scan_tail()
5718 ecc->read_page_raw = nand_read_page_raw; in nand_scan_tail()
5719 ecc->write_page_raw = nand_write_page_raw; in nand_scan_tail()
5720 ecc->write_oob = nand_write_oob_std; in nand_scan_tail()
5721 ecc->size = mtd->writesize; in nand_scan_tail()
5722 ecc->bytes = 0; in nand_scan_tail()
5723 ecc->strength = 0; in nand_scan_tail()
5727 WARN(1, "Invalid NAND_ECC_MODE %d\n", ecc->engine_type); in nand_scan_tail()
5732 if (ecc->correct || ecc->calculate) { in nand_scan_tail()
5733 ecc->calc_buf = kmalloc(mtd->oobsize, GFP_KERNEL); in nand_scan_tail()
5734 ecc->code_buf = kmalloc(mtd->oobsize, GFP_KERNEL); in nand_scan_tail()
5735 if (!ecc->calc_buf || !ecc->code_buf) { in nand_scan_tail()
5742 if (!ecc->read_oob_raw) in nand_scan_tail()
5743 ecc->read_oob_raw = ecc->read_oob; in nand_scan_tail()
5744 if (!ecc->write_oob_raw) in nand_scan_tail()
5745 ecc->write_oob_raw = ecc->write_oob; in nand_scan_tail()
5748 mtd->ecc_strength = ecc->strength; in nand_scan_tail()
5749 mtd->ecc_step_size = ecc->size; in nand_scan_tail()
5755 ecc->steps = mtd->writesize / ecc->size; in nand_scan_tail()
5756 if (ecc->steps * ecc->size != mtd->writesize) { in nand_scan_tail()
5762 ecc->total = ecc->steps * ecc->bytes; in nand_scan_tail()
5763 chip->base.ecc.ctx.total = ecc->total; in nand_scan_tail()
5765 if (ecc->total > mtd->oobsize) { in nand_scan_tail()
5784 mtd->name, chip->ecc.strength, chip->ecc.size, in nand_scan_tail()
5790 switch (ecc->steps) { in nand_scan_tail()
5807 switch (ecc->engine_type) { in nand_scan_tail()
5885 kfree(ecc->code_buf); in nand_scan_tail()
5886 kfree(ecc->calc_buf); in nand_scan_tail()
5952 if (chip->ecc.engine_type == NAND_ECC_ENGINE_TYPE_SOFT && in nand_cleanup()
5953 chip->ecc.algo == NAND_ECC_ALGO_BCH) in nand_cleanup()
5954 nand_bch_free((struct nand_bch_control *)chip->ecc.priv); in nand_cleanup()
5961 kfree(chip->ecc.code_buf); in nand_cleanup()
5962 kfree(chip->ecc.calc_buf); in nand_cleanup()