[U-Boot-Users] [PATCH] Write YAFFS filesystem images to NAND (Updated)

Frank Mandarino fmandarino at endrelia.com
Wed Dec 6 23:09:24 CET 2006

The attached patch updates my previous patch of Sept 9th, 2006 for the
latest versions of U-Boot and YAFFS.

It adds two sub-commands, "write.yaffs" and "write.yaffs1", to the nand
command set, which write YAFFS filesystem images generated by
mkyaffs2image and mkyaffsimage from RAM to NAND flash.

YAFFS images cannot be written using the normal nand write command
because they contain data which must be written to the NAND OOB area.

The "write.yaffs" command writes images generated by mkyaffs2image for
2048+64 NAND chips.  I do not have access to this type of chip, so it
has not been tested (any takers?).

The "write.yaffs1" command writes images generated by mkyaffsimage for
512+16 NAND.  It writes the older yaffs1 OOB format used by Linux
kernels before 2.6.18, or, by defining a CFG parameter, it writes the
newer OOB format used by Linux 2.6.18 and up.

This patch is much simpler than the previous version because the new
nand_util.c code contains most of the required functionality.  It uses
two CFG parameters:

 CFG_NAND_WRITE_YAFFS - enables the YAFFS writing code.

 CFG_NAND_WRITE_YAFFS1_NEW_OOB_LAYOUT - writes the OOB data in the
                        format used by Linux 2.6.18 and up.

I find it VERY convenient to write YAFFS filesystems in U-Boot,
especially the Linux root filesystem.  Without this patch, I need to
maintain a separate non-YAFFS root filesystem in NAND so that I can boot
Linux in order to update my YAFFS root filesystem.  This wastes
valuable NAND space and is more time-consuming.

Signed-off-by: Frank Mandarino <fmandarino at endrelia.com>

Frank Mandarino                                fmandarino(a)endrelia.com
Endrelia Technologies Inc.
Toronto, Ontario, Canada
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nand_write_yaffs-2.patch
Type: text/x-patch
Size: 2908 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20061206/fc773c60/attachment.bin 

More information about the U-Boot mailing list