mtd: onenand: add new option to control initial onenand unlocking
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Fri Mar 11 10:59:05 EST 2011
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=b3dcfd35244e1cb8dc8dfa5c05013b133dbb437a
Commit: b3dcfd35244e1cb8dc8dfa5c05013b133dbb437a
Parent: dcfb81d61da1367e52f7f7e3ceff0d0044c3c7ee
Author: Roman Tereshonkov <roman.tereshonkov at nokia.com>
AuthorDate: Thu Feb 17 13:44:41 2011 +0200
Committer: David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Mar 11 14:22:47 2011 +0000
mtd: onenand: add new option to control initial onenand unlocking
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 at nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
drivers/mtd/onenand/onenand_base.c | 3 ++-
include/linux/mtd/onenand.h | 1 +
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index 4205b94..56a8b20 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -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)
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h
index ae418e4..52b6f18 100644
--- a/include/linux/mtd/onenand.h
+++ b/include/linux/mtd/onenand.h
@@ -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)
More information about the linux-mtd-cvs
mailing list