Lines Matching full:ecc

3  * This file provides ECC correction for more than 1 bit per block of data,
24 * @ecclayout: private ecc layout for this BCH configuration
26 * @eccmask: XOR ecc mask, allows erased pages to be decoded as valid
36 * nand_bch_calculate_ecc - [NAND Interface] Calculate ECC for data block
39 * @code: output buffer with ECC
45 struct nand_bch_control *nbc = chip->ecc.priv; in nand_bch_calculate_ecc()
48 memset(code, 0, chip->ecc.bytes); in nand_bch_calculate_ecc()
49 encode_bch(nbc->bch, buf, chip->ecc.size, code); in nand_bch_calculate_ecc()
52 for (i = 0; i < chip->ecc.bytes; i++) in nand_bch_calculate_ecc()
62 * @read_ecc: ECC from the chip
63 * @calc_ecc: the ECC calculated from raw data
71 struct nand_bch_control *nbc = chip->ecc.priv; in nand_bch_correct_data()
75 count = decode_bch(nbc->bch, NULL, chip->ecc.size, read_ecc, calc_ecc, in nand_bch_correct_data()
79 if (errloc[i] < (chip->ecc.size*8)) in nand_bch_correct_data()
82 /* else error in ecc, no action needed */ in nand_bch_correct_data()
88 printk(KERN_ERR "ecc unrecoverable error\n"); in nand_bch_correct_data()
114 struct nand_ecclayout *layout = nand->ecc.layout; in nand_bch_init()
117 unsigned int eccsize = nand->ecc.size; in nand_bch_init()
118 unsigned int eccbytes = nand->ecc.bytes; in nand_bch_init()
119 unsigned int eccstrength = nand->ecc.strength; in nand_bch_init()
123 nand->ecc.bytes = eccbytes; in nand_bch_init()
127 printk(KERN_WARNING "ecc parameters not supplied\n"); in nand_bch_init()
151 /* if no ecc placement scheme was provided, build one */ in nand_bch_init()
171 /* put ecc bytes at oob tail */ in nand_bch_init()
178 nand->ecc.layout = layout; in nand_bch_init()
187 printk(KERN_WARNING "invalid ecc layout\n"); in nand_bch_init()
196 * compute and store the inverted ecc of an erased ecc block in nand_bch_init()
211 nand->ecc.strength = (eccbytes * 8) / fls(8 * eccsize); in nand_bch_init()
220 * nand_bch_free - [NAND Interface] Release NAND BCH ECC resources