mtd: atmel_nand: make PMECC lookup table and offset property optional
authorJosh Wu <Josh.wu@atmel.com>
Sat, 11 Oct 2014 10:01:50 +0000 (18:01 +0800)
committerBrian Norris <computersforpeace@gmail.com>
Wed, 5 Nov 2014 22:44:25 +0000 (14:44 -0800)
commitabb1cd00e6b7434e866f1f817b4994e1c7f1f16d
tree56e7c9e8491ec0f924251a69060d156ea046b1d6
parent33a87a159cca9deb29b6b72e9aed9d6644b5d1c8
mtd: atmel_nand: make PMECC lookup table and offset property optional

If there is no PMECC lookup table stored in ROM, or lookup table offset is
not specified, PMECC driver should build it in DDR by itself.

That make the PMECC driver work for some board which doesn't have PMECC
lookup table in ROM.

The PMECC use the BCH algorithm, so based on the build_gf_tables()
function in lib/bch.c, we can build the Galois Field lookup table.

For more information can refer to section 5.4 of PMECC controller
application note:
http://www.atmel.com/images/doc11127.pdf

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Cc: devicetree@vger.kernel.org
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Documentation/devicetree/bindings/mtd/atmel-nand.txt
drivers/mtd/nand/atmel_nand.c
drivers/mtd/nand/atmel_nand_ecc.h