Lines Matching defs:ecc
415 * of a page, consisting of all data, ecc, spare
430 * ecc/non-ecc mode for the current nand flash
459 * @ecc_modes - ecc mode for NAND
1391 struct nand_ecc_ctrl *ecc = &chip->ecc;
1395 num_cw = command == NAND_CMD_PAGEPROG ? ecc->steps : 1;
1441 struct nand_ecc_ctrl *ecc = &chip->ecc;
1476 update_rw_regs(host, ecc->steps, true);
1591 struct nand_ecc_ctrl *ecc = &chip->ecc;
1603 data_size1 = mtd->writesize - host->cw_size * (ecc->steps - 1);
1606 if (cw == (ecc->steps - 1)) {
1607 data_size2 = ecc->size - data_size1 -
1608 ((ecc->steps - 1) * 4);
1609 oob_size2 = (ecc->steps * 4) + host->ecc_bytes_hw +
1656 * equal to the ecc->strength for each CW.
1674 struct nand_ecc_ctrl *ecc = &chip->ecc;
1686 for_each_set_bit(cw, &uncorrectable_cws, ecc->steps) {
1687 if (cw == (ecc->steps - 1)) {
1688 data_size = ecc->size - ((ecc->steps - 1) * 4);
1689 oob_size = (ecc->steps * 4) + host->ecc_bytes_hw;
1697 cw_oob_buf = oob_buf + (cw * ecc->bytes);
1711 0, ecc->strength);
1725 * errors. this is equivalent to what 'ecc->correct()' would do.
1733 struct nand_ecc_ctrl *ecc = &chip->ecc;
1743 for (i = 0; i < ecc->steps; i++, buf++) {
1747 if (i == (ecc->steps - 1)) {
1748 data_len = ecc->size - ((ecc->steps - 1) << 2);
1749 oob_len = ecc->steps << 2;
1813 oob_buf += oob_len + ecc->bytes;
1828 * helper to perform the actual page read operation, used by ecc->read_page(),
1829 * ecc->read_oob()
1836 struct nand_ecc_ctrl *ecc = &chip->ecc;
1843 for (i = 0; i < ecc->steps; i++) {
1846 if (i == (ecc->steps - 1)) {
1847 data_size = ecc->size - ((ecc->steps - 1) << 2);
1848 oob_size = (ecc->steps << 2) + host->ecc_bytes_hw +
1875 * when ecc is enabled, the controller doesn't read the real
1916 struct nand_ecc_ctrl *ecc = &chip->ecc;
1927 set_address(host, host->cw_size * (ecc->steps - 1), page);
1943 /* implements ecc->read_page() */
1960 /* implements ecc->read_page_raw() */
1966 struct nand_ecc_ctrl *ecc = &chip->ecc;
1970 for (cw = 0; cw < ecc->steps; cw++) {
1977 oob_buf += ecc->bytes;
1983 /* implements ecc->read_oob() */
1988 struct nand_ecc_ctrl *ecc = &chip->ecc;
1995 update_rw_regs(host, ecc->steps, true);
2000 /* implements ecc->write_page() */
2006 struct nand_ecc_ctrl *ecc = &chip->ecc;
2019 update_rw_regs(host, ecc->steps, false);
2022 for (i = 0; i < ecc->steps; i++) {
2025 if (i == (ecc->steps - 1)) {
2026 data_size = ecc->size - ((ecc->steps - 1) << 2);
2027 oob_size = (ecc->steps << 2) + host->ecc_bytes_hw +
2031 oob_size = ecc->bytes;
2036 i == (ecc->steps - 1) ? NAND_BAM_NO_EOT : 0);
2045 if (i == (ecc->steps - 1)) {
2070 /* implements ecc->write_page_raw() */
2078 struct nand_ecc_ctrl *ecc = &chip->ecc;
2090 update_rw_regs(host, ecc->steps, false);
2093 for (i = 0; i < ecc->steps; i++) {
2097 data_size1 = mtd->writesize - host->cw_size * (ecc->steps - 1);
2100 if (i == (ecc->steps - 1)) {
2101 data_size2 = ecc->size - data_size1 -
2102 ((ecc->steps - 1) << 2);
2103 oob_size2 = (ecc->steps << 2) + host->ecc_bytes_hw +
2144 * implements ecc->write_oob()
2155 struct nand_ecc_ctrl *ecc = &chip->ecc;
2164 data_size = ecc->size - ((ecc->steps - 1) << 2);
2172 set_address(host, host->cw_size * (ecc->steps - 1), page);
2197 struct nand_ecc_ctrl *ecc = &chip->ecc;
2204 * the beginning of the last codeword, we don't care about reading ecc
2220 bbpos = mtd->writesize - host->cw_size * (ecc->steps - 1);
2234 struct nand_ecc_ctrl *ecc = &chip->ecc;
2251 set_address(host, host->cw_size * (ecc->steps - 1), page);
2411 * dummy/real bad block bytes are grouped as ecc bytes (i.e, ecc->bytes is
2419 struct nand_ecc_ctrl *ecc = &chip->ecc;
2425 oobregion->length = (ecc->bytes * (ecc->steps - 1)) +
2441 struct nand_ecc_ctrl *ecc = &chip->ecc;
2446 oobregion->length = ecc->steps * 4;
2447 oobregion->offset = ((ecc->steps - 1) * ecc->bytes) + host->bbm_size;
2453 .ecc = qcom_nand_ooblayout_ecc,
2469 struct nand_ecc_ctrl *ecc = &chip->ecc;
2476 ecc->size = NANDC_STEP_SIZE;
2491 if (ecc->strength >= 8) {
2540 * we consider ecc->bytes as the sum of all the non-data content in a
2545 ecc->bytes = host->ecc_bytes_hw + host->spare_bytes + host->bbm_size;
2547 ecc->read_page = qcom_nandc_read_page;
2548 ecc->read_page_raw = qcom_nandc_read_page_raw;
2549 ecc->read_oob = qcom_nandc_read_oob;
2550 ecc->write_page = qcom_nandc_write_page;
2551 ecc->write_page_raw = qcom_nandc_write_page_raw;
2552 ecc->write_oob = qcom_nandc_write_oob;
2554 ecc->engine_type = NAND_ECC_ENGINE_TYPE_ON_HOST;
2572 host->cw_size = host->cw_data + ecc->bytes;
2624 host->cw_size, host->cw_data, ecc->strength, ecc->bytes,