Commit b3dcfd35 authored by Roman Tereshonkov's avatar Roman Tereshonkov Committed by David Woodhouse

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: default avatarRoman Tereshonkov <roman.tereshonkov@nokia.com>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent dcfb81d6
...@@ -4085,7 +4085,8 @@ int onenand_scan(struct mtd_info *mtd, int maxchips) ...@@ -4085,7 +4085,8 @@ int onenand_scan(struct mtd_info *mtd, int maxchips)
mtd->writebufsize = mtd->writesize; mtd->writebufsize = mtd->writesize;
/* Unlock whole block */ /* Unlock whole block */
this->unlock_all(mtd); if (!(this->options & ONENAND_SKIP_INITIAL_UNLOCKING))
this->unlock_all(mtd);
ret = this->scan_bbt(mtd); ret = this->scan_bbt(mtd);
if ((!FLEXONENAND(this)) || ret) if ((!FLEXONENAND(this)) || ret)
......
...@@ -198,6 +198,7 @@ struct onenand_chip { ...@@ -198,6 +198,7 @@ struct onenand_chip {
#define ONENAND_SKIP_UNLOCK_CHECK (0x0100) #define ONENAND_SKIP_UNLOCK_CHECK (0x0100)
#define ONENAND_PAGEBUF_ALLOC (0x1000) #define ONENAND_PAGEBUF_ALLOC (0x1000)
#define ONENAND_OOBBUF_ALLOC (0x2000) #define ONENAND_OOBBUF_ALLOC (0x2000)
#define ONENAND_SKIP_INITIAL_UNLOCKING (0x4000)
#define ONENAND_IS_4KB_PAGE(this) \ #define ONENAND_IS_4KB_PAGE(this) \
(this->options & ONENAND_HAS_4KB_PAGE) (this->options & ONENAND_HAS_4KB_PAGE)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment