1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
4 <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-1">
6 <META NAME="GENERATOR" CONTENT="StarOffice/5.2 (Linux)">
7 <META NAME="CREATED" CONTENT="20020517;23103700">
8 <META NAME="CHANGEDBY" CONTENT=" ">
9 <META NAME="CHANGED" CONTENT="20021126;14003000">
12 <H2 ALIGN=CENTER>Running up YAFFS using the MTD interface</H2>
13 <P>Here are the steps required to get YAFFS going with the
14 NANDemulation MTD that I have written.</P>
15 <P><FONT COLOR="#800000"><FONT SIZE=4 STYLE="font-size: 16pt"><I><U><B>Warning:
16 This is experimental stuff that plugs into the kernel. It has only
17 been lightly tested. Don't play with this on a box you are not
18 prepared to reboot.</B></U></I></FONT></FONT></P>
19 <P>There are a few things you need to do. This document assumes that
20 you're working from the 2.4.18 kernel code base.</P>
21 <H3>Preparing the kernel</H3>
22 <P>First off, you need to patch the mtdcore services.</P>
24 <LI><P>Replace the mtd files with the latest from the mtd cvs. This
25 fixes problems where special NAND functions are not being copied
26 through the partition handler.
28 <LI><P>Build the kernel including the following configurations to
31 <P STYLE="margin-left: 2cm">CONFIG_MTD=y Turn on MTD support</P>
32 <P STYLE="margin-left: 2cm">CONFIG_MTD_PARTITIONS=y Turn on partition
34 <P STYLE="margin-left: 2cm">CONFIG_MTD_CHAR=y Need char drivers to
35 access the data from user space.</P>
36 <P STYLE="margin-left: 2cm">CONFIG_MTD_BLOCK=y Block driver interface
37 used only to find the device for mounting</P>
38 <P STYLE="margin-left: 2cm">may as well also set:</P>
39 <P STYLE="margin-left: 2cm">CONFIG_MTD_DEBUG=y</P>
41 <P>CONFIG_MTD_DEBUG_VERBOSE=3</P>
43 <H3 ALIGN=LEFT>Setting up yaffs</H3>
45 <LI><P>Run the mtd utility MAKEDEV to make the /dev/mtdxxx entries.</P>
46 <LI><P>Load up the NANDemul MTD by typing<BR><FONT FACE="Courier, monospace">#/sbin/insmod
47 mtdemul/nandemul.o</FONT><BR>You should now be able to see the
48 device in the mtd list by typing <BR>#<FONT FACE="Courier, monospace">cat
49 /proc/mtd</FONT><BR>If all is well, the device will now be
50 accessible as <FONT FACE="Courier, monospace">/dev/mtd0</FONT> and
51 <FONT FACE="Courier, monospace">/dev/mtdblock0</FONT> (or whatever).</P>
52 <LI><P>Now load up the yaffs filesystem module by
53 typing<BR><FONT FACE="Courier, monospace">#/sbin/insmod
54 mtdemul/yaffs.o<BR><FONT FACE="Times, serif">You should now be able
55 to see the yaffs file systems by typing</FONT><BR>#cat
56 /proc/filesystems</FONT></P>
57 <LI><P><FONT FACE="Times, serif">Now create a mount point:<BR><FONT FACE="Courier, monospace">#mkdir
58 /mnt/y</FONT></FONT></P>
59 <LI><P><FONT FACE="Times, serif">Mount the file system:<BR><FONT FACE="Courier, monospace">#mount
60 -t yaffs /dev/mtdblock0 /mnt/y</FONT></FONT></P>
61 <LI><P><FONT FACE="Times, serif">Well if that all worked you have
62 YAFFS running on the /mnt/y mount point using the NANDemul mtd.</FONT></P>
64 <H3>What about real NAND?</H3>
65 <P><FONT FACE="Times, serif">You might want to try getting going on a
66 real NAND device.</FONT></P>
67 <P><FONT FACE="Times, serif">I have not yet done this, but the
68 NANDemul tests out the mtd interface so in theory it should work on
69 real NAND too.</FONT></P>
70 <P><FONT FACE="Times, serif">Note though that since YAFFS applies the
71 ECC and verify, it does not expect the NAND device to be applying ECC
72 or verification. </FONT>
74 <P><FONT FACE="Times, serif">You probably need to configure the NAND
75 with the following disabled:</FONT></P>
76 <P><FONT FACE="Times, serif">CONFIG_MTD_NAND_ECC</FONT></P>
77 <P><FONT FACE="Times, serif">CONFIG_MTD_NAND_VERIFY_WRITE</FONT></P>
78 <P><FONT FACE="Times, serif">Nick Banes has had YAFFS working on real
79 NAND, with a few issues. </FONT>
83 <P><FONT FACE="Times, serif">$Id: yaffs_on_mtd.html,v 1.3 2002-11-26 01:15:38 charles Exp $</FONT></P>