[U-Boot] [U-Boot-v2][PATCH] imx27: set pagesize_2k after probing the nand flash
frederic rodo
fred.rodo at gmail.com
Mon Dec 15 14:40:30 CET 2008
Signed-off-by:Frederic Rodo <fred.rodo at gmail.com>
Date: Mon, 15 Dec 2008 14:37:18 +0100
Subject: [PATCH] set pagesize_2k after probing the nand flash
---
drivers/nand/nand_imx.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/nand/nand_imx.c b/drivers/nand/nand_imx.c
index fbef9b7..d15c6b0 100644
--- a/drivers/nand/nand_imx.c
+++ b/drivers/nand/nand_imx.c
@@ -1056,16 +1056,24 @@ static int __init imxnd_probe(struct device_d *dev)
this->ecc.layout = &nand_hw_eccoob_16;
}
- host->pagesize_2k = 0;
-
/* Scan to find existence of the device */
- if (nand_scan(mtd, 1)) {
+ if (nand_scan_ident(mtd, 1)) {
DEBUG(MTD_DEBUG_LEVEL0,
"MXC_ND: Unable to find any NAND device.\n");
err = -ENXIO;
goto escan;
}
+ if (mtd->writesize == 2048)
+ host->pagesize_2k = 1;
+
+ if (nand_scan_tail(mtd)) {
+ DEBUG(MTD_DEBUG_LEVEL0,
+ "MXC_ND: Unable to initialize the NAND device.\n");
+ err = -ENXIO;
+ goto escan;
+ }
+
add_mtd_device(mtd);
#ifdef CONFIG_MXC_NAND_LOW_LEVEL_ERASE
--
1.4.4.4
More information about the U-Boot
mailing list