aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/onenand
diff options
context:
space:
mode:
authorKyungmin Park <kyungmin.park@samsung.com>2010-11-01 21:28:46 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-12-03 11:27:18 -0500
commit08b3af3092bb2c284796e4e823c5309c2d0a9bca (patch)
tree0794fc9f3f68286ca1c295f29a52c0839805f4e7 /drivers/mtd/onenand
parentdaf05ec00c6e60a2c705820e7f93cbd31c804fe3 (diff)
mtd: OneNAND: Fix page offset handling at 2KiB pagesize
When use the 2KiB pagesize, it should be set the correct page offset. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/onenand')
-rw-r--r--drivers/mtd/onenand/samsung.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/mtd/onenand/samsung.c b/drivers/mtd/onenand/samsung.c
index 0de7a05e6de0..a4c74a9ba430 100644
--- a/drivers/mtd/onenand/samsung.c
+++ b/drivers/mtd/onenand/samsung.c
@@ -651,7 +651,7 @@ static int s5pc110_read_bufferram(struct mtd_info *mtd, int area,
651 void __iomem *p; 651 void __iomem *p;
652 void *buf = (void *) buffer; 652 void *buf = (void *) buffer;
653 dma_addr_t dma_src, dma_dst; 653 dma_addr_t dma_src, dma_dst;
654 int err, page_dma = 0; 654 int err, ofs, page_dma = 0;
655 struct device *dev = &onenand->pdev->dev; 655 struct device *dev = &onenand->pdev->dev;
656 656
657 p = this->base + area; 657 p = this->base + area;
@@ -677,10 +677,13 @@ static int s5pc110_read_bufferram(struct mtd_info *mtd, int area,
677 if (!page) 677 if (!page)
678 goto normal; 678 goto normal;
679 679
680 /* Page offset */
681 ofs = ((size_t) buf & ~PAGE_MASK);
680 page_dma = 1; 682 page_dma = 1;
683
681 /* DMA routine */ 684 /* DMA routine */
682 dma_src = onenand->phys_base + (p - this->base); 685 dma_src = onenand->phys_base + (p - this->base);
683 dma_dst = dma_map_page(dev, page, 0, count, DMA_FROM_DEVICE); 686 dma_dst = dma_map_page(dev, page, ofs, count, DMA_FROM_DEVICE);
684 } else { 687 } else {
685 /* DMA routine */ 688 /* DMA routine */
686 dma_src = onenand->phys_base + (p - this->base); 689 dma_src = onenand->phys_base + (p - this->base);