* [PATCH 0/2] mtd: new option is added to control onenand init unlocking
@ 2011-02-17 11:44 Roman Tereshonkov
2011-02-17 11:44 ` [PATCH 1/2] mtd: onenand: add new option to control initial onenand unlocking Roman Tereshonkov
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Roman Tereshonkov @ 2011-02-17 11:44 UTC (permalink / raw)
To: linux-mtd; +Cc: kyungmin.park, Roman Tereshonkov
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(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] mtd: onenand: add new option to control initial onenand unlocking
2011-02-17 11:44 [PATCH 0/2] mtd: new option is added to control onenand init unlocking Roman Tereshonkov
@ 2011-02-17 11:44 ` Roman Tereshonkov
2011-02-17 11:44 ` [PATCH 2/2] mtd: omap: add new variable to platform data to control " Roman Tereshonkov
2011-02-25 9:01 ` [PATCH 0/2] mtd: new option is added to control onenand init unlocking Artem Bityutskiy
2 siblings, 0 replies; 4+ messages in thread
From: Roman Tereshonkov @ 2011-02-17 11:44 UTC (permalink / raw)
To: linux-mtd; +Cc: kyungmin.park, Roman Tereshonkov
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>
---
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 557a06e..46977bc 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -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)
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)
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] mtd: omap: add new variable to platform data to control onenand unlocking
2011-02-17 11:44 [PATCH 0/2] mtd: new option is added to control onenand init unlocking Roman Tereshonkov
2011-02-17 11:44 ` [PATCH 1/2] mtd: onenand: add new option to control initial onenand unlocking Roman Tereshonkov
@ 2011-02-17 11:44 ` Roman Tereshonkov
2011-02-25 9:01 ` [PATCH 0/2] mtd: new option is added to control onenand init unlocking Artem Bityutskiy
2 siblings, 0 replies; 4+ messages in thread
From: Roman Tereshonkov @ 2011-02-17 11:44 UTC (permalink / raw)
To: linux-mtd; +Cc: kyungmin.park, Roman Tereshonkov
New 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.
Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com>
---
arch/arm/plat-omap/include/plat/onenand.h | 1 +
drivers/mtd/onenand/omap2.c | 7 +++++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/arm/plat-omap/include/plat/onenand.h b/arch/arm/plat-omap/include/plat/onenand.h
index affe87e..1b430d5 100644
--- a/arch/arm/plat-omap/include/plat/onenand.h
+++ b/arch/arm/plat-omap/include/plat/onenand.h
@@ -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
diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c
index 1e49b65..13e779e 100644
--- a/drivers/mtd/onenand/omap2.c
+++ b/drivers/mtd/onenand/omap2.c
@@ -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;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] mtd: new option is added to control onenand init unlocking
2011-02-17 11:44 [PATCH 0/2] mtd: new option is added to control onenand init unlocking Roman Tereshonkov
2011-02-17 11:44 ` [PATCH 1/2] mtd: onenand: add new option to control initial onenand unlocking Roman Tereshonkov
2011-02-17 11:44 ` [PATCH 2/2] mtd: omap: add new variable to platform data to control " Roman Tereshonkov
@ 2011-02-25 9:01 ` Artem Bityutskiy
2 siblings, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2011-02-25 9:01 UTC (permalink / raw)
To: Roman Tereshonkov; +Cc: kyungmin.park, linux-mtd
On Thu, 2011-02-17 at 13:44 +0200, Roman Tereshonkov wrote:
> 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.
Pushed both patches to l2-mtd-2.6.git, thanks!
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-02-25 9:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-17 11:44 [PATCH 0/2] mtd: new option is added to control onenand init unlocking Roman Tereshonkov
2011-02-17 11:44 ` [PATCH 1/2] mtd: onenand: add new option to control initial onenand unlocking Roman Tereshonkov
2011-02-17 11:44 ` [PATCH 2/2] mtd: omap: add new variable to platform data to control " Roman Tereshonkov
2011-02-25 9:01 ` [PATCH 0/2] mtd: new option is added to control onenand init unlocking Artem Bityutskiy
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.