[U-Boot-Users] NAND "bad block" support

Stefan Roese
2007-08-06T15:30:44Z

Hi Shai,

On Monday 06 August 2007, Shai Lifshitz wrote:
> I am planning to use the U-Boot to load the Linux operating system that is
> stored on a NAND flash.
>
> The UBoot main role (beside other tasks) is to load the linux kernel and
> file-system from the NAND flash to the RAM, and start the linux.
> Another role of UBoot is to get the kernel and file-system from the
> ethernet, and burn it to the NAND flash.

OK, that's what U-Boot is designed for.

> What is the preferred way to treat the "bad block" problem in writing (not
> writing to bad blocks, and checking the status after programming/erasing)
> and reading (jumping over bad blocks).
>
> 1) Does normal read/write coop with these issues?

Yes.

> 2) In the NAND documentation it says that the "shipped bad blocks" have to
> be checked prior to any erase operations. Does the UBoot leave the bad
> blocks untouched during the erase operation?

Yes.

> 3) Do you recommend to use JFFS2 file-system just to save/read the
> kernel/file-system images?

The kernel doesn't need to be saved in a filesystem at all. I would reserve
one flash partition for it and read/write it from there. Some goes for the
root filesystem if you don't have to write to it from Linux. You could use
cramfs, romfs, initrd etc.

BTW: Please note that U-Boot "only" supports JFFS2 read operations. For
writing to NAND (and NOR...) you will have to write raw data to the chip. But
that's what the interface is designed for and what is already working in lots
of projects.