]> err.no Git - linux-2.6/commitdiff
OneNAND: Write oob area with aligned size, mtd->oobsize
authorKyungmin Park <kyungmin.park@samsung.com>
Fri, 12 May 2006 14:02:46 +0000 (17:02 +0300)
committerJarkko Lavinen <lavinen@pentafluge.infradead.org>
Fri, 12 May 2006 14:35:47 +0000 (15:35 +0100)
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>
drivers/mtd/onenand/onenand_base.c

index e342ba04118a642be1fc24b563e259b41d5ed188..6b950ab8ea8d5224dd2885b00a1a84a536e3677c 100644 (file)
@@ -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);