/*
* Partition definition structure:
*
* An array of struct partition is passed along with a MTD object to
* add_mtd_partitions() to create them.
*
* For each partition, these fields are available:
* name: string that will be used to label the partition's MTD device.
* size: the partition size; if defined as MTDPART_SIZ_FULL, the partition
* will extend to the end of the master MTD device.
* offset: absolute starting position within the master MTD device; if
* defined as MTDPART_OFS_APPEND, the partition will start where the
* previous one ended; if MTDPART_OFS_NXTBLK, at the next erase block.
* mask_flags: contains flags that have to be masked (removed) from the
* master MTD flag set for the corresponding MTD partition.
* For example, to force a read-only partition, simply adding
* MTD_WRITEABLE to the mask_flags will do the trick.
*
* Note: writeable partitions require their size and offset be
* erasesize aligned (e.g. use MTDPART_OFS_NEXTBLK).
*/
struct mtd_partition {
char *name; /* identifier string */
u_int32_t size; /* partition size */
u_int32_t offset; /* offset within the master MTD space */
u_int32_t mask_flags; /* master MTD flags to mask out for this partition */
struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only)*/
struct mtd_info **mtdp; /* pointer to store the MTD object */
};
static struct mtd_partition c2_nfc_parts[] = {
{"boot\0", 0x1000000, MTDPART_OFS_NXTBLK, 0, NULL, NULL},
{"setting\0", 0x1000000, MTDPART_OFS_NXTBLK, 0, NULL, NULL},
{"rootfs\0", 0x1800000, MTDPART_OFS_NXTBLK, 0, NULL, NULL},
{"home\0", 0x8000000, MTDPART_OFS_NXTBLK, 0, NULL, NULL},
{"storage\0", MTDPART_SIZ_FULL, MTDPART_OFS_NXTBLK, 0, NULL, NULL},
};
基于NAND的YAFFS文件系统在嵌入式系统中的应用 http://wenku.baidu.com/view/ba5ceabff121dd36a32d827d.html
关于VIVI的bon命令与part命令 http://blog.csdn.net/dayidson/archive/2009/12/21/5048867.aspx
嵌入式Linux中基于MTD的文件系统的结构框架图 http://blog.sina.com.cn/s/blog_5d9051c00100ij93.html