1. flash 的分區控制。
a. 在 linux-2.4.26-em86xx\drivers\mtd\maps\em86xx_map.c 有
static struct mtd_partition em86xxmap_partitions[] = {
EM86XX_MTD_PARTITIONS
};
b. 在 linux-2.4.26-em86xx\include\asm\arch\board\mtdpartitions.h 有
#define EM86XX_MTD_PARTITIONS \
/* Assume 4MB flash memory */ \
{ /* 3840KB read/write */ \
name: "RootFS", \
size: 0x3c0000, \
offset: 0x10000 + 0x20000, \
mask_flags: 0, \
}, \
{ /* 64KB read/write */ \
name: "User", \
size: 0x10000, \
offset: MTDPART_OFS_APPEND, \
mask_flags: 0, \
}, \
{ /* 64KB readonly: first stage bootloader */ \
name: "BootROM1", \
size: 0x10000, \
offset: 0x0, \
mask_flags: MTD_WRITEABLE, /* Not writable */ \
}, \
{ /* 128KB: second stage bootloader */ \
name: "BootROM2", \
size: 0x20000, \
offset: 0x10000, \
mask_flags: 0, \
},
2. mask_flags
a. MTD_WRITEABLE 唯讀,不可寫入。
b. 0 可寫可讀。
3. offset 偏移位置
a. MTDPART_OFS_APPEND 跟在上一個分區後面。
4. size 大小
5. name 分區名稱
a. 在 linux-2.4.26-em86xx\drivers\mtd\maps\em86xx_map.c 有
static struct mtd_partition em86xxmap_partitions[] = {
EM86XX_MTD_PARTITIONS
};
b. 在 linux-2.4.26-em86xx\include\asm\arch\board\mtdpartitions.h 有
#define EM86XX_MTD_PARTITIONS \
/* Assume 4MB flash memory */ \
{ /* 3840KB read/write */ \
name: "RootFS", \
size: 0x3c0000, \
offset: 0x10000 + 0x20000, \
mask_flags: 0, \
}, \
{ /* 64KB read/write */ \
name: "User", \
size: 0x10000, \
offset: MTDPART_OFS_APPEND, \
mask_flags: 0, \
}, \
{ /* 64KB readonly: first stage bootloader */ \
name: "BootROM1", \
size: 0x10000, \
offset: 0x0, \
mask_flags: MTD_WRITEABLE, /* Not writable */ \
}, \
{ /* 128KB: second stage bootloader */ \
name: "BootROM2", \
size: 0x20000, \
offset: 0x10000, \
mask_flags: 0, \
},
2. mask_flags
a. MTD_WRITEABLE 唯讀,不可寫入。
b. 0 可寫可讀。
3. offset 偏移位置
a. MTDPART_OFS_APPEND 跟在上一個分區後面。
4. size 大小
5. name 分區名稱