summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/atmel_nand_ecc.h
diff options
context:
space:
mode:
authorJosh Wu <Josh.wu@atmel.com>2014-10-11 18:01:50 +0800
committerBrian Norris <computersforpeace@gmail.com>2014-11-05 14:44:25 -0800
commitabb1cd00e6b7434e866f1f817b4994e1c7f1f16d (patch)
tree56e7c9e8491ec0f924251a69060d156ea046b1d6 /drivers/mtd/nand/atmel_nand_ecc.h
parent33a87a159cca9deb29b6b72e9aed9d6644b5d1c8 (diff)
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>
Diffstat (limited to 'drivers/mtd/nand/atmel_nand_ecc.h')
-rw-r--r--drivers/mtd/nand/atmel_nand_ecc.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mtd/nand/atmel_nand_ecc.h b/drivers/mtd/nand/atmel_nand_ecc.h
index 8a1e9a68675..d4035e335ad 100644
--- a/drivers/mtd/nand/atmel_nand_ecc.h
+++ b/drivers/mtd/nand/atmel_nand_ecc.h
@@ -142,6 +142,10 @@
#define PMECC_GF_DIMENSION_13 13
#define PMECC_GF_DIMENSION_14 14
+/* Primitive Polynomial used by PMECC */
+#define PMECC_GF_13_PRIMITIVE_POLY 0x201b
+#define PMECC_GF_14_PRIMITIVE_POLY 0x4443
+
#define PMECC_LOOKUP_TABLE_SIZE_512 0x2000
#define PMECC_LOOKUP_TABLE_SIZE_1024 0x4000