aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/onenand/onenand_base.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/onenand/onenand_base.c')
-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 }