Lines Matching refs:ecc

182 	struct mtd_oob_region ecc;  member
204 int bytes_per_step = DIV_ROUND_UP(BITS_PER_STEP_RS * chip->ecc.strength, in tegra_nand_ooblayout_rs_ecc()
211 oobregion->length = round_up(bytes_per_step * chip->ecc.steps, 4); in tegra_nand_ooblayout_rs_ecc()
223 .ecc = tegra_nand_ooblayout_rs_ecc,
231 int bytes_per_step = DIV_ROUND_UP(BITS_PER_STEP_BCH * chip->ecc.strength, in tegra_nand_ooblayout_bch_ecc()
238 oobregion->length = round_up(bytes_per_step * chip->ecc.steps, 4); in tegra_nand_ooblayout_bch_ecc()
244 .ecc = tegra_nand_ooblayout_bch_ecc,
480 if (chip->ecc.algo == NAND_ECC_BCH && enable) in tegra_nand_hw_ecc()
705 if (fail_sec_flag ^ GENMASK(chip->ecc.steps - 1, 0)) { in tegra_nand_read_page_hwecc()
721 for_each_set_bit(bit, &fail_sec_flag, chip->ecc.steps) { in tegra_nand_read_page_hwecc()
722 u8 *data = buf + (chip->ecc.size * bit); in tegra_nand_read_page_hwecc()
723 u8 *oob = chip->oob_poi + nand->ecc.offset + in tegra_nand_read_page_hwecc()
724 (chip->ecc.bytes * bit); in tegra_nand_read_page_hwecc()
726 ret = nand_check_erased_ecc_chunk(data, chip->ecc.size, in tegra_nand_read_page_hwecc()
727 oob, chip->ecc.bytes, in tegra_nand_read_page_hwecc()
729 chip->ecc.strength); in tegra_nand_read_page_hwecc()
841 bool maximize = chip->ecc.options & NAND_ECC_MAXIMIZE; in tegra_nand_get_strength()
862 bytes_per_page = round_up(bytes_per_step * chip->ecc.steps, 4); in tegra_nand_get_strength()
877 switch (chip->ecc.algo) { in tegra_nand_select_strength()
917 chip->ecc.mode = NAND_ECC_HW; in tegra_nand_attach_chip()
918 chip->ecc.size = 512; in tegra_nand_attach_chip()
919 chip->ecc.steps = mtd->writesize / chip->ecc.size; in tegra_nand_attach_chip()
926 chip->ecc.read_page = tegra_nand_read_page_hwecc; in tegra_nand_attach_chip()
927 chip->ecc.write_page = tegra_nand_write_page_hwecc; in tegra_nand_attach_chip()
928 chip->ecc.read_page_raw = tegra_nand_read_page_raw; in tegra_nand_attach_chip()
929 chip->ecc.write_page_raw = tegra_nand_write_page_raw; in tegra_nand_attach_chip()
930 chip->ecc.read_oob = tegra_nand_read_oob; in tegra_nand_attach_chip()
931 chip->ecc.write_oob = tegra_nand_write_oob; in tegra_nand_attach_chip()
936 if (chip->ecc.algo == NAND_ECC_UNKNOWN) { in tegra_nand_attach_chip()
938 chip->ecc.algo = NAND_ECC_RS; in tegra_nand_attach_chip()
940 chip->ecc.algo = NAND_ECC_BCH; in tegra_nand_attach_chip()
943 if (chip->ecc.algo == NAND_ECC_BCH && mtd->writesize < 2048) { in tegra_nand_attach_chip()
948 if (!chip->ecc.strength) { in tegra_nand_attach_chip()
957 chip->ecc.strength = ret; in tegra_nand_attach_chip()
963 switch (chip->ecc.algo) { in tegra_nand_attach_chip()
965 bits_per_step = BITS_PER_STEP_RS * chip->ecc.strength; in tegra_nand_attach_chip()
969 switch (chip->ecc.strength) { in tegra_nand_attach_chip()
981 chip->ecc.strength); in tegra_nand_attach_chip()
986 bits_per_step = BITS_PER_STEP_BCH * chip->ecc.strength; in tegra_nand_attach_chip()
989 switch (chip->ecc.strength) { in tegra_nand_attach_chip()
1004 chip->ecc.strength); in tegra_nand_attach_chip()
1014 chip->ecc.algo == NAND_ECC_BCH ? "BCH" : "RS", in tegra_nand_attach_chip()
1015 chip->ecc.strength); in tegra_nand_attach_chip()
1017 chip->ecc.bytes = DIV_ROUND_UP(bits_per_step, BITS_PER_BYTE); in tegra_nand_attach_chip()
1122 mtd_ooblayout_ecc(mtd, 0, &nand->ecc); in tegra_nand_chips_init()