MTD Utils ReadMe

[Compile]
1.make sure you have the arm-linux cross tool chain, include gcc, ar, ranlib
then add it into makefile, that is you desitnate them in common.mk :
"CROSS := arm-linux-
CC := $(CROSS)gcc
AR := $(CROSS)ar
RANLIB := $(CROSS)ranlib"
2.then just type "make"
then you can find the tools under directory "arm-linux" :
nanddump nandwrite flash_info flash_erase flash_eraseall ......
3.Note:
for the Linux kernel have been upadated for supporting size more than 4GB, 
so some member of some structure of mtd util code,
 such as "size" in "struct mtd_info_user" is uint64_t in include\mtd\mtd-abi.h
which shoude be the same as it is in kernel.

[Usage]
1.the Linux Kernel MTD has include a mtd character device (/drivers/mtd/mtdchar.c) :
/dev/mtdN from /dev/mtd0 to /dev/mtdN, which N is the max partition index for you MTD partition in kernel code,
for example, here ours is :
# cat /proc/partitions 
major minor  #blocks  name
  31     0       1024 mtdblock0
  31     1       8192 mtdblock1
  31     2     204800 mtdblock2
  31     3      65536 mtdblock3
  31     4    3717120 mtdblock4

so we have 5 mtd char device, /dev/mtd0~/dev/mtd4

2.the MTD util use the ioctl in the mtd char device to operate the mtd partition,
such as nandwrite use MEMWRITEOOB to write data.

3.more info about the usage of the specific tool, please refer its help.
such as, "nandwrite --help" :
# ./nandwrite --help
Usage: nandwrite [OPTION] MTD_DEVICE [INPUTFILE|-]
Writes to the specified MTD device.

  -a, --autoplace         Use auto oob layout
  -e, --eccisslc         Specially for uboot, ecc mode is SLC 
  -j, --jffs2             Force jffs2 oob layout (legacy support)
  -y, --yaffs             Force yaffs oob layout (legacy support)
  -f, --forcelegacy       Force legacy support on autoplacement-enabled mtd
                          device
  -m, --markbad           Mark blocks bad if write fails
  -n, --noecc             Write without ecc
  -o, --oob               Image contains oob data
  -s addr, --start=addr   Set start address (default is 0)
  -p, --pad               Pad to page size
  -b, --blockalign=1|2|4  Set multiple of eraseblocks to align to
  -q, --quiet             Don't display progress messages
      --help              Display this help and exit
      --version           Output version information and exit
 
