mtd: new option is added to control onenand init unlocking
Subsystems (5)
cover mtd: new option is added to control onenand init unlocking
New variable skip_initial_unlocking is added to the omap_onenand_platform_data and new option ONENAND_SKIP_INITIAL_UNLOCKING is added to struct onenand_chip. This is used to to skip onenand unlocking when it is initialized.
Roman Tereshonkov (2):
mtd: onenand: add new option to control initial onenand unlocking
mtd: omap: add new variable to platform data to control onenand
unlocking
arch/arm/plat-omap/include/plat/onenand.h | 1 + drivers/mtd/onenand/omap2.c | 7 +++++-- drivers/mtd/onenand/onenand_base.c | 3 ++- include/linux/mtd/onenand.h | 1 + 4 files changed, 9 insertions(+), 3 deletions(-)
PATCH 1/2 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.
--- drivers/mtd/onenand/onenand_base.c | 3 ++- include/linux/mtd/onenand.h | 1 + 2 files changed, 3 insertions(+), 1 deletions(-)
drivers/mtd/onenand/onenand_base.c +2 -1
@@ -4084,7 +4084,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)
include/linux/mtd/onenand.h +1 -0
@@ -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)
Signature · 1 line
1.7.0.4
PATCH 2/2 mtd: omap: add new variable to platform data to control onenand unlocking
In reply to Roman TereshonkovNew variable skip_initial_unlocking is added to the omap_onenand_platform_data. This is used to inform the onenand driver to skip onenand unlocking when it is initialized.
--- arch/arm/plat-omap/include/plat/onenand.h | 1 + drivers/mtd/onenand/omap2.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-)
arch/arm/plat-omap/include/plat/onenand.h +1 -0
@@ -24,6 +24,7 @@ struct omap_onenand_platform_data {int dma_channel;u8 flags;u8 regulator_can_sleep; +u8 skip_initial_unlocking; };#define ONENAND_MAX_PARTITIONS 8
drivers/mtd/onenand/omap2.c +5 -2
@@ -629,6 +629,7 @@ static int __devinit omap2_onenand_probe(struct platform_device *pdev) {struct omap_onenand_platform_data *pdata;struct omap2_onenand *c; +struct onenand_chip *this;int r; pdata = pdev->dev.platform_data;
@@ -726,9 +727,8 @@ static int __devinit omap2_onenand_probe(struct platform_device *pdev) c->mtd.dev.parent = &pdev->dev; + this = &c->onenand;if (c->dma_channel >=0 ) { -struct onenand_chip *this = &c->onenand; - this->wait = omap2_onenand_wait;if (cpu_is_omap34xx ()) { this->read_bufferram = omap3_onenand_read_bufferram;
@@ -749,6 +749,9 @@ static int __devinit omap2_onenand_probe(struct platform_device *pdev) c->onenand.disable = omap2_onenand_disable; } +if (pdata->skip_initial_unlocking) + this->options |=ONENAND_SKIP_INITIAL_UNLOCKING ; +if ((r =onenand_scan (&c->mtd,1 )) <0 ) goto err_release_regulator;
Signature · 1 line
1.7.0.4
Quoted 3 lines · Roman Tereshonkov
New variable
skip_initial_unlockingis added to theomap_onenand_platform_dataand new optionONENAND_SKIP_INITIAL_UNLOCKINGis added to structonenand_chip. This is used to to skip onenand unlocking when it is initialized.
Pushed both patches to l2-mtd-2.6.git, thanks!
Signature · 2 lines
Best Regards, Artem Bityutskiy (Артём Битюцкий)