]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mtd: atmel_nand: pmecc: fix bug fail to correct bit error in 1024-bytes sector
authorJosh Wu <josh.wu@atmel.com>
Mon, 19 Aug 2013 10:05:44 +0000 (18:05 +0800)
committerBrian Norris <computersforpeace@gmail.com>
Tue, 20 Aug 2013 01:00:27 +0000 (18:00 -0700)
commitbbf6f6db8f0d43d17d1e31d760b2e2de651e9f76
tree46c28eb109d7c2c6b2f862ccaec5f496af1dede6
parent7b9497fcaaceb84acbb62e80e04eba2e36ee5ed4
mtd: atmel_nand: pmecc: fix bug fail to correct bit error in 1024-bytes sector

The PMECC use BCH algorithm to correct error. In BCH algorithm, the primitive
polynomial value is GF(2^13) for 512-bytes sector size. And it is GF(2^14) for
1024-bytes sector size.

This patch will choose correct degree of the remainders(13 or 14) for
different sector size.
Tested in AT91SAM9X5-EK with MLC nand flash.

More detail can be refered to section 5.4.1 of:
  AT91SAM ARM-based Embedded MPU Application Note
  <http://www.atmel.com/Images/doc11127.pdf>

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
drivers/mtd/nand/atmel_nand.c