[U-Boot] freescale i.MX28 mxsboot NAND booting on mx28evk bad blocks
Paul B. Henson
henson at acm.org
Sat Apr 6 06:28:53 CEST 2013
On 4/4/2013 3:09 AM, Trent Piepho wrote:
> It's something to do with the way u-boot writes to nand. If I write
> with nandwrite it doesn't happen, nandtest doesn't find any bad
Hmm, I'm pretty sure I tested burning the u-boot generated nand image
with nandwrite under Linux with exactly the same result, it seems to be
inherent in the underlying data, not the burn method.
Did you use the --oob option to nandwrite? The u-boot generated image is
actually written in two separate steps, the initial piece is written raw
and includes oob data, the second piece is written normally and the
ecc/oob is generated by the hardware. To burn it under linux, you need
to split the u-boot nand image into those two pieces, and write the
first with -oob, and the second normally.
> A bad block on that chip is marked with a non-0xff as the first OOB
> byte in the 1st page of a block. So, my guess is that when u-boot
> writes the FCB data it also writes something to the OOB data.
Yes, as would linux if you used the --oob option to nandwrite.
> You said you've booted from NAND. Did you have to program any of the
> OTP fuses to do this?
No. All I did was install the actual NAND chip and update the boot dip
switches. Testing u-boot, I followed the script in the default
environment other than updating it to load the firmware from SD rather
than tftp. For testing under Linux, I used dd to split the u-boot nand
image into two pieces, corresponding to the u-boot burn instructions.
> nandwrite didn't seem to want to program the blocks after they were
> marked bad. The only way fix this seemed to be to scrub nand from
> u-boot. So it's a problem if you want to be able to flash the
> bootloader from Linux, unless there is some way to get the blocks
> written when they have been marked bad.
No, from what I understand there is no way to clear bad block markers
from within linux short of modifying the mtd driver.
I followed up with Otavio off list, he said he had ordered some nand
chips for his board and would get back to me once he had received them
and had a chance to replicate the issue.
Are you targeting burning the nand with u-boot or linux? If you are
using an older kernel, the kobs-ng that comes with the mx28 BSP works
fine. It does not work with newer kernels though, there is a newer
version of kobs-ng that comes with a different chip BSP that I've heard
will work correctly on current kernels, it is on my to do list to try it
out.
More information about the U-Boot
mailing list