aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyungmin Park <kyungmin.park@samsung.com>2007-01-11 15:45:34 -0500
committerKyungmin Park <kyungmin.park@samsung.com>2007-01-17 20:59:16 -0500
commit10b7a2bd6bf3510cbb5977a44d8822f085738729 (patch)
tree356edce5bfd25dcffe3595da27ab37ab0d880def
parent9cdf083f981b8d37b3212400a359368661385099 (diff)
[MTD] OneNAND: Fix unlock all status error
We have to set ONENAND_REG_START_BLOCK_ADDRESS to avoid status error Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
-rw-r--r--drivers/mtd/onenand/onenand_base.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index 2da6bb26353e..d0f31183d58f 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -1491,6 +1491,8 @@ static int onenand_unlock_all(struct mtd_info *mtd)
1491 struct onenand_chip *this = mtd->priv; 1491 struct onenand_chip *this = mtd->priv;
1492 1492
1493 if (this->options & ONENAND_HAS_UNLOCK_ALL) { 1493 if (this->options & ONENAND_HAS_UNLOCK_ALL) {
1494 /* Set start block address */
1495 this->write_word(0, this->base + ONENAND_REG_START_BLOCK_ADDRESS);
1494 /* Write unlock command */ 1496 /* Write unlock command */
1495 this->command(mtd, ONENAND_CMD_UNLOCK_ALL, 0, 0); 1497 this->command(mtd, ONENAND_CMD_UNLOCK_ALL, 0, 0);
1496 1498
@@ -1504,12 +1506,9 @@ static int onenand_unlock_all(struct mtd_info *mtd)
1504 1506
1505 /* Workaround for all block unlock in DDP */ 1507 /* Workaround for all block unlock in DDP */
1506 if (this->device_id & ONENAND_DEVICE_IS_DDP) { 1508 if (this->device_id & ONENAND_DEVICE_IS_DDP) {
1507 loff_t ofs;
1508 size_t len;
1509
1510 /* 1st block on another chip */ 1509 /* 1st block on another chip */
1511 ofs = this->chipsize >> 1; 1510 loff_t ofs = this->chipsize >> 1;
1512 len = 1 << this->erase_shift; 1511 size_t len = mtd->erasesize;
1513 1512
1514 onenand_unlock(mtd, ofs, len); 1513 onenand_unlock(mtd, ofs, len);
1515 } 1514 }