提交 9aba97ad 编写于 作者: K Kyungmin Park 提交者: David Woodhouse

mtd: OneNAND: Fix 2KiB pagesize handling at Samsung SoCs

Wrong assumption bufferram can be switched between BufferRAM0 and BufferRAM1
Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
上级 8b865d5e
...@@ -571,13 +571,12 @@ static int s5pc110_read_bufferram(struct mtd_info *mtd, int area, ...@@ -571,13 +571,12 @@ static int s5pc110_read_bufferram(struct mtd_info *mtd, int area,
unsigned char *buffer, int offset, size_t count) unsigned char *buffer, int offset, size_t count)
{ {
struct onenand_chip *this = mtd->priv; struct onenand_chip *this = mtd->priv;
void __iomem *bufferram;
void __iomem *p; void __iomem *p;
void *buf = (void *) buffer; void *buf = (void *) buffer;
dma_addr_t dma_src, dma_dst; dma_addr_t dma_src, dma_dst;
int err; int err;
p = bufferram = this->base + area; p = this->base + area;
if (ONENAND_CURRENT_BUFFERRAM(this)) { if (ONENAND_CURRENT_BUFFERRAM(this)) {
if (area == ONENAND_DATARAM) if (area == ONENAND_DATARAM)
p += this->writesize; p += this->writesize;
...@@ -621,7 +620,7 @@ static int s5pc110_read_bufferram(struct mtd_info *mtd, int area, ...@@ -621,7 +620,7 @@ static int s5pc110_read_bufferram(struct mtd_info *mtd, int area,
normal: normal:
if (count != mtd->writesize) { if (count != mtd->writesize) {
/* Copy the bufferram to memory to prevent unaligned access */ /* Copy the bufferram to memory to prevent unaligned access */
memcpy(this->page_buf, bufferram, mtd->writesize); memcpy(this->page_buf, p, mtd->writesize);
p = this->page_buf + offset; p = this->page_buf + offset;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册