aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Weitzel <j.weitzel@phytec.de>2011-04-19 10:15:34 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2011-05-24 20:54:39 -0400
commita80f1c1f6a15e4eeba5c146ec9c5c0e12458abc5 (patch)
tree89bb15e27e4b8768c6c5f124a6f892534d9c8825
parent94735ec4044a6d318b83ad3c5794e931ed168d10 (diff)
mtd: omap2: mtd split nand_scan in ident and tail
nand_scan calls nand_scan_tail and here we got a ecc.layout and calculate oobavail for this layout. After calling nand_scan, we change the layout pointer if OMAP_ECC_HAMMING_CODE_HW_ROMCODE is set. This results in not calcluated oobavail. Mountig as jffs2 is not possible. To fix that nand_scan has to split up in nand_scan_ident and nand_scan_tail setting ecc.layout between these calls. So nand_scan_tail calculates oobvail for the used layout. This is also done in serveral other platforms. Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> Reviewed-by: Vimal Singh <vimal.newwork@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
-rw-r--r--drivers/mtd/nand/omap2.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index da9a351c9d7..288423f7b7b 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -1073,9 +1073,9 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
1073 /* DIP switches on some boards change between 8 and 16 bit 1073 /* DIP switches on some boards change between 8 and 16 bit
1074 * bus widths for flash. Try the other width if the first try fails. 1074 * bus widths for flash. Try the other width if the first try fails.
1075 */ 1075 */
1076 if (nand_scan(&info->mtd, 1)) { 1076 if (nand_scan_ident(&info->mtd, 1, NULL)) {
1077 info->nand.options ^= NAND_BUSWIDTH_16; 1077 info->nand.options ^= NAND_BUSWIDTH_16;
1078 if (nand_scan(&info->mtd, 1)) { 1078 if (nand_scan_ident(&info->mtd, 1, NULL)) {
1079 err = -ENXIO; 1079 err = -ENXIO;
1080 goto out_release_mem_region; 1080 goto out_release_mem_region;
1081 } 1081 }
@@ -1101,6 +1101,12 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
1101 info->nand.ecc.layout = &omap_oobinfo; 1101 info->nand.ecc.layout = &omap_oobinfo;
1102 } 1102 }
1103 1103
1104 /* second phase scan */
1105 if (nand_scan_tail(&info->mtd)) {
1106 err = -ENXIO;
1107 goto out_release_mem_region;
1108 }
1109
1104#ifdef CONFIG_MTD_PARTITIONS 1110#ifdef CONFIG_MTD_PARTITIONS
1105 err = parse_mtd_partitions(&info->mtd, part_probes, &info->parts, 0); 1111 err = parse_mtd_partitions(&info->mtd, part_probes, &info->parts, 0);
1106 if (err > 0) 1112 if (err > 0)