summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand/atmel_nand_ecc.h
diff options
context:
space:
mode:
authorJosh Wu <josh.wu@atmel.com>2014-11-10 15:24:00 +0800
committerTom Rini <trini@ti.com>2014-11-17 08:47:18 -0500
commit7df4486d04204e654b5965267bb6c645b3c13052 (patch)
tree83ba7570391fc725ca7a14097f6b1b7bb62610ae /drivers/mtd/nand/atmel_nand_ecc.h
parent5b15fd980bfcb49e2b9bc711339cbd6e8731aef8 (diff)
downloadu-boot-imx-7df4486d04204e654b5965267bb6c645b3c13052.zip
u-boot-imx-7df4486d04204e654b5965267bb6c645b3c13052.tar.gz
u-boot-imx-7df4486d04204e654b5965267bb6c645b3c13052.tar.bz2
mtd: atmel_nand: runtime to build gf table for pmecc
As in SAMA5D4 SoC, the gf table in ROM code can not be seen. So, when we try to use PMECC, we need to build it when do initialization. Add a macro NO_GALOIS_TABLE_IN_ROM in soc header file. If it is defined we will build gf table runtime. 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. Signed-off-by: Josh Wu <josh.wu@atmel.com> Signed-off-by: Bo Shen <voice.shen@atmel.com> Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.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 92d4ec5..eac860d 100644
--- a/drivers/mtd/nand/atmel_nand_ecc.h
+++ b/drivers/mtd/nand/atmel_nand_ecc.h
@@ -141,6 +141,10 @@ struct pmecc_errloc_regs {
#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_INDEX_TABLE_SIZE_512 0x2000
#define PMECC_INDEX_TABLE_SIZE_1024 0x4000