<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2668" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=021060104-29072005><FONT face=Arial size=2>If you wish to use
the mtd nandsim device as a simulator for testing yaffs, you can follow these
steps:</FONT></SPAN></DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial size=2>1) Make sure you
have a recent 2.6 kernel with a recent MTD tree. (If you ask the MTD folk,
they'll tell you to run the mtd patchin script from the latest cvs version of
MTD.)</FONT></SPAN></DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial size=2>2) Configure your
kernel to enable the mtd nand support and nandsim driver. Make sure that the
following are set in .config:</FONT></SPAN></DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial
size=2>CONFIG_MTD=m<BR>CONFIG_MTD_CHAR=m<BR>CONFIG_MTD_BLOCK=m<BR>CONFIG_MTD_NAND=m<BR>CONFIG_MTD_NAND_NANDSIM=m<BR></FONT></SPAN></DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial size=2>You can set them to
'y' rather than 'm' if you don't want the modules form.</FONT></SPAN></DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial size=2>3) make and install
your kernel and modules in the usual way, then boot.</FONT></SPAN></DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial size=2>4) To use the
nandsim, you need to load some MTD modules, unless you've configured MTD into
the kernel:</FONT></SPAN></DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial size=2>modprobe
mtdblock<BR>modprobe mtdchar<BR>modprobe nandsim<BR></FONT></SPAN></DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial size=2>5) Verify that the
nandsim device has loaded properly:</FONT></SPAN></DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial size=2>cat
/proc/mtd</FONT></SPAN></DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial size=2>You will see
something like</FONT></SPAN></DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial
size=2>dev: size erasesize name<BR>mtd0:
00800000 00002000 "NAND simulator partition"<BR></DIV></FONT></SPAN>
<DIV><SPAN class=021060104-29072005><FONT face=Arial size=2>If everything went
well.</FONT></SPAN></DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial size=2>6) what the nand
device is called will depend on your Linux distro, and whether you are using
devfs or udev, but the '0', or whatever mtd reports as the device associated
with the simulator, in the above will show up in the name. On my
ubuntu system, if /proc/mtd reports 'mtd0' then the block device is
/dev/mtdblock0 and the char device is /dev/mtd0.</FONT></SPAN></DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial size=2>7) You can mount
yaffs on the nandsim in the usual way. I have /mnt/nand as the directory I
mount on, so I would mount using</FONT></SPAN></DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial size=2>mount -t yaffs
/dev/mtdblock0 /mnt/nand</FONT></SPAN></DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial size=2>If you find any
errors in this, please let me know. It wll eventually find its way into
the yaffs documentation.</FONT></SPAN></DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=021060104-29072005><FONT face=Arial
size=2>Marty</DIV></FONT></SPAN></BODY></HTML>