Lines Matching refs:ecc
735 static bool qcom_nandc_is_last_cw(struct nand_ecc_ctrl *ecc, int cw) in qcom_nandc_is_last_cw() argument
737 return cw == (ecc->steps - 1); in qcom_nandc_is_last_cw()
745 struct nand_ecc_ctrl *ecc = &chip->ecc; in nandc_set_read_loc() local
748 if (nandc->props->qpic_v2 && qcom_nandc_is_last_cw(ecc, cw)) in nandc_set_read_loc()
753 if (nandc->props->qpic_v2 && qcom_nandc_is_last_cw(ecc, cw)) in nandc_set_read_loc()
1210 struct nand_ecc_ctrl *ecc = &chip->ecc; in config_nand_cw_read() local
1214 if (nandc->props->qpic_v2 && qcom_nandc_is_last_cw(ecc, cw)) in config_nand_cw_read()
1533 struct nand_ecc_ctrl *ecc = &chip->ecc; in parse_erase_write_errors() local
1537 num_cw = command == NAND_CMD_PAGEPROG ? ecc->steps : 1; in parse_erase_write_errors()
1583 struct nand_ecc_ctrl *ecc = &chip->ecc; in qcom_nandc_command() local
1618 update_rw_regs(host, ecc->steps, true, 0); in qcom_nandc_command()
1733 struct nand_ecc_ctrl *ecc = &chip->ecc; in qcom_nandc_read_cw_raw() local
1742 raw_cw = ecc->steps - 1; in qcom_nandc_read_cw_raw()
1749 data_size1 = mtd->writesize - host->cw_size * (ecc->steps - 1); in qcom_nandc_read_cw_raw()
1752 if (qcom_nandc_is_last_cw(ecc, cw) && !host->codeword_fixup) { in qcom_nandc_read_cw_raw()
1753 data_size2 = ecc->size - data_size1 - in qcom_nandc_read_cw_raw()
1754 ((ecc->steps - 1) * 4); in qcom_nandc_read_cw_raw()
1755 oob_size2 = (ecc->steps * 4) + host->ecc_bytes_hw + in qcom_nandc_read_cw_raw()
1820 struct nand_ecc_ctrl *ecc = &chip->ecc; in check_for_erased_page() local
1832 for_each_set_bit(cw, &uncorrectable_cws, ecc->steps) { in check_for_erased_page()
1833 if (qcom_nandc_is_last_cw(ecc, cw) && !host->codeword_fixup) { in check_for_erased_page()
1834 data_size = ecc->size - ((ecc->steps - 1) * 4); in check_for_erased_page()
1835 oob_size = (ecc->steps * 4) + host->ecc_bytes_hw; in check_for_erased_page()
1843 cw_oob_buf = oob_buf + (cw * ecc->bytes); in check_for_erased_page()
1857 0, ecc->strength); in check_for_erased_page()
1879 struct nand_ecc_ctrl *ecc = &chip->ecc; in parse_read_errors() local
1889 for (i = 0; i < ecc->steps; i++, buf++) { in parse_read_errors()
1893 if (qcom_nandc_is_last_cw(ecc, i)) { in parse_read_errors()
1894 data_len = ecc->size - ((ecc->steps - 1) << 2); in parse_read_errors()
1895 oob_len = ecc->steps << 2; in parse_read_errors()
1958 oob_buf += oob_len + ecc->bytes; in parse_read_errors()
1981 struct nand_ecc_ctrl *ecc = &chip->ecc; in read_page_ecc() local
1988 for (i = 0; i < ecc->steps; i++) { in read_page_ecc()
1991 if (qcom_nandc_is_last_cw(ecc, i) && !host->codeword_fixup) { in read_page_ecc()
1992 data_size = ecc->size - ((ecc->steps - 1) << 2); in read_page_ecc()
1993 oob_size = (ecc->steps << 2) + host->ecc_bytes_hw + in read_page_ecc()
2061 struct nand_ecc_ctrl *ecc = &chip->ecc; in copy_last_cw() local
2072 set_address(host, host->cw_size * (ecc->steps - 1), page); in copy_last_cw()
2073 update_rw_regs(host, 1, true, ecc->steps - 1); in copy_last_cw()
2075 config_nand_single_cw_page_read(chip, host->use_ecc, ecc->steps - 1); in copy_last_cw()
2177 struct nand_ecc_ctrl *ecc = &chip->ecc; in qcom_nandc_read_page_raw() local
2184 for (cw = 0; cw < ecc->steps; cw++) { in qcom_nandc_read_page_raw()
2191 oob_buf += ecc->bytes; in qcom_nandc_read_page_raw()
2202 struct nand_ecc_ctrl *ecc = &chip->ecc; in qcom_nandc_read_oob() local
2212 update_rw_regs(host, ecc->steps, true, 0); in qcom_nandc_read_oob()
2223 struct nand_ecc_ctrl *ecc = &chip->ecc; in qcom_nandc_write_page() local
2239 update_rw_regs(host, ecc->steps, false, 0); in qcom_nandc_write_page()
2242 for (i = 0; i < ecc->steps; i++) { in qcom_nandc_write_page()
2245 if (qcom_nandc_is_last_cw(ecc, i) && !host->codeword_fixup) { in qcom_nandc_write_page()
2246 data_size = ecc->size - ((ecc->steps - 1) << 2); in qcom_nandc_write_page()
2247 oob_size = (ecc->steps << 2) + host->ecc_bytes_hw + in qcom_nandc_write_page()
2251 oob_size = ecc->bytes; in qcom_nandc_write_page()
2256 i == (ecc->steps - 1) ? NAND_BAM_NO_EOT : 0); in qcom_nandc_write_page()
2265 if (qcom_nandc_is_last_cw(ecc, i)) { in qcom_nandc_write_page()
2298 struct nand_ecc_ctrl *ecc = &chip->ecc; in qcom_nandc_write_page_raw() local
2313 update_rw_regs(host, ecc->steps, false, 0); in qcom_nandc_write_page_raw()
2316 for (i = 0; i < ecc->steps; i++) { in qcom_nandc_write_page_raw()
2320 data_size1 = mtd->writesize - host->cw_size * (ecc->steps - 1); in qcom_nandc_write_page_raw()
2323 if (qcom_nandc_is_last_cw(ecc, i) && !host->codeword_fixup) { in qcom_nandc_write_page_raw()
2324 data_size2 = ecc->size - data_size1 - in qcom_nandc_write_page_raw()
2325 ((ecc->steps - 1) << 2); in qcom_nandc_write_page_raw()
2326 oob_size2 = (ecc->steps << 2) + host->ecc_bytes_hw + in qcom_nandc_write_page_raw()
2378 struct nand_ecc_ctrl *ecc = &chip->ecc; in qcom_nandc_write_oob() local
2390 data_size = ecc->size - ((ecc->steps - 1) << 2); in qcom_nandc_write_oob()
2398 set_address(host, host->cw_size * (ecc->steps - 1), page); in qcom_nandc_write_oob()
2423 struct nand_ecc_ctrl *ecc = &chip->ecc; in qcom_nandc_block_bad() local
2446 bbpos = mtd->writesize - host->cw_size * (ecc->steps - 1); in qcom_nandc_block_bad()
2460 struct nand_ecc_ctrl *ecc = &chip->ecc; in qcom_nandc_block_markbad() local
2477 set_address(host, host->cw_size * (ecc->steps - 1), page); in qcom_nandc_block_markbad()
2478 update_rw_regs(host, 1, false, ecc->steps - 1); in qcom_nandc_block_markbad()
2645 struct nand_ecc_ctrl *ecc = &chip->ecc; in qcom_nand_ooblayout_ecc() local
2651 oobregion->length = (ecc->bytes * (ecc->steps - 1)) + in qcom_nand_ooblayout_ecc()
2667 struct nand_ecc_ctrl *ecc = &chip->ecc; in qcom_nand_ooblayout_free() local
2672 oobregion->length = ecc->steps * 4; in qcom_nand_ooblayout_free()
2673 oobregion->offset = ((ecc->steps - 1) * ecc->bytes) + host->bbm_size; in qcom_nand_ooblayout_free()
2679 .ecc = qcom_nand_ooblayout_ecc,
2695 struct nand_ecc_ctrl *ecc = &chip->ecc; in qcom_nand_attach_chip() local
2702 ecc->size = NANDC_STEP_SIZE; in qcom_nand_attach_chip()
2717 if (ecc->strength >= 8) { in qcom_nand_attach_chip()
2771 ecc->bytes = host->ecc_bytes_hw + host->spare_bytes + host->bbm_size; in qcom_nand_attach_chip()
2773 ecc->read_page = qcom_nandc_read_page; in qcom_nand_attach_chip()
2774 ecc->read_page_raw = qcom_nandc_read_page_raw; in qcom_nand_attach_chip()
2775 ecc->read_oob = qcom_nandc_read_oob; in qcom_nand_attach_chip()
2776 ecc->write_page = qcom_nandc_write_page; in qcom_nand_attach_chip()
2777 ecc->write_page_raw = qcom_nandc_write_page_raw; in qcom_nand_attach_chip()
2778 ecc->write_oob = qcom_nandc_write_oob; in qcom_nand_attach_chip()
2780 ecc->engine_type = NAND_ECC_ENGINE_TYPE_ON_HOST; in qcom_nand_attach_chip()
2811 host->cw_size = host->cw_data + ecc->bytes; in qcom_nand_attach_chip()
2864 host->cw_size, host->cw_data, ecc->strength, ecc->bytes, in qcom_nand_attach_chip()