Lines Matching full:ecc
3 * This file provides ECC correction for more than 1 bit per block of data,
23 * @eccmask: XOR ecc mask, allows erased pages to be decoded as valid
32 * nand_bch_calculate_ecc - [NAND Interface] Calculate ECC for data block
35 * @code: output buffer with ECC
40 struct nand_bch_control *nbc = chip->ecc.priv; in nand_bch_calculate_ecc()
43 memset(code, 0, chip->ecc.bytes); in nand_bch_calculate_ecc()
44 encode_bch(nbc->bch, buf, chip->ecc.size, code); in nand_bch_calculate_ecc()
47 for (i = 0; i < chip->ecc.bytes; i++) in nand_bch_calculate_ecc()
58 * @read_ecc: ECC from the chip
59 * @calc_ecc: the ECC calculated from raw data
66 struct nand_bch_control *nbc = chip->ecc.priv; in nand_bch_correct_data()
70 count = decode_bch(nbc->bch, NULL, chip->ecc.size, read_ecc, calc_ecc, in nand_bch_correct_data()
74 if (errloc[i] < (chip->ecc.size*8)) in nand_bch_correct_data()
77 /* else error in ecc, no action needed */ in nand_bch_correct_data()
83 pr_err("ecc unrecoverable error\n"); in nand_bch_correct_data()
112 unsigned int eccsize = nand->ecc.size; in nand_bch_init()
113 unsigned int eccbytes = nand->ecc.bytes; in nand_bch_init()
114 unsigned int eccstrength = nand->ecc.strength; in nand_bch_init()
118 nand->ecc.bytes = eccbytes; in nand_bch_init()
122 pr_warn("ecc parameters not supplied\n"); in nand_bch_init()
159 * ecc->steps and ecc->total might be used by mtd->ooblayout->ecc(), in nand_bch_init()
166 nand->ecc.steps = eccsteps; in nand_bch_init()
167 nand->ecc.total = eccsteps * eccbytes; in nand_bch_init()
169 pr_warn("invalid ecc layout\n"); in nand_bch_init()
178 * compute and store the inverted ecc of an erased ecc block in nand_bch_init()
192 nand->ecc.strength = (eccbytes * 8) / fls(8 * eccsize); in nand_bch_init()
202 * nand_bch_free - [NAND Interface] Release NAND BCH ECC resources
218 MODULE_DESCRIPTION("NAND software BCH ECC support");