Signed-off-by:Frederic Rodo <[email protected]>
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
_______________________________________________
U-Boot mailing list
[email protected]
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to