diff options
author | Jason Liu <r64343@freescale.com> | 2008-03-14 22:58:32 -0500 |
---|---|---|
committer | Daniel Schaeffer <daniel.schaeffer@timesys.com> | 2008-08-25 15:20:47 -0400 |
commit | 3860d5c136ca91bdae9bfc2cc00839177f2f86a5 (patch) | |
tree | c065adc8364872aab6d2aeb490ffbb8fddfcb07f /drivers | |
parent | c6f39059b65b8ffc4e3581d32d5c435e0ab7aa6a (diff) |
ENGR00068641 ecc status check fix
ecc status check for large page nand flash
Signed-off-by: Jason Liu <r64343@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/nand/mxc_nd2.c | 4 | ||||
-rw-r--r-- | drivers/mtd/nand/mxc_nd2.h | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/drivers/mtd/nand/mxc_nd2.c b/drivers/mtd/nand/mxc_nd2.c index 702f6a1e3de4..2840d4ca4adf 100644 --- a/drivers/mtd/nand/mxc_nd2.c +++ b/drivers/mtd/nand/mxc_nd2.c @@ -397,7 +397,7 @@ static void mxc_nand_enable_hwecc(struct mtd_info *mtd, int mode) */ static int mxc_check_ecc_status(struct mtd_info *mtd) { - u16 ecc_stat, err; + u32 ecc_stat, err; int no_subpages = 1; int ret = 0; u8 ecc_bit_mask, err_limit; @@ -407,7 +407,7 @@ static int mxc_check_ecc_status(struct mtd_info *mtd) no_subpages = mtd->writesize >> 9; - ecc_stat = raw_read(REG_NFC_ECC_STATUS_RESULT); + ecc_stat = GET_NFC_ECC_STATUS(); do { err = ecc_stat & ecc_bit_mask; if (err > err_limit) { diff --git a/drivers/mtd/nand/mxc_nd2.h b/drivers/mtd/nand/mxc_nd2.h index de661a674d02..bcd31a061089 100644 --- a/drivers/mtd/nand/mxc_nd2.h +++ b/drivers/mtd/nand/mxc_nd2.h @@ -148,6 +148,8 @@ #endif +#define GET_NFC_ECC_STATUS() raw_read(REG_NFC_ECC_STATUS_RESULT); + /*! * Set 1 to specific operation bit, rest to 0 in LAUNCH_NFC Register for * Specific operation @@ -305,6 +307,9 @@ #define WRITE_NFC_IP_REG(val,reg) \ raw_write((raw_read(REG_NFC_OPS_STAT) & ~NFC_OPS_STAT), REG_NFC_OPS_STAT) + +#define GET_NFC_ECC_STATUS() raw_read(REG_NFC_ECC_STATUS_RESULT); + /*! * Set INT to 0, Set 1 to specific operation bit, rest to 0 in LAUNCH_NFC Register for * Specific operation |