Aw: Re: Linux MTD: Per Partition ECC
Peter Barada
peter.barada at logicpd.com
Wed Feb 12 10:51:29 EST 2014
On 02/12/2014 02:44 AM, Ricard Wanderlof wrote:
>
> On Tue, 11 Feb 2014, Peter Barada wrote:
>
>> It may be possible to burn the bootloader into NAND using MTD_RAW_MODE
>> which _should_ disable all ECC for the operation, but in my case the ECC
>> generator is internal to the NAND chip itself and this won't work.
>>
>> I'm working on a possible solution in my linux-3.0 kernel, to modify
>> nand_get_device to take an extra pramater "no_ecc" which keys off
>> whether the NAND ops mode (if known) is MTD_OOB_RAW, and if so shut off
>> all ECC (including the in-chip ECC my NAND requires). Then every NAND
>> operation will enable/disable ECC while getting the controller lock.
>
> I'm sure I don't understand this properly, but in the first paragraph
> you state that the ECC generator is internal to the NAND chip so that
> you can't disable ECC on a per-write basis using MTD_RAW_MODE, then in
> the second paragraph above you say that you want to add a parameter
> which disables ECC. But that is what MTD_OOB_RAW is supposed to do
> isn't it?
>
> Or is the real problem here that in the default routines in
> nand_base.c there is no way of notifying the _nand_chip_ which mode
> we're in? It should be possible though if you replace the appropriate
> default callbacks with chip-specific ones.
>
> /Ricard
My apologies, I should have mentioned I'm working within linux-3.0 and
am trying to implement a solution for units that are already in the
field - updating to a newer kernel isn't feasible at this time. Some of
the issues I'm up against may already been addressed in newer kernels.
I'll pull a new kernel and look at backporting the new ioctl(MEMWRITE)
into my kernel to fix the write()/ioctl(MEMWRITEOOB) multiple page-write
problem.
Rather than adding multiple chip-specific callbacks (and subsequent
duplicated code), I think it might be cleaner to add a parameter to
nand_get_device() for the mode, and a chip-specific call that
enables/disables chip ECC if the mode changes from what the chip is in.
--
Peter Barada
peter.barada at logicpd.com
More information about the linux-mtd
mailing list