summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorTerry Lv <r65388@freescale.com>2011-05-20 13:28:13 +0800
committerTerry Lv <r65388@freescale.com>2011-05-20 13:31:11 +0800
commit314c6033037e4f3e57638caab98fe2711b79b416 (patch)
treea47e9ef99500d120138335a07f07c9103ca8a7d2 /drivers/mtd
parentb495365cdba6f1ddf762e67f2bb4b6693c1f24d2 (diff)
downloadu-boot-imx-314c6033037e4f3e57638caab98fe2711b79b416.zip
u-boot-imx-314c6033037e4f3e57638caab98fe2711b79b416.tar.gz
u-boot-imx-314c6033037e4f3e57638caab98fe2711b79b416.tar.bz2
ENGR00143704: U_BOOT: Nand oobsize is wrong in some nand chips
Nand oobsize is wrong in some nand chips. Signed-off-by: Terry Lv <r65388@freescale.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/gpmi_nfc_gpmi.h6
-rw-r--r--drivers/mtd/nand/gpmi_nfc_mil.c12
2 files changed, 11 insertions, 7 deletions
diff --git a/drivers/mtd/nand/gpmi_nfc_gpmi.h b/drivers/mtd/nand/gpmi_nfc_gpmi.h
index bd56e4c..9f7780d 100644
--- a/drivers/mtd/nand/gpmi_nfc_gpmi.h
+++ b/drivers/mtd/nand/gpmi_nfc_gpmi.h
@@ -1,7 +1,7 @@
/*
* Freescale GPMI Register Definitions
*
- * Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2008-2011 Freescale Semiconductor, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -802,7 +802,9 @@ static inline u32 gpmi_nfc_get_ecc_strength(u32 page_data_size,
return 16;
else
return 0;
- } else
+ } else if (8192 == page_data_size)
+ return 24;
+ else
return 0;
}
diff --git a/drivers/mtd/nand/gpmi_nfc_mil.c b/drivers/mtd/nand/gpmi_nfc_mil.c
index 889144c..f41a02e 100644
--- a/drivers/mtd/nand/gpmi_nfc_mil.c
+++ b/drivers/mtd/nand/gpmi_nfc_mil.c
@@ -904,20 +904,22 @@ static int gpmi_nfc_scan_bbt(struct mtd_info *mtd)
/* Correct mtd setting */
mtd->size = dev_info->chip_size_in_bytes * nand->numchips;
- /*
+
mtd->writesize = 1 << (fls(dev_info->page_total_size_in_bytes) - 1);
mtd->oobsize = dev_info->page_total_size_in_bytes - mtd->writesize;
mtd->erasesize = dev_info->block_size_in_pages * mtd->writesize;
- */
+
mtd->ecclayout = layout;
mtd->oobavail = mtd->oobsize;
- mtd->oobsize = mtd->oobavail + layout->eccbytes;
mtd->subpage_sft = 0; /* We don't support sub-page writing. */
/* Configure the struct nand_ecclayout. */
- layout->oobavail = mtd->oobavail;
+ layout->eccbytes = 0;
+ layout->oobavail = mtd->oobsize;
layout->oobfree[0].offset = 0;
- layout->oobfree[0].length = layout->oobavail;
+ layout->oobfree[0].length = mtd->oobsize;
+
+ nand->ecc.layout = layout;
/* Configure the struct nand_chip. */
/*