Index: drivers/mtd/maps/integrator-flash.c =================================================================== RCS file: /home/cvs/mtd/drivers/mtd/maps/integrator-flash.c,v retrieving revision 1.12 diff -u -r1.12 integrator-flash.c --- drivers/mtd/maps/integrator-flash.c 20 May 2003 20:59:30 -0000 1.12 +++ drivers/mtd/maps/integrator-flash.c 6 Aug 2003 20:02:06 -0000 @@ -154,14 +154,43 @@ static struct map_info armflash_map = { - .name = "AFS", + .name = "integrator-flash", .set_vpp = armflash_set_vpp, .phys = FLASH_BASE, }; + +/* + * Default static MTD partition definition. + * + * See include/linux/mtd/partitions.h for definition of the mtd_partition + * structure. + */ + +static struct mtd_partition integrator_partitions[] = { + { + .name = "Kernel", + .size = 0x00400000, + .offset = 0, + }, { + .name = "Root Filesystem", + .size = 0x00c00000, + .offset = MTDPART_OFS_APPEND, + }, { + .name = "User Filesystem", + .size = 0x00fc0000, + .offset = MTDPART_OFS_APPEND, + }, { + .name = "ARM Boot Monitor SIB", + .size = 0x00040000, + .offset = MTDPART_OFS_APPEND, + .mask_flags = MTD_WRITEABLE, /* force read-only */ + } +}; + static struct mtd_info *mtd; static struct mtd_partition *parts; -static const char *probes[] = { "RedBoot", "afs", NULL }; +static const char *probes[] = { "cmdlinepart", "RedBoot", "afs", NULL }; static int __init armflash_cfi_init(void *base, u_int size) { @@ -180,9 +209,8 @@ simple_map_init(&armflash_map); /* - * Also, the CFI layer automatically works out what size - * of chips we have, and does the necessary identification - * for us automatically. + * The CFI layer automatically works out what size chips we have + * and does the necessary identification for us automatically. */ mtd = do_map_probe("cfi_probe", &armflash_map); if (!mtd) @@ -191,12 +219,17 @@ mtd->owner = THIS_MODULE; ret = parse_mtd_partitions(mtd, probes, &parts, (void *)0); - if (ret > 0) { - ret = add_mtd_partitions(mtd, parts, ret); - if (ret) - printk(KERN_ERR "mtd partition registration " - "failed: %d\n", ret); + if (ret <= 0) { + /* + * Use default static MTD partition definition: + */ + parts = integrator_partitions; + ret = ARRAY_SIZE(integrator_partitions); } + + ret = add_mtd_partitions(mtd, parts, ret); + if (ret) + printk(KERN_ERR "mtd partition registration failed: %d\n", ret); /* * If we got an error, free all resources.