[PATCH] Add driver for M-sys / Sandisk diskonchip G4 nand flash

Mike Dunn mikedunn at newsguy.com
Tue Oct 11 15:17:22 EDT 2011


Hi Ivan.

Thanks!  I really appreciate your time and help.

On 10/11/2011 04:50 AM, Ivan Djelic wrote:
>
> After a more careful examination, I believe your hardware gives you
> recv_ecc^calc_ecc

It might be a little more complicated.

>
> Note that you must provide ecc_flash bytes (read from oob) to this function.

What I think I've found is that the hw-generated ecc that is written to oob when
a page is written is not the ecc generated by your algorithm.  I compiled bch.c
in userspace and patched it to print the calculated ecc when decode_bch() is
called with the 520 data bytes and (bogus) received ecc.  It's not bit-reversed,
either.

> If you provide ecc_flash[] = {0xff,0xff,0xff,0xff,0xff,0xff,0xff,}, (this
> happens when you read a blank page) then the output is cf72fc1ba9c7b9, which is
> consistent with your blank_read_hwecc[] array.

Hey! Well, you're on to something!

> If the above code does not work, I may still find the right permutation
> performed by your hw generator on input data. For this I just need a few
> samples of hw generated bytes. For instance, hw generated ecc bytes for:

Data below...

> - a page (520 bytes) filled with 0x00, except the first byte set to 0x01

d4 78 99 c2 7e 7c 7f

> - a page (520 bytes) filled with 0xff, except the first byte set to 0x55

70 f3 63 ce 4b 96 9a

Thanks again!
Mike




More information about the linux-mtd mailing list