public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* MLC controller embedded in the NXP LPC32xx ARM CPU
@ 2009-11-25 16:46 Gabriele Mondada
  2009-11-30  9:07 ` Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: Gabriele Mondada @ 2009-11-25 16:46 UTC (permalink / raw)
  To: linux-mtd

Hi,

I'm starting to write the mtd driver for the MLC controller embedded in the NXP LPC32x0 ARM CPU. To prevent redoing existing code and to test my understanding, here are my "specs":

This controller has an hardware ECC. The ECC is performed on 512 bytes (user) + 6 bytes (oob) and produces 10 bytes code. The OOB data is covered by the ECC and cannot be handled separately from the user data. When using 2048 + 64 bytes pages (it's my case), the ECC must be performed 4 times. ECC codes will be inserted each 518 bytes, and not at the end of the page as usual.

The controller is described at page 158 of http://www.nxp.com/documents/user_manual/UM10326.pdf

The driver should not support OOB because it cannot do that in the standard mtd way. I can define the 6 bytes of OOB as part of the user data. This results in pages of 518 or 2072 bytes. Is there any problem with UBIFS or whatever else ?

For 2048 + 16 bytes pages, I plan to set ecc.steps=4, ecc.bytes=512, ecc.bytes=10 and mtd->oobsize=0 (maybe 40 ?) but I'm not sure that this combinaiton works (especially because mtd->oobsize=0). The ecc.calculate() method will read/write the discarded OOB bytes (6) and the ECC bytes (10). It also asks to the ECC hardware controller if data is correct and retrieves the corrected data if needed. The function ecc.correct() does nothing.

Do you think is the right way ? Any suggestion ?
Thanks a lot,
Gabriele

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: MLC controller embedded in the NXP LPC32xx ARM CPU
  2009-11-25 16:46 MLC controller embedded in the NXP LPC32xx ARM CPU Gabriele Mondada
@ 2009-11-30  9:07 ` Artem Bityutskiy
  0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2009-11-30  9:07 UTC (permalink / raw)
  To: Gabriele Mondada; +Cc: linux-mtd

Hi,

On Wed, 2009-11-25 at 17:46 +0100, Gabriele Mondada wrote:
> I'm starting to write the mtd driver for the MLC controller embedded
> in the NXP LPC32x0 ARM CPU. To prevent redoing existing code and to
> test my understanding, here are my "specs":
> 
> This controller has an hardware ECC. The ECC is performed on 512 bytes
> (user) + 6 bytes (oob) and produces 10 bytes code. The OOB data is
> covered by the ECC and cannot be handled separately from the user
> data. When using 2048 + 64 bytes pages (it's my case), the ECC must be
> performed 4 times. ECC codes will be inserted each 518 bytes, and not
> at the end of the page as usual.
> 
> The controller is described at page 158 of
> http://www.nxp.com/documents/user_manual/UM10326.pdf
> 
> The driver should not support OOB because it cannot do that in the
> standard mtd way. I can define the 6 bytes of OOB as part of the user
> data. This results in pages of 518 or 2072 bytes. Is there any problem
> with UBIFS or whatever else ?

First of all, can you really make it 518/2072? Will all data be covered
by ECC? Everything must be covered by ECC, especially for MLC.

Yes, UBI/UBIFS would not work, because current code assumes page size is
power of 2, for optimization purposes. So you would have 2 choices, if
you had to use UBI/UBIFS:

1. modify UBI/UBIFS so that it does not assume power of 2 min. I/O unit
sizes as it does now. This should not be extremely difficult to do.

2. Waste 6/24 bytes and report 512/2048 to the userspace.

Also, UBIFS was never tested with non power-of-two page sizes, so if you
go for 1., you could reveal some problems as well.

> For 2048 + 16 bytes pages, I plan to set ecc.steps=4, ecc.bytes=512,
> ecc.bytes=10 and mtd->oobsize=0 (maybe 40 ?)
>  but I'm not sure that this combinaiton works (especially because
> mtd->oobsize=0). The ecc.calculate() method will read/write the
> discarded OOB bytes (6) and the ECC bytes (10). It also asks to the
> ECC hardware controller if data is correct and retrieves the corrected
> data if needed. The function ecc.correct() does nothing.

I guess in your case mtd->oobsize=0 is the most sensible choice.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-30  9:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-25 16:46 MLC controller embedded in the NXP LPC32xx ARM CPU Gabriele Mondada
2009-11-30  9:07 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox