Aw: Re: Linux MTD: Per Partition ECC

Ricard Wanderlof ricard.wanderlof at axis.com
Wed Feb 12 02:48:18 EST 2014


On Wed, 12 Feb 2014, Brian Norris wrote:

>> In the process of using flashtool to burn NAND, it uses write() to burn
>> the data portion, and ioctl(MEMWRITEOOB) to burn the OOB area, but this
>> causes two writes to the same page, which violates Np for my NAND (i.e.
>> only one write per page).  I'm looking at creating a new ioctl entry
>> (MEMWRITEDATAOOB?) that takes both the data and oob buffers from
>> userspace and then burns them in one operation.
>
> Please do not create a new one. ioctl(MEMWRITE) already exists for this
> purpose. It can do page-at-a-time programming of data+OOB, and it even
> has a 'mode' field for choosing ECC vs. raw (no-ECC) programming. This
> is useful for any flash that doesn't support partial page programming.
> The nandwrite utility from mtd-utils supports this in Linux.

I don't know if it has changed lately, but I was just looking at how 
nandwrite handles writes in RAW mode, and it appears that it does two 
separate writes in this case, one for the OOB and one for the main area.

It seems to be done that way just because it was the easiest thing to do: 
at some point the nandwrite checks for raw mode write, and writes the oob 
then and there, followed by the ordinary write to the main area for all 
modes. Having a combined write to both areas at once would increase 
complexity, and I suppose it was just not needed at the time.

/Ricard
-- 
Ricard Wolf Wanderlöf                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30



More information about the linux-mtd mailing list