summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/atmel_nand_ecc.h
diff options
context:
space:
mode:
authorRomain Izard <romain.izard.pro@gmail.com>2016-02-10 10:56:25 +0100
committerBrian Norris <computersforpeace@gmail.com>2016-02-12 19:27:47 +0100
commit5575075612cadd504dd8c8e1b8c66fa5d48b7042 (patch)
tree90033057252bf88c41ae31ee9ab27c2919270fbc /drivers/mtd/nand/atmel_nand_ecc.h
parentdoc: dt: atmel_nand: Reword the documentation (diff)
downloadlinux-5575075612cadd504dd8c8e1b8c66fa5d48b7042.tar.xz
linux-5575075612cadd504dd8c8e1b8c66fa5d48b7042.zip
mtd: atmel_nand: Support PMECC on SAMA5D2
Starting with the SAMA5D2, there is a new revision of the Atmel PMECC controller that can correct 32 bits in each sector. This controller is not 100% compatible with the previous revision that corrected a maximum of 24 bits by sector, as some register addresses overlap. Using information from the device tree, we can configure the driver to work with both versions. For the binding: Acked-by: Rob Herring <robh@kernel.org> Tested-by: Wenyou Yang <wenyou.yang@atmel.com> Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com> 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.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/mtd/nand/atmel_nand_ecc.h b/drivers/mtd/nand/atmel_nand_ecc.h
index 668e7358f19b..ec964c43c932 100644
--- a/drivers/mtd/nand/atmel_nand_ecc.h
+++ b/drivers/mtd/nand/atmel_nand_ecc.h
@@ -108,7 +108,11 @@
#define PMERRLOC_ERR_NUM_MASK (0x1f << 8)
#define PMERRLOC_CALC_DONE (1 << 0)
#define ATMEL_PMERRLOC_SIGMAx 0x028 /* Error location SIGMA x */
-#define ATMEL_PMERRLOC_ELx 0x08c /* Error location x */
+
+/*
+ * The ATMEL_PMERRLOC_ELx register location depends from the number of
+ * bits corrected by the PMECC controller. Do not use it.
+ */
/* Register access macros for PMECC */
#define pmecc_readl_relaxed(addr, reg) \
@@ -136,7 +140,7 @@
readl_relaxed((addr) + ATMEL_PMERRLOC_SIGMAx + ((n) * 4))
#define pmerrloc_readl_el_relaxed(addr, n) \
- readl_relaxed((addr) + ATMEL_PMERRLOC_ELx + ((n) * 4))
+ readl_relaxed((addr) + ((n) * 4))
/* Galois field dimension */
#define PMECC_GF_DIMENSION_13 13