Commit 3328dc31 authored by Kyungmin Park's avatar Kyungmin Park Committed by David Woodhouse

mtd: onenand: add new callback for bufferram read

This patch adds a new callback for the underlying drivers, which is
called instead of accessing the buffer ram directly. This callback will
be used by Samsung OneNAND driver to implement DMA transfers on S5PC110
SoC.
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 4a8ce0b0
...@@ -1635,7 +1635,6 @@ static int onenand_verify_oob(struct mtd_info *mtd, const u_char *buf, loff_t to ...@@ -1635,7 +1635,6 @@ static int onenand_verify_oob(struct mtd_info *mtd, const u_char *buf, loff_t to
static int onenand_verify(struct mtd_info *mtd, const u_char *buf, loff_t addr, size_t len) static int onenand_verify(struct mtd_info *mtd, const u_char *buf, loff_t addr, size_t len)
{ {
struct onenand_chip *this = mtd->priv; struct onenand_chip *this = mtd->priv;
void __iomem *dataram;
int ret = 0; int ret = 0;
int thislen, column; int thislen, column;
...@@ -1655,10 +1654,9 @@ static int onenand_verify(struct mtd_info *mtd, const u_char *buf, loff_t addr, ...@@ -1655,10 +1654,9 @@ static int onenand_verify(struct mtd_info *mtd, const u_char *buf, loff_t addr,
onenand_update_bufferram(mtd, addr, 1); onenand_update_bufferram(mtd, addr, 1);
dataram = this->base + ONENAND_DATARAM; this->read_bufferram(mtd, ONENAND_DATARAM, this->verify_buf, 0, mtd->writesize);
dataram += onenand_bufferram_offset(mtd, ONENAND_DATARAM);
if (memcmp(buf, dataram + column, thislen)) if (memcmp(buf, this->verify_buf, thislen))
return -EBADMSG; return -EBADMSG;
len -= thislen; len -= thislen;
......
...@@ -212,6 +212,8 @@ struct mtd_partition; ...@@ -212,6 +212,8 @@ struct mtd_partition;
struct onenand_platform_data { struct onenand_platform_data {
void (*mmcontrol)(struct mtd_info *mtd, int sync_read); void (*mmcontrol)(struct mtd_info *mtd, int sync_read);
int (*read_bufferram)(struct mtd_info *mtd, int area,
unsigned char *buffer, int offset, size_t count);
struct mtd_partition *parts; struct mtd_partition *parts;
unsigned int nr_parts; unsigned int nr_parts;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment