From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ilko Iliev Date: Tue, 28 Oct 2008 11:45:21 +0100 Subject: [U-Boot] [PATCH] - fix "nand erase clean" problem In-Reply-To: <49061B54.2060904@freescale.com> References: <49049F6F.4070707@ronetix.at> <20081027185006.GA3693@ld0162-tx32.am.freescale.net> <490618E5.9080609@ronetix.at> <49061B54.2060904@freescale.com> Message-ID: <4906ED41.3080604@ronetix.at> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Scott, Scott Wood wrote: > Ilko Iliev wrote: >>> Why must the cleanmarker fit in the first free segment? >>> >> The Linux NAND driver looks for the cleanmarkers at this place. > > AFAICT, it does a read using MTD_OOB_AUTO, which can span multiple > free segments. Yes, but the current U-BOOT uses MTD_OOB_PLACE and the command "nand erase clean" marks all blocks as bad. > >>> What if oobsize > 64 (as with 4k pages)? Why write anything at all if >>> you're not going to write the cleanmarker? Why badblockpos & ~1 (I >>> know >>> existing code does it, but why)? >>> >> The current Linux NAND Flash driver supports 8, 16 and 64 bytes OOB. > > No need to add a place that will silently break if that changes, though. No, I think it will work also with OOB=128 bytes > > I think what needs to be done is a write to offset zero using > MTD_OOB_AUTO. If it doesn't fit, then an error will be returned. > >>> Set ooboffs to zero, and use MTD_OOB_AUTO. >>> >> I think the NAND driver should work not only with MTD_OOB_AUTO. > > Explain? MTD_OOB_AUTO is a feature of the NAND subsystem, which > automatically places user OOB data in the free regions described by > the low-level driver. It's not some hardware feature that may or may > not be present. At the moment U-BOOT doesn't use MTD_OOB_AUTO and the NAND flash can't be erased with "nand erase clean". I think this bug should be corrected instead of to switch to MTD_OOB_AUTO. -- Mit freundlichen Gr??en/With best regards, Ilko Iliev Ronetix Development Tools GmbH CPU Modules, JTAG/BDM Emulators and Flash Programmers Waidhausenstrasse 13/5, 1140 Vienna, Austria E-Mail: iliev at ronetix.at; Web: www.ronetix.at