OneNAND: write oob with oobsize to prevent byte access
PATCH 1/1 OneNAND: write oob with oobsize to prevent byte access
Hi
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})
If you don't mind I will commit this with write oob verify patch from Jarkko Lavinen
Regards,
Kyungmin Park
Index: drivers/mtd/onenand/onenand_base.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/onenand/onenand_base.c,v retrieving revision 1.15
mtd/onenand/onenand_base.c +0 -1
@@ -936,8 +936,11 @@ static int onenand_write_oob(struct mtd_ 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);