mtd: onenand: add new option to control initial onenand unlocking
authorRoman Tereshonkov <roman.tereshonkov@nokia.com>
Thu, 17 Feb 2011 11:44:41 +0000 (13:44 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 11 Mar 2011 14:22:47 +0000 (14:22 +0000)
A new option ONENAND_SKIP_INITIAL_UNLOCKING is added. This allows
to disable initial onenand unlocking when the driver is initialized.

Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/onenand/onenand_base.c
include/linux/mtd/onenand.h

index 4205b9423b89cfe360b16317a65cb486ced9cf08..56a8b2005bdace6eb51fe500a040dc13f38c24b8 100644 (file)
@@ -4085,7 +4085,8 @@ int onenand_scan(struct mtd_info *mtd, int maxchips)
        mtd->writebufsize = mtd->writesize;
 
        /* Unlock whole block */
-       this->unlock_all(mtd);
+       if (!(this->options & ONENAND_SKIP_INITIAL_UNLOCKING))
+               this->unlock_all(mtd);
 
        ret = this->scan_bbt(mtd);
        if ((!FLEXONENAND(this)) || ret)
index ae418e41d8f52171c60b4352efbaa16c72da4cfc..52b6f187bf49bfdc3038dff70f3117eb4e9a1a97 100644 (file)
@@ -198,6 +198,7 @@ struct onenand_chip {
 #define ONENAND_SKIP_UNLOCK_CHECK      (0x0100)
 #define ONENAND_PAGEBUF_ALLOC          (0x1000)
 #define ONENAND_OOBBUF_ALLOC           (0x2000)
+#define ONENAND_SKIP_INITIAL_UNLOCKING (0x4000)
 
 #define ONENAND_IS_4KB_PAGE(this)                                      \
        (this->options & ONENAND_HAS_4KB_PAGE)