X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fmtd%2Fmaps%2Fdbox2-flash.c;h=652813cd6c2d47f0dbb92113f912fd2cde2bf7ab;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=6565afb17d2fefc47d4163eee30b1878b36f932a;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/drivers/mtd/maps/dbox2-flash.c b/drivers/mtd/maps/dbox2-flash.c index 6565afb17..652813cd6 100644 --- a/drivers/mtd/maps/dbox2-flash.c +++ b/drivers/mtd/maps/dbox2-flash.c @@ -1,5 +1,5 @@ /* - * $Id: dbox2-flash.c,v 1.9 2003/05/21 12:45:18 dwmw2 Exp $ + * $Id: dbox2-flash.c,v 1.14 2005/11/07 11:14:26 gleixner Exp $ * * D-Box 2 flash driver */ @@ -13,6 +13,7 @@ #include #include #include +#include /* partition_info gives details on the logical partitions that the split the * single flash device into. If the size if zero we use up to the end of the @@ -20,43 +21,43 @@ static struct mtd_partition partition_info[]= { { .name = "BR bootloader", - .size = 128 * 1024, - .offset = 0, + .size = 128 * 1024, + .offset = 0, .mask_flags = MTD_WRITEABLE }, { - .name = "flfs (ppcboot)", - .size = 128 * 1024, - .offset = MTDPART_OFS_APPEND, + .name = "FLFS (U-Boot)", + .size = 128 * 1024, + .offset = MTDPART_OFS_APPEND, .mask_flags = 0 }, { - .name = "root (cramfs)", - .size = 7040 * 1024, - .offset = MTDPART_OFS_APPEND, + .name = "Root (SquashFS)", + .size = 7040 * 1024, + .offset = MTDPART_OFS_APPEND, .mask_flags = 0 }, { - .name = "var (jffs2)", - .size = 896 * 1024, - .offset = MTDPART_OFS_APPEND, + .name = "var (JFFS2)", + .size = 896 * 1024, + .offset = MTDPART_OFS_APPEND, .mask_flags = 0 }, { - .name = "flash without bootloader", - .size = MTDPART_SIZ_FULL, - .offset = 128 * 1024, + .name = "Flash without bootloader", + .size = MTDPART_SIZ_FULL, + .offset = 128 * 1024, .mask_flags = 0 }, { - .name = "complete flash", - .size = MTDPART_SIZ_FULL, - .offset = 0, + .name = "Complete Flash", + .size = MTDPART_SIZ_FULL, + .offset = 0, .mask_flags = MTD_WRITEABLE } }; -#define NUM_PARTITIONS (sizeof(partition_info) / sizeof(partition_info[0])) +#define NUM_PARTITIONS ARRAY_SIZE(partition_info) #define WINDOW_ADDR 0x10000000 #define WINDOW_SIZE 0x800000 @@ -67,14 +68,14 @@ static struct mtd_info *mymtd; struct map_info dbox2_flash_map = { .name = "D-Box 2 flash memory", .size = WINDOW_SIZE, - .buswidth = 4, + .bankwidth = 4, .phys = WINDOW_ADDR, }; int __init init_dbox2_flash(void) { printk(KERN_NOTICE "D-Box 2 flash driver (size->0x%X mem->0x%X)\n", WINDOW_SIZE, WINDOW_ADDR); - dbox2_flash_map.virt = (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE); + dbox2_flash_map.virt = ioremap(WINDOW_ADDR, WINDOW_SIZE); if (!dbox2_flash_map.virt) { printk("Failed to ioremap\n"); @@ -86,17 +87,17 @@ int __init init_dbox2_flash(void) mymtd = do_map_probe("cfi_probe", &dbox2_flash_map); if (!mymtd) { // Probe for single Intel 28F640 - dbox2_flash_map.buswidth = 2; - + dbox2_flash_map.bankwidth = 2; + mymtd = do_map_probe("cfi_probe", &dbox2_flash_map); } - + if (mymtd) { mymtd->owner = THIS_MODULE; /* Create MTD devices for each partition. */ add_mtd_partitions(mymtd, partition_info, NUM_PARTITIONS); - + return 0; }