* newbie trying to figure out MTD
@ 2000-06-23 20:05 Juan Gonzo
2000-06-24 10:59 ` David Woodhouse
0 siblings, 1 reply; 2+ messages in thread
From: Juan Gonzo @ 2000-06-23 20:05 UTC (permalink / raw)
To: MTD Mailing List
I have little experience with the internals of Linux,
but I have been tasked with getting FTL to work with
an embedded Linux system.
The setup is as follows:
o Embedded Linux platform
o Ext2 filesystem
o Intel Strataflash
o System can currently boot using a ram disk
and Ext2
My plan of attack was this:
1. Boot target with ram disk.
2. Install the mtd module(s).
3. Create an Ext2 filesystem with
'mkfs -t ext2 /dev/ftl'
or something to that effect.
4. Populate the flash disk with the neccessary
files
5. Make the ftl device the root device.
Obviously these are *very* high level steps.
Anyways, you might be thinking "This guy doesn't
know what he is talking about." and I am almost
inclined to agree.
Could someone comment on what I am trying to
accomplish
vs. what I am doing? Or perhaps some general
instructions on how I should use MTD?
I have read the MTD docs and have looked through the
mailing list archives, but a lot of that is more
specific info than I need right now.
My thanks to any one that helps.
-- kelly
_______________________________________________________
Do You Yahoo!?
Get your free @yahoo.ca address at http://mail.yahoo.ca
To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: newbie trying to figure out MTD
2000-06-23 20:05 newbie trying to figure out MTD Juan Gonzo
@ 2000-06-24 10:59 ` David Woodhouse
0 siblings, 0 replies; 2+ messages in thread
From: David Woodhouse @ 2000-06-24 10:59 UTC (permalink / raw)
To: Juan Gonzo; +Cc: MTD Mailing List
On Fri, 23 Jun 2000, Juan Gonzo wrote:
> I have little experience with the internals of Linux,
> but I have been tasked with getting FTL to work with
> an embedded Linux system.
Unless you're in the Free World, you're not permitted to use FTL on
non-PCMCIA devices. Use JFFS instead.
> 1. Boot target with ram disk.
> 2. Install the mtd module(s).
> 3. Create an Ext2 filesystem with
> 'mkfs -t ext2 /dev/ftl'
> or something to that effect.
> 4. Populate the flash disk with the neccessary
> files
> 5. Make the ftl device the root device.
> Could someone comment on what I am trying to accomplish
> vs. what I am doing? Or perhaps some general instructions on
> how I should use MTD?
Don't bother with modules - compile the stuff straight into the
kernel. The toy on my desk is using Intel Strataflash as a root filesystem
and booting straight into it. Currently, I'm using ext2-on-FTL but that's
a temporary step until I have JFFS working properly.
Check out the current version of the code from CVS, as per the
instructions on the web site. Even if you've never used CVS before, all
you need to do is cut and paste the two lines shown, and enter the
password 'anoncvs' when prompted for it.
Now copy the code into place in your kernel source tree as follows:
LINUXDIR=/usr/src/linux
cp -av mtd/kernel $LINUXDIR/drivers/mtd
cp -av mtd/include/linux/mtd $LINUXDIR/include/linux/mtd
cp -v mtd/include/linux/jffs.h $LINUXDIR/include/linux
cp -av mtd/fs/jffs $LINUXDIR/fs/jffs
Now make the appropriate changes to your kernel tree to make it use the
new code. There's a patch for 2.4 (which doesn't yet include JFFS) in the
mtd/patches directory, and I'll make a new one for 2.2 on Monday if
someone prods me to remind me.
make oldconfig and enable:
Memory Technology Device (MTD) support
Common Flash Interface (CFI) support
CFI support for Intel/Sharp Extended Command Set chips
CFI chips on memory bus support
Direct blockdevice access to MTD devices
Journalling Flash filesystem (JFFS) support
Now edit drivers/mtd/nora.c and change the WINDOW_ADDR and WINDOW_SIZE
definitions to match the address at which the flash chips are mapped in
your system.
Boot it up and mount -t jffs /dev/mtdblock0 /mnt
Now you should have a JFFS filesystem. By putting some useful files and
devices on it, and setting the kernel's root device to 0x1f,0 you can use
it as a root filesystem.
Of course it's not quite perfect yet. The CFI code is very new, and so far
it only detects a single chip - if you have more than one mapped next to
each other it won't find more than one. My testbed has two, though, so
it's fairly high on my priority list. Also, the code busy-waits for flash
erases and writes, rather than scheduling. That's to be fixed very shortly
too.
Also, my first attempt yesterday as using JFFS for a root filesystem
failed because of a problem with jffs_mknod - that should be fixed now but
I haven't tested it again yet.
To import any updates which are made to the CVS version of the code, all
you need to do is:
cd /usr/src/linux/drivers/mtd
cvs update
cd /usr/src/linux/include/linux/mtd
cvs update
cd /usr/src/linux/fs/jffs
cvs update
The only thing you _might_ miss that way is an update to
include/linux/jffs.h - what I actually do is set up a symlink farm -
rather than copying the files into the Linux kernel tree, I just make the
directories, and symlink the actual files from wherever I put the cvs copy
of the MTD code. That way, I just need to update in one place, and when
I'm testing code in three or four different kernel versions and
architectures, I only have to edit one copy.
--
dwmw2
To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2000-06-24 10:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-06-23 20:05 newbie trying to figure out MTD Juan Gonzo
2000-06-24 10:59 ` David Woodhouse
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox