From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.newsguy.com ([74.209.136.69]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1RDhq0-0006UD-OE for linux-mtd@lists.infradead.org; Tue, 11 Oct 2011 19:18:05 +0000 Message-ID: <4E949642.9020209@newsguy.com> Date: Tue, 11 Oct 2011 12:17:22 -0700 From: Mike Dunn MIME-Version: 1.0 To: Ivan Djelic Subject: Re: [PATCH] Add driver for M-sys / Sandisk diskonchip G4 nand flash References: <1318258091-12670-1-git-send-email-mikedunn@newsguy.com> <201110101751.19010.marek.vasut@gmail.com> <20111010181210.GA23655@parrot.com> <4E935D5D.4050504@newsguy.com> <20111011115034.GA28920@parrot.com> In-Reply-To: <20111011115034.GA28920@parrot.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Marek Vasut , "robert.jarzmik@free.fr" , "linux-mtd@lists.infradead.org" List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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