Skip to contentSkip to conversation

OneNAND: write oob with oobsize to prevent byte access

PATCH New Kyungmin Park 1 participant 1 message Jan 26, 2006 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

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
diff -u -p -r1.15 onenand_base.c
@@ -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);