Lines Matching refs:ecc
895 if ((info->nand.ecc.mode == NAND_ECC_HW) && in omap_correct_data()
896 (info->nand.ecc.size == 2048)) in omap_correct_data()
967 val = ((((info->nand.ecc.size >> 1) - 1) << ECCSIZE1_SHIFT) | in omap_enable_hwecc()
1079 nsectors = chip->ecc.steps; in omap_enable_hwecc_bch()
1099 nsectors = chip->ecc.steps; in omap_enable_hwecc_bch()
1112 nsectors = chip->ecc.steps; in omap_enable_hwecc_bch()
1167 int eccbytes = info->nand.ecc.bytes; in omap_calculate_ecc_bch()
1299 for (i = 0; i < info->nand.ecc.size; i++) { in erased_sector_bitflips()
1301 if (flip_bits > info->nand.ecc.strength) in erased_sector_bitflips()
1305 for (i = 0; i < info->nand.ecc.bytes - 1; i++) { in erased_sector_bitflips()
1307 if (flip_bits > info->nand.ecc.strength) in erased_sector_bitflips()
1316 memset(data, 0xFF, info->nand.ecc.size); in erased_sector_bitflips()
1317 memset(oob, 0xFF, info->nand.ecc.bytes); in erased_sector_bitflips()
1339 struct nand_ecc_ctrl *ecc = &info->nand.ecc; in omap_elm_correct_data() local
1340 int eccsteps = info->nand.ecc.steps; in omap_elm_correct_data()
1356 actual_eccbytes = ecc->bytes - 1; in omap_elm_correct_data()
1361 actual_eccbytes = ecc->bytes - 1; in omap_elm_correct_data()
1365 actual_eccbytes = ecc->bytes; in omap_elm_correct_data()
1398 buf = &data[info->nand.ecc.size * i]; in omap_elm_correct_data()
1426 calc_ecc += ecc->bytes; in omap_elm_correct_data()
1427 read_ecc += ecc->bytes; in omap_elm_correct_data()
1458 error_max = (ecc->size + actual_eccbytes) * 8; in omap_elm_correct_data()
1490 data += ecc->size; in omap_elm_correct_data()
1491 spare_ecc += ecc->bytes; in omap_elm_correct_data()
1512 uint32_t *eccpos = chip->ecc.layout->eccpos; in omap_write_page_bch()
1515 chip->ecc.hwctl(mtd, NAND_ECC_WRITE); in omap_write_page_bch()
1521 chip->ecc.calculate(mtd, buf, &ecc_calc[0]); in omap_write_page_bch()
1523 for (i = 0; i < chip->ecc.total; i++) in omap_write_page_bch()
1551 uint32_t *eccpos = chip->ecc.layout->eccpos; in omap_read_page_bch()
1553 uint32_t oob_pos = mtd->writesize + chip->ecc.layout->eccpos[0]; in omap_read_page_bch()
1558 chip->ecc.hwctl(mtd, NAND_ECC_READ); in omap_read_page_bch()
1565 chip->read_buf(mtd, oob, chip->ecc.total); in omap_read_page_bch()
1568 chip->ecc.calculate(mtd, buf, ecc_calc); in omap_read_page_bch()
1570 memcpy(ecc_code, &chip->oob_poi[eccpos[0]], chip->ecc.total); in omap_read_page_bch()
1572 stat = chip->ecc.correct(mtd, buf, ecc_code, ecc_calc); in omap_read_page_bch()
1690 nand_chip->ecc.priv = NULL; in omap_nand_probe()
1827 nand_chip->ecc.mode = NAND_ECC_SOFT; in omap_nand_probe()
1832 nand_chip->ecc.mode = NAND_ECC_HW; in omap_nand_probe()
1833 nand_chip->ecc.bytes = 3; in omap_nand_probe()
1834 nand_chip->ecc.size = 512; in omap_nand_probe()
1835 nand_chip->ecc.strength = 1; in omap_nand_probe()
1836 nand_chip->ecc.calculate = omap_calculate_ecc; in omap_nand_probe()
1837 nand_chip->ecc.hwctl = omap_enable_hwecc; in omap_nand_probe()
1838 nand_chip->ecc.correct = omap_correct_data; in omap_nand_probe()
1840 ecclayout->eccbytes = nand_chip->ecc.bytes * in omap_nand_probe()
1842 nand_chip->ecc.size); in omap_nand_probe()
1856 nand_chip->ecc.mode = NAND_ECC_HW; in omap_nand_probe()
1857 nand_chip->ecc.size = 512; in omap_nand_probe()
1858 nand_chip->ecc.bytes = 7; in omap_nand_probe()
1859 nand_chip->ecc.strength = 4; in omap_nand_probe()
1860 nand_chip->ecc.hwctl = omap_enable_hwecc_bch; in omap_nand_probe()
1861 nand_chip->ecc.correct = nand_bch_correct_data; in omap_nand_probe()
1862 nand_chip->ecc.calculate = omap_calculate_ecc_bch; in omap_nand_probe()
1864 ecclayout->eccbytes = nand_chip->ecc.bytes * in omap_nand_probe()
1866 nand_chip->ecc.size); in omap_nand_probe()
1870 if (((i + 1) % nand_chip->ecc.bytes) == 0) in omap_nand_probe()
1877 nand_chip->ecc.priv = nand_bch_init(mtd, in omap_nand_probe()
1878 nand_chip->ecc.size, in omap_nand_probe()
1879 nand_chip->ecc.bytes, in omap_nand_probe()
1881 if (!nand_chip->ecc.priv) { in omap_nand_probe()
1890 nand_chip->ecc.mode = NAND_ECC_HW; in omap_nand_probe()
1891 nand_chip->ecc.size = 512; in omap_nand_probe()
1893 nand_chip->ecc.bytes = 7 + 1; in omap_nand_probe()
1894 nand_chip->ecc.strength = 4; in omap_nand_probe()
1895 nand_chip->ecc.hwctl = omap_enable_hwecc_bch; in omap_nand_probe()
1896 nand_chip->ecc.correct = omap_elm_correct_data; in omap_nand_probe()
1897 nand_chip->ecc.calculate = omap_calculate_ecc_bch; in omap_nand_probe()
1898 nand_chip->ecc.read_page = omap_read_page_bch; in omap_nand_probe()
1899 nand_chip->ecc.write_page = omap_write_page_bch; in omap_nand_probe()
1901 ecclayout->eccbytes = nand_chip->ecc.bytes * in omap_nand_probe()
1903 nand_chip->ecc.size); in omap_nand_probe()
1912 info->mtd.writesize / nand_chip->ecc.size, in omap_nand_probe()
1913 nand_chip->ecc.size, nand_chip->ecc.bytes); in omap_nand_probe()
1920 nand_chip->ecc.mode = NAND_ECC_HW; in omap_nand_probe()
1921 nand_chip->ecc.size = 512; in omap_nand_probe()
1922 nand_chip->ecc.bytes = 13; in omap_nand_probe()
1923 nand_chip->ecc.strength = 8; in omap_nand_probe()
1924 nand_chip->ecc.hwctl = omap_enable_hwecc_bch; in omap_nand_probe()
1925 nand_chip->ecc.correct = nand_bch_correct_data; in omap_nand_probe()
1926 nand_chip->ecc.calculate = omap_calculate_ecc_bch; in omap_nand_probe()
1928 ecclayout->eccbytes = nand_chip->ecc.bytes * in omap_nand_probe()
1930 nand_chip->ecc.size); in omap_nand_probe()
1934 if (((i + 1) % nand_chip->ecc.bytes) == 0) in omap_nand_probe()
1941 nand_chip->ecc.priv = nand_bch_init(mtd, in omap_nand_probe()
1942 nand_chip->ecc.size, in omap_nand_probe()
1943 nand_chip->ecc.bytes, in omap_nand_probe()
1945 if (!nand_chip->ecc.priv) { in omap_nand_probe()
1954 nand_chip->ecc.mode = NAND_ECC_HW; in omap_nand_probe()
1955 nand_chip->ecc.size = 512; in omap_nand_probe()
1957 nand_chip->ecc.bytes = 13 + 1; in omap_nand_probe()
1958 nand_chip->ecc.strength = 8; in omap_nand_probe()
1959 nand_chip->ecc.hwctl = omap_enable_hwecc_bch; in omap_nand_probe()
1960 nand_chip->ecc.correct = omap_elm_correct_data; in omap_nand_probe()
1961 nand_chip->ecc.calculate = omap_calculate_ecc_bch; in omap_nand_probe()
1962 nand_chip->ecc.read_page = omap_read_page_bch; in omap_nand_probe()
1963 nand_chip->ecc.write_page = omap_write_page_bch; in omap_nand_probe()
1966 info->mtd.writesize / nand_chip->ecc.size, in omap_nand_probe()
1967 nand_chip->ecc.size, nand_chip->ecc.bytes); in omap_nand_probe()
1972 ecclayout->eccbytes = nand_chip->ecc.bytes * in omap_nand_probe()
1974 nand_chip->ecc.size); in omap_nand_probe()
1985 nand_chip->ecc.mode = NAND_ECC_HW; in omap_nand_probe()
1986 nand_chip->ecc.size = 512; in omap_nand_probe()
1987 nand_chip->ecc.bytes = 26; in omap_nand_probe()
1988 nand_chip->ecc.strength = 16; in omap_nand_probe()
1989 nand_chip->ecc.hwctl = omap_enable_hwecc_bch; in omap_nand_probe()
1990 nand_chip->ecc.correct = omap_elm_correct_data; in omap_nand_probe()
1991 nand_chip->ecc.calculate = omap_calculate_ecc_bch; in omap_nand_probe()
1992 nand_chip->ecc.read_page = omap_read_page_bch; in omap_nand_probe()
1993 nand_chip->ecc.write_page = omap_write_page_bch; in omap_nand_probe()
1996 info->mtd.writesize / nand_chip->ecc.size, in omap_nand_probe()
1997 nand_chip->ecc.size, nand_chip->ecc.bytes); in omap_nand_probe()
2002 ecclayout->eccbytes = nand_chip->ecc.bytes * in omap_nand_probe()
2004 nand_chip->ecc.size); in omap_nand_probe()
2031 nand_chip->ecc.layout = ecclayout; in omap_nand_probe()
2051 if (nand_chip->ecc.priv) { in omap_nand_probe()
2052 nand_bch_free(nand_chip->ecc.priv); in omap_nand_probe()
2053 nand_chip->ecc.priv = NULL; in omap_nand_probe()
2064 if (nand_chip->ecc.priv) { in omap_nand_remove()
2065 nand_bch_free(nand_chip->ecc.priv); in omap_nand_remove()
2066 nand_chip->ecc.priv = NULL; in omap_nand_remove()