MTD Flash Howto ?

Ned W. Rhodes ned at softwaresystemsgroup.com
Sat Aug 5 00:20:09 EST 2006


The book Building Embedded Linux Systems has a good section on the use of
flash file systems.

When you boot, you will see something like this, depending on the type of
flash driver you have. Make sure you have defined your mtd map in
kernel/drivers/mtd/map.

JFFS2 version 2.2. (NAND) (C) 2001-2003 Red Hat, Inc.
JFS: nTxBlock = 965, nTxLock = 7720

Then if you have the MTD partitions correctly identified, the kernel will
show you something like:

CBG flash bank 0: Found 1 x16 devices at 0x0 in 16-bit bank
 Intel/Sharp Extended Query Table at 0x0031
Using buffer write method
cfi_cmdset_0001: Erase suspend on write enabled
Creating 2 MTD partitions on "CBG flash bank 0":
0x00000000-0x01800000 : "ffw1"
0x01800000-0x02000000 : "filesystem1"

Once booted you can look at /proc/mtd and you should see the partitions
something like:

[root at lbg ]# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 01800000 00020000 "ffw1"
mtd1: 00800000 00020000 "filesystem1"

Your mileage may vary depending on the type of flash you have and all the
configuration options, but that is basically how to tell that things are
mapped and ready for use.

Ned W. Rhodes
Software System Group
703.812.5072 x100




More information about the Linuxppc-embedded mailing list