summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuinn Jensen <quinn.jensen@freescale.com>2007-10-24 21:25:40 -0600
committerQuinn Jensen <quinn.jensen@freescale.com>2007-10-24 21:25:40 -0600
commit8434b44ae8dfeaba99136bd8b4c3d500f622bac6 (patch)
tree6bc108b862163ff6afb54f344f9ba6a0674991fc
parentff6800822de641075a54e2ca84363708e172e282 (diff)
CR ENGR00048608 Work around untrustworthy NFMS_BIT
Patch for CR ENGR00048608: Work around untrustworthy NFMS_BIT. Changed to set or clear NFMS bit based on mtd->writesize in driver specific nand_scan routine. Applies to linux 2.6.22 kernel on MX platforms. http://www.bitshrine.org/gpp/linux-2.6.22-mx-CR-ENGR00048608-Work-around-untrustworthy-.patch
-rw-r--r--drivers/mtd/nand/mxc_nd.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/mtd/nand/mxc_nd.c b/drivers/mtd/nand/mxc_nd.c
index ccab9e120791..08ea25ad9421 100644
--- a/drivers/mtd/nand/mxc_nd.c
+++ b/drivers/mtd/nand/mxc_nd.c
@@ -852,9 +852,6 @@ static void mxc_nand_command(struct mtd_info *mtd, unsigned command,
"mxc_nand_command (cmd = 0x%x, col = 0x%x, page = 0x%x)\n",
command, column, page_addr);
- if ((NFMS >> NFMS_BIT) & 0x1)
- is2k_Pagesize = 1;
-
/*
* Reset command state information
*/
@@ -1045,12 +1042,23 @@ static int mxc_nand_scan_bbt(struct mtd_info *mtd)
struct nand_chip *this = mtd->priv;
/* Config before scanning */
+ /* Do not rely on NFMS_BIT, set/clear NFMS bit based on mtd->writesize */
if (mtd->writesize == NAND_PAGESIZE_2KB) {
NFMS |= (1 << NFMS_BIT);
+ is2k_Pagesize = 1;
+ } else {
+ if ((NFMS >> NFMS_BIT) & 0x1) { /* This case has happened on some SoCs */
+ printk(KERN_INFO
+ "NFMS Bit set for 512B Page, resetting it. [RCSR: 0x%08x]\n",
+ NFMS);
+ NFMS &= ~(1 << NFMS_BIT);
+ }
+ is2k_Pagesize = 0;
}
this->bbt_td = NULL;
this->bbt_md = NULL;
+
if (!this->badblock_pattern) {
if (mtd->writesize == NAND_PAGESIZE_2KB)
this->badblock_pattern = &smallpage_memorybased;