Lines Matching full:ecc
2 * This file provides ECC correction for more than 1 bit per block of data,
36 * @eccmask: XOR ecc mask, allows erased pages to be decoded as valid
45 * nand_bch_calculate_ecc - [NAND Interface] Calculate ECC for data block
48 * @code: output buffer with ECC
54 struct nand_bch_control *nbc = chip->ecc.priv; in nand_bch_calculate_ecc()
57 memset(code, 0, chip->ecc.bytes); in nand_bch_calculate_ecc()
58 encode_bch(nbc->bch, buf, chip->ecc.size, code); in nand_bch_calculate_ecc()
61 for (i = 0; i < chip->ecc.bytes; i++) in nand_bch_calculate_ecc()
72 * @read_ecc: ECC from the chip
73 * @calc_ecc: the ECC calculated from raw data
81 struct nand_bch_control *nbc = chip->ecc.priv; in nand_bch_correct_data()
85 count = decode_bch(nbc->bch, NULL, chip->ecc.size, read_ecc, calc_ecc, in nand_bch_correct_data()
89 if (errloc[i] < (chip->ecc.size*8)) in nand_bch_correct_data()
92 /* else error in ecc, no action needed */ in nand_bch_correct_data()
98 pr_err("ecc unrecoverable error\n"); in nand_bch_correct_data()
127 unsigned int eccsize = nand->ecc.size; in nand_bch_init()
128 unsigned int eccbytes = nand->ecc.bytes; in nand_bch_init()
129 unsigned int eccstrength = nand->ecc.strength; in nand_bch_init()
133 nand->ecc.bytes = eccbytes; in nand_bch_init()
137 pr_warn("ecc parameters not supplied\n"); in nand_bch_init()
174 * ecc->steps and ecc->total might be used by mtd->ooblayout->ecc(), in nand_bch_init()
181 nand->ecc.steps = eccsteps; in nand_bch_init()
182 nand->ecc.total = eccsteps * eccbytes; in nand_bch_init()
184 pr_warn("invalid ecc layout\n"); in nand_bch_init()
193 * compute and store the inverted ecc of an erased ecc block in nand_bch_init()
208 nand->ecc.strength = (eccbytes * 8) / fls(8 * eccsize); in nand_bch_init()
218 * nand_bch_free - [NAND Interface] Release NAND BCH ECC resources
234 MODULE_DESCRIPTION("NAND software BCH ECC support");