summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorKyungmin Park <kyungmin.park@samsung.com>2006-05-12 17:02:46 +0300
committerJarkko Lavinen <lavinen@pentafluge.infradead.org>2006-05-12 15:35:47 +0100
commit34c1060959b61a5bb2e97a88411446028cebfa7c (patch)
tree74a58f5e63a2ee4d91d3cae4985ed55141c70aa0 /drivers/mtd
parent8e6ec69059ba0eecbb2226d3d9e45c6efe6fb82b (diff)
downloadlinux-34c1060959b61a5bb2e97a88411446028cebfa7c.tar.gz
linux-34c1060959b61a5bb2e97a88411446028cebfa7c.tar.bz2
linux-34c1060959b61a5bb2e97a88411446028cebfa7c.zip
OneNAND: Write oob area with aligned size, mtd->oobsize
There's some problem with write oob in serveral platform. So we write oob with oobsize aligned (16bytes) instead of 3 bytes (from {2, 3}) Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/onenand/onenand_base.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index e342ba04118a..6b950ab8ea8d 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -965,8 +965,11 @@ static int onenand_write_oob(struct mtd_info *mtd, loff_t to, size_t len,
this->command(mtd, ONENAND_CMD_BUFFERRAM, to, mtd->oobsize);
- this->write_bufferram(mtd, ONENAND_SPARERAM, ffchars, 0, mtd->oobsize);
- this->write_bufferram(mtd, ONENAND_SPARERAM, buf, column, thislen);
+ /* We send data to spare ram with oobsize
+ * to prevent byte access */
+ memset(this->page_buf, 0xff, mtd->oobsize);
+ memcpy(this->page_buf + column, buf, thislen);
+ this->write_bufferram(mtd, ONENAND_SPARERAM, this->page_buf, 0, mtd->oobsize);
this->command(mtd, ONENAND_CMD_PROGOOB, to, mtd->oobsize);