diff options
| -rw-r--r-- | drivers/mtd/nand/fsl_ifc_nand.c | 8 | ||||
| -rw-r--r-- | include/linux/fsl_ifc.h | 8 |
2 files changed, 13 insertions, 3 deletions
diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c index 0a177b1bfe3e..d1570f512f0b 100644 --- a/drivers/mtd/nand/fsl_ifc_nand.c +++ b/drivers/mtd/nand/fsl_ifc_nand.c | |||
| @@ -258,9 +258,15 @@ static void fsl_ifc_run_command(struct mtd_info *mtd) | |||
| 258 | int bufnum = nctrl->page & priv->bufnum_mask; | 258 | int bufnum = nctrl->page & priv->bufnum_mask; |
| 259 | int sector = bufnum * chip->ecc.steps; | 259 | int sector = bufnum * chip->ecc.steps; |
| 260 | int sector_end = sector + chip->ecc.steps - 1; | 260 | int sector_end = sector + chip->ecc.steps - 1; |
| 261 | __be32 *eccstat_regs; | ||
| 262 | |||
| 263 | if (ctrl->version >= FSL_IFC_VERSION_2_0_0) | ||
| 264 | eccstat_regs = ifc->ifc_nand.v2_nand_eccstat; | ||
| 265 | else | ||
| 266 | eccstat_regs = ifc->ifc_nand.v1_nand_eccstat; | ||
| 261 | 267 | ||
| 262 | for (i = sector / 4; i <= sector_end / 4; i++) | 268 | for (i = sector / 4; i <= sector_end / 4; i++) |
| 263 | eccstat[i] = ifc_in32(&ifc->ifc_nand.nand_eccstat[i]); | 269 | eccstat[i] = ifc_in32(&eccstat_regs[i]); |
| 264 | 270 | ||
| 265 | for (i = sector; i <= sector_end; i++) { | 271 | for (i = sector; i <= sector_end; i++) { |
| 266 | errors = check_read_ecc(mtd, ctrl, eccstat, i); | 272 | errors = check_read_ecc(mtd, ctrl, eccstat, i); |
diff --git a/include/linux/fsl_ifc.h b/include/linux/fsl_ifc.h index 3f9778cbc79d..c332f0a45607 100644 --- a/include/linux/fsl_ifc.h +++ b/include/linux/fsl_ifc.h | |||
| @@ -733,8 +733,12 @@ struct fsl_ifc_nand { | |||
| 733 | __be32 nand_erattr1; | 733 | __be32 nand_erattr1; |
| 734 | u32 res19[0x10]; | 734 | u32 res19[0x10]; |
| 735 | __be32 nand_fsr; | 735 | __be32 nand_fsr; |
| 736 | u32 res20[0x3]; | 736 | u32 res20; |
| 737 | __be32 nand_eccstat[6]; | 737 | /* The V1 nand_eccstat is actually 4 words that overlaps the |
| 738 | * V2 nand_eccstat. | ||
| 739 | */ | ||
| 740 | __be32 v1_nand_eccstat[2]; | ||
| 741 | __be32 v2_nand_eccstat[6]; | ||
| 738 | u32 res21[0x1c]; | 742 | u32 res21[0x1c]; |
| 739 | __be32 nanndcr; | 743 | __be32 nanndcr; |
| 740 | u32 res22[0x2]; | 744 | u32 res22[0x2]; |
