aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mtd
diff options
context:
space:
mode:
authorBastian Hecht <hechtb@googlemail.com>2012-05-14 08:14:46 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-07-06 13:17:04 -0400
commit6667a6d58e25d351d8fce7a628a8c9c139a8bdc9 (patch)
treeaf1edb613a317991a0451ea1dd5a52b531b18d83 /include/linux/mtd
parent623c55caa37203ece6b4450daa0d2d058255da30 (diff)
mtd: sh_flctl: Restructure the hardware ECC handling
There are multiple reasons for a rewrite: - a race exists: when _4ECCEND is set, _4ECCFA may become true too meanwhile, which is lost and a non-correctable error is treated as correctable. - the ECC statistics don't get properly propagated to the base code. - empty pages would get marked as corrupted The rewrite resolves the issues and I hope it gives a more explicit code flow structure. Signed-off-by: Bastian Hecht <hechtb@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'include/linux/mtd')
-rw-r--r--include/linux/mtd/sh_flctl.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/linux/mtd/sh_flctl.h b/include/linux/mtd/sh_flctl.h
index 3feaae062feb..01e4b15b280e 100644
--- a/include/linux/mtd/sh_flctl.h
+++ b/include/linux/mtd/sh_flctl.h
@@ -129,9 +129,15 @@
129#define _4ECCEND (0x1 << 1) /* 4 symbols end */ 129#define _4ECCEND (0x1 << 1) /* 4 symbols end */
130#define _4ECCEXST (0x1 << 0) /* 4 symbols exist */ 130#define _4ECCEXST (0x1 << 0) /* 4 symbols exist */
131 131
132#define INIT_FL4ECCRESULT_VAL 0x03FF03FF
133#define LOOP_TIMEOUT_MAX 0x00010000 132#define LOOP_TIMEOUT_MAX 0x00010000
134 133
134enum flctl_ecc_res_t {
135 FL_SUCCESS,
136 FL_REPAIRABLE,
137 FL_ERROR,
138 FL_TIMEOUT
139};
140
135struct sh_flctl { 141struct sh_flctl {
136 struct mtd_info mtd; 142 struct mtd_info mtd;
137 struct nand_chip chip; 143 struct nand_chip chip;
@@ -151,8 +157,6 @@ struct sh_flctl {
151 uint32_t flcmncr_base; /* base value of FLCMNCR */ 157 uint32_t flcmncr_base; /* base value of FLCMNCR */
152 uint32_t flintdmacr_base; /* irq enable bits */ 158 uint32_t flintdmacr_base; /* irq enable bits */
153 159
154 int hwecc_cant_correct[4];
155
156 unsigned page_size:1; /* NAND page size (0 = 512, 1 = 2048) */ 160 unsigned page_size:1; /* NAND page size (0 = 512, 1 = 2048) */
157 unsigned hwecc:1; /* Hardware ECC (0 = disabled, 1 = enabled) */ 161 unsigned hwecc:1; /* Hardware ECC (0 = disabled, 1 = enabled) */
158 unsigned holden:1; /* Hardware has FLHOLDCR and HOLDEN is set */ 162 unsigned holden:1; /* Hardware has FLHOLDCR and HOLDEN is set */