I'm currently working on an embedded system which uses a NAND flash as it main storage. Bootloader + Kernel + rootfs are written to it, and we are looking for ways to make our system more robust to the many issues related to NAND.Currently, we have the kernel and rootfs partitions on top of JFFS2, and we are trying to find a way to safeguard out bootloader partititions (we are using SPL plus U-Boot).Our processor is capable of looking into the first 4 blocks of flash automatically for an uncorrupted SPL image, and I would like to have something similar for U-Boot. However, I checked through the U-Boot code, and did not find any way to enable such a feature.Is this even supported by U-Boot? I tried hacking my own code to do this, but no luck so far.tl;dr: I want to be able to detect if I have a bad U-Boot image on NAND, and if so, boot from another (hopefully) uncorrupted partition.
Redundant U-Boot images
boot loader;u boot
So, I managed to implement a simple check and boot from a redundant image. All you have to do is catch the return code from a call to ecc.correct() and treat it in the spl_nand_load_image() function. I posted a patch here.