Lines Matching refs:ecc

495  *				of a page, consisting of all data, ecc, spare
506 * ecc/non-ecc mode for the current nand flash
550 * @ecc_modes - ecc mode for NAND
765 static bool qcom_nandc_is_last_cw(struct nand_ecc_ctrl *ecc, int cw)
767 return cw == (ecc->steps - 1);
775 struct nand_ecc_ctrl *ecc = &chip->ecc;
778 if (nandc->props->qpic_v2 && qcom_nandc_is_last_cw(ecc, cw))
783 if (nandc->props->qpic_v2 && qcom_nandc_is_last_cw(ecc, cw))
1240 struct nand_ecc_ctrl *ecc = &chip->ecc;
1244 if (nandc->props->qpic_v2 && qcom_nandc_is_last_cw(ecc, cw))
1468 struct nand_ecc_ctrl *ecc = &chip->ecc;
1480 raw_cw = ecc->steps - 1;
1487 data_size1 = mtd->writesize - host->cw_size * (ecc->steps - 1);
1490 if (qcom_nandc_is_last_cw(ecc, cw) && !host->codeword_fixup) {
1491 data_size2 = ecc->size - data_size1 -
1492 ((ecc->steps - 1) * 4);
1493 oob_size2 = (ecc->steps * 4) + host->ecc_bytes_hw +
1539 * equal to the ecc->strength for each CW.
1557 struct nand_ecc_ctrl *ecc = &chip->ecc;
1569 for_each_set_bit(cw, &uncorrectable_cws, ecc->steps) {
1570 if (qcom_nandc_is_last_cw(ecc, cw) && !host->codeword_fixup) {
1571 data_size = ecc->size - ((ecc->steps - 1) * 4);
1572 oob_size = (ecc->steps * 4) + host->ecc_bytes_hw;
1580 cw_oob_buf = oob_buf + (cw * ecc->bytes);
1594 0, ecc->strength);
1608 * errors. this is equivalent to what 'ecc->correct()' would do.
1616 struct nand_ecc_ctrl *ecc = &chip->ecc;
1626 for (i = 0; i < ecc->steps; i++, buf++) {
1630 if (qcom_nandc_is_last_cw(ecc, i)) {
1631 data_len = ecc->size - ((ecc->steps - 1) << 2);
1632 oob_len = ecc->steps << 2;
1695 oob_buf += oob_len + ecc->bytes;
1710 * helper to perform the actual page read operation, used by ecc->read_page(),
1711 * ecc->read_oob()
1718 struct nand_ecc_ctrl *ecc = &chip->ecc;
1725 for (i = 0; i < ecc->steps; i++) {
1728 if (qcom_nandc_is_last_cw(ecc, i) && !host->codeword_fixup) {
1729 data_size = ecc->size - ((ecc->steps - 1) << 2);
1730 oob_size = (ecc->steps << 2) + host->ecc_bytes_hw +
1757 * when ecc is enabled, the controller doesn't read the real
1796 struct nand_ecc_ctrl *ecc = &chip->ecc;
1807 set_address(host, host->cw_size * (ecc->steps - 1), page);
1808 update_rw_regs(host, 1, true, ecc->steps - 1);
1810 config_nand_single_cw_page_read(chip, host->use_ecc, ecc->steps - 1);
1884 /* implements ecc->read_page() */
1890 struct nand_ecc_ctrl *ecc = &chip->ecc;
1902 update_rw_regs(host, ecc->steps, true, 0);
1912 /* implements ecc->read_page_raw() */
1918 struct nand_ecc_ctrl *ecc = &chip->ecc;
1925 for (cw = 0; cw < ecc->steps; cw++) {
1932 oob_buf += ecc->bytes;
1938 /* implements ecc->read_oob() */
1943 struct nand_ecc_ctrl *ecc = &chip->ecc;
1953 update_rw_regs(host, ecc->steps, true, 0);
1958 /* implements ecc->write_page() */
1964 struct nand_ecc_ctrl *ecc = &chip->ecc;
1983 update_rw_regs(host, ecc->steps, false, 0);
1986 for (i = 0; i < ecc->steps; i++) {
1989 if (qcom_nandc_is_last_cw(ecc, i) && !host->codeword_fixup) {
1990 data_size = ecc->size - ((ecc->steps - 1) << 2);
1991 oob_size = (ecc->steps << 2) + host->ecc_bytes_hw +
1995 oob_size = ecc->bytes;
1999 i == (ecc->steps - 1) ? NAND_BAM_NO_EOT : 0);
2008 if (qcom_nandc_is_last_cw(ecc, i)) {
2030 /* implements ecc->write_page_raw() */
2038 struct nand_ecc_ctrl *ecc = &chip->ecc;
2053 update_rw_regs(host, ecc->steps, false, 0);
2056 for (i = 0; i < ecc->steps; i++) {
2060 data_size1 = mtd->writesize - host->cw_size * (ecc->steps - 1);
2063 if (qcom_nandc_is_last_cw(ecc, i) && !host->codeword_fixup) {
2064 data_size2 = ecc->size - data_size1 -
2065 ((ecc->steps - 1) << 2);
2066 oob_size2 = (ecc->steps << 2) + host->ecc_bytes_hw +
2104 * implements ecc->write_oob()
2115 struct nand_ecc_ctrl *ecc = &chip->ecc;
2127 data_size = ecc->size - ((ecc->steps - 1) << 2);
2135 set_address(host, host->cw_size * (ecc->steps - 1), page);
2157 struct nand_ecc_ctrl *ecc = &chip->ecc;
2164 * the beginning of the last codeword, we don't care about reading ecc
2180 bbpos = mtd->writesize - host->cw_size * (ecc->steps - 1);
2194 struct nand_ecc_ctrl *ecc = &chip->ecc;
2211 set_address(host, host->cw_size * (ecc->steps - 1), page);
2212 update_rw_regs(host, 1, false, ecc->steps - 1);
2310 * dummy/real bad block bytes are grouped as ecc bytes (i.e, ecc->bytes is
2318 struct nand_ecc_ctrl *ecc = &chip->ecc;
2324 oobregion->length = (ecc->bytes * (ecc->steps - 1)) +
2340 struct nand_ecc_ctrl *ecc = &chip->ecc;
2345 oobregion->length = ecc->steps * 4;
2346 oobregion->offset = ((ecc->steps - 1) * ecc->bytes) + host->bbm_size;
2352 .ecc = qcom_nand_ooblayout_ecc,
2369 struct nand_ecc_ctrl *ecc = &chip->ecc;
2376 ecc->size = NANDC_STEP_SIZE;
2391 if (ecc->strength >= 8) {
2440 * we consider ecc->bytes as the sum of all the non-data content in a
2445 ecc->bytes = host->ecc_bytes_hw + host->spare_bytes + host->bbm_size;
2447 ecc->read_page = qcom_nandc_read_page;
2448 ecc->read_page_raw = qcom_nandc_read_page_raw;
2449 ecc->read_oob = qcom_nandc_read_oob;
2450 ecc->write_page = qcom_nandc_write_page;
2451 ecc->write_page_raw = qcom_nandc_write_page_raw;
2452 ecc->write_oob = qcom_nandc_write_oob;
2454 ecc->engine_type = NAND_ECC_ENGINE_TYPE_ON_HOST;
2485 host->cw_size = host->cw_data + ecc->bytes;
2538 host->cw_size, host->cw_data, ecc->strength, ecc->bytes,
2685 struct nand_ecc_ctrl *ecc = &chip->ecc;
2699 num_cw = nandc->exec_opwrite ? ecc->steps : 1;