static int __init h720x_mtd_init(void)
h720x_map.virt = ioremap(h720x_map.phys, h720x_map.size);
simple_map_init(&h720x_map);
mymtd = do_map_probe("cfi_probe", &h720x_map);
/\
||
\/
static struct map_info h720x_map = {
.name = "H720X",
.bankwidth = 4,
.size = H720X_FLASH_SIZE,
.phys = H720X_FLASH_PHYS,
};
mtd_parts = h720x_partitions;
/\
||
\/
static struct mtd_partition h720x_partitions[] = {
{
.name = "ArMon",
.size = 0x00080000,
.offset = 0,
.mask_flags = MTD_WRITEABLE
},{
.name = "Env",
.size = 0x00040000,
.offset = 0x00080000,
.mask_flags = MTD_WRITEABLE
},{
.name = "Kernel",
.size = 0x00180000,
.offset = 0x000c0000,
.mask_flags = MTD_WRITEABLE
},{
.name = "Ramdisk",
.size = 0x00400000,
.offset = 0x00240000,
.mask_flags = MTD_WRITEABLE
},{
.name = "jffs2",
.size = MTDPART_SIZ_FULL,
.offset = MTDPART_OFS_APPEND
}
};
add_mtd_partitions(mymtd, mtd_parts, nr_mtd_parts);
iounmap((void *)h720x_map.virt);
慢慢欣赏linux MTD flash
最新推荐文章于 2024-02-27 19:40:33 发布