Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

authored by

Roman Tereshonkov and committed by
David Woodhouse
b3dcfd35 dcfb81d6

+3 -1
+2 -1
drivers/mtd/onenand/onenand_base.c
··· 4085 4085 mtd->writebufsize = mtd->writesize; 4086 4086 4087 4087 /* Unlock whole block */ 4088 - this->unlock_all(mtd); 4088 + if (!(this->options & ONENAND_SKIP_INITIAL_UNLOCKING)) 4089 + this->unlock_all(mtd); 4089 4090 4090 4091 ret = this->scan_bbt(mtd); 4091 4092 if ((!FLEXONENAND(this)) || ret)
+1
include/linux/mtd/onenand.h
··· 198 198 #define ONENAND_SKIP_UNLOCK_CHECK (0x0100) 199 199 #define ONENAND_PAGEBUF_ALLOC (0x1000) 200 200 #define ONENAND_OOBBUF_ALLOC (0x2000) 201 + #define ONENAND_SKIP_INITIAL_UNLOCKING (0x4000) 201 202 202 203 #define ONENAND_IS_4KB_PAGE(this) \ 203 204 (this->options & ONENAND_HAS_4KB_PAGE)