diff options
Diffstat (limited to 'drivers/mtd/onenand/onenand_base.c')
-rw-r--r-- | drivers/mtd/onenand/onenand_base.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c index 2ea07f5723d1..2da6bb26353e 100644 --- a/drivers/mtd/onenand/onenand_base.c +++ b/drivers/mtd/onenand/onenand_base.c | |||
@@ -710,7 +710,7 @@ static int onenand_read(struct mtd_info *mtd, loff_t from, size_t len, | |||
710 | struct mtd_ecc_stats stats; | 710 | struct mtd_ecc_stats stats; |
711 | int read = 0, column; | 711 | int read = 0, column; |
712 | int thislen; | 712 | int thislen; |
713 | int ret = 0; | 713 | int ret = 0, boundary = 0; |
714 | 714 | ||
715 | DEBUG(MTD_DEBUG_LEVEL3, "onenand_read: from = 0x%08x, len = %i\n", (unsigned int) from, (int) len); | 715 | DEBUG(MTD_DEBUG_LEVEL3, "onenand_read: from = 0x%08x, len = %i\n", (unsigned int) from, (int) len); |
716 | 716 | ||
@@ -749,6 +749,17 @@ static int onenand_read(struct mtd_info *mtd, loff_t from, size_t len, | |||
749 | from += thislen; | 749 | from += thislen; |
750 | if (read + thislen < len) { | 750 | if (read + thislen < len) { |
751 | this->command(mtd, ONENAND_CMD_READ, from, mtd->writesize); | 751 | this->command(mtd, ONENAND_CMD_READ, from, mtd->writesize); |
752 | /* | ||
753 | * Chip boundary handling in DDP | ||
754 | * Now we issued chip 1 read and pointed chip 1 | ||
755 | * bufferam so we have to point chip 0 bufferam. | ||
756 | */ | ||
757 | if (this->device_id & ONENAND_DEVICE_IS_DDP && | ||
758 | unlikely(from == (this->chipsize >> 1))) { | ||
759 | this->write_word(0, this->base + ONENAND_REG_START_ADDRESS2); | ||
760 | boundary = 1; | ||
761 | } else | ||
762 | boundary = 0; | ||
752 | ONENAND_SET_PREV_BUFFERRAM(this); | 763 | ONENAND_SET_PREV_BUFFERRAM(this); |
753 | } | 764 | } |
754 | /* While load is going, read from last bufferRAM */ | 765 | /* While load is going, read from last bufferRAM */ |
@@ -758,6 +769,8 @@ static int onenand_read(struct mtd_info *mtd, loff_t from, size_t len, | |||
758 | if (read == len) | 769 | if (read == len) |
759 | break; | 770 | break; |
760 | /* Set up for next read from bufferRAM */ | 771 | /* Set up for next read from bufferRAM */ |
772 | if (unlikely(boundary)) | ||
773 | this->write_word(0x8000, this->base + ONENAND_REG_START_ADDRESS2); | ||
761 | ONENAND_SET_NEXT_BUFFERRAM(this); | 774 | ONENAND_SET_NEXT_BUFFERRAM(this); |
762 | buf += thislen; | 775 | buf += thislen; |
763 | thislen = min_t(int, mtd->writesize, len - read); | 776 | thislen = min_t(int, mtd->writesize, len - read); |