Lines Matching full:ecc

10  * The MLC NAND flash controller provides hardware Reed-Solomon ECC
12 * of-band data must be written together in order to have a valid ECC.
15 * blank (all-ones) out-of-band data and a valid ECC, and any later
16 * out-of-band data write will void the ECC.
19 * should not rely on the ECC validity.
92 * OOB data in each small page are 6 'free' then 10 ECC bytes.
95 * while the the four ECC bytes are groupe in its last 40 bytes.
97 * The struct below represents how free vs ecc oob bytes are stored
109 } ecc[4]; member
183 * @mode: mode to set the ECC HW to.
194 * ECC layout -- this is needed whatever ECC mode we are using.
197 * front and R/S ECC at the back.
217 * lpc32xx_read_page_hwecc - read in- and out-of-band data with ECC
229 * ECC will be false if out-of-band data has been updated since in-band
264 /* copy last 10 bytes (R/S ECC) at back of OOB buffer */ in lpc32xx_read_page_hwecc()
265 memcpy(&oob->ecc[i], lpc32xx_nand_mlc_registers->buff, 10); in lpc32xx_read_page_hwecc()
271 * lpc32xx_read_page_raw - read raw (in-band, out-of-band and ECC) data
278 * Read NAND directly; can read pages with invalid ECC.
306 /* copy last 10 bytes (R/S ECC) at back of OOB buffer */ in lpc32xx_read_page_raw()
307 memcpy(&oob->ecc[i], lpc32xx_nand_mlc_registers->data, 10); in lpc32xx_read_page_raw()
323 * ECC covers in- and out-of-band data and was written when out-of-band
325 * blank, then the ECC will be false and the read will return bitflips,
326 * even in case of ECC failure where we will return 5 bitflips. The
364 /* copy next 10 bytes (R/S ECC) at back of OOB buffer */ in lpc32xx_read_oob()
365 memcpy(&oob->ecc[i], lpc32xx_nand_mlc_registers->buff, 10); in lpc32xx_read_oob()
371 * lpc32xx_write_page_hwecc - write in- and out-of-band data with ECC
396 /* copy next 6 bytes from OOB buffer -- excluding ECC */ in lpc32xx_write_page_hwecc()
398 /* wait for ECC to return to ready state */ in lpc32xx_write_page_hwecc()
405 /* if ECC stalled, return failure */ in lpc32xx_write_page_hwecc()
425 * lpc32xx_write_page_raw - write raw (in-band, out-of-band and ECC) data
438 * ECC area. Therefore, it can write pages with valid *or* invalid ECC.
452 /* copy next 6 bytes into OOB buffer -- excluding ECC */ in lpc32xx_write_page_raw()
454 /* copy next 10 bytes into OOB buffer -- that is 'ECC' */ in lpc32xx_write_page_raw()
455 memcpy(lpc32xx_nand_mlc_registers->buff, &oob->ecc[i], 10); in lpc32xx_write_page_raw()
466 * Since ECC covers in- and out-of-band data, writing out-of-band data
467 * with ECC will render the page ECC wrong -- or, if the page was blank,
468 * then it will produce a good ECC but a later in-band data write will
471 * Therefore, do not compute or write any ECC, and always return success.
473 * This implies that we do four writes, since non-ECC out-of-band data
487 /* copy 6 non-ECC out-of-band bytes directly into NAND */ in lpc32xx_write_oob()
561 /* Set needed ECC fields */ in board_nand_init()
563 lpc32xx_chip.ecc.mode = NAND_ECC_HW; in board_nand_init()
564 lpc32xx_chip.ecc.layout = &lpc32xx_largepage_ecclayout; in board_nand_init()
565 lpc32xx_chip.ecc.size = 512; in board_nand_init()
566 lpc32xx_chip.ecc.bytes = 10; in board_nand_init()
567 lpc32xx_chip.ecc.strength = 4; in board_nand_init()
568 lpc32xx_chip.ecc.read_page = lpc32xx_read_page_hwecc; in board_nand_init()
569 lpc32xx_chip.ecc.read_page_raw = lpc32xx_read_page_raw; in board_nand_init()
570 lpc32xx_chip.ecc.write_page = lpc32xx_write_page_hwecc; in board_nand_init()
571 lpc32xx_chip.ecc.write_page_raw = lpc32xx_write_page_raw; in board_nand_init()
572 lpc32xx_chip.ecc.read_oob = lpc32xx_read_oob; in board_nand_init()
573 lpc32xx_chip.ecc.write_oob = lpc32xx_write_oob; in board_nand_init()