4 * $Id: mpc1211.c,v 1.4 2004/09/16 23:27:13 gleixner Exp $
6 * (C) 2002 Interface, Saito.K & Jeanne
11 #include <linux/module.h>
12 #include <linux/types.h>
13 #include <linux/kernel.h>
15 #include <linux/mtd/mtd.h>
16 #include <linux/mtd/map.h>
17 #include <linux/mtd/partitions.h>
19 static struct mtd_info
*flash_mtd
;
20 static struct mtd_partition
*parsed_parts
;
22 struct map_info mpc1211_flash_map
= {
23 .name
= "MPC-1211 FLASH",
28 static struct mtd_partition mpc1211_partitions
[] = {
30 .name
= "IPL & ETH-BOOT",
37 .size
= MTDPART_SIZ_FULL
,
41 static int __init
init_mpc1211_maps(void)
45 mpc1211_flash_map
.phys
= 0;
46 mpc1211_flash_map
.virt
= (void __iomem
*)P2SEGADDR(0);
48 simple_map_init(&mpc1211_flash_map
);
50 printk(KERN_NOTICE
"Probing for flash chips at 0x00000000:\n");
51 flash_mtd
= do_map_probe("jedec_probe", &mpc1211_flash_map
);
53 printk(KERN_NOTICE
"Flash chips not detected at either possible location.\n");
56 printk(KERN_NOTICE
"MPC-1211: Flash at 0x%08lx\n", mpc1211_flash_map
.virt
& 0x1fffffff);
57 flash_mtd
->module
= THIS_MODULE
;
59 parsed_parts
= mpc1211_partitions
;
60 nr_parts
= ARRAY_SIZE(mpc1211_partitions
);
62 add_mtd_partitions(flash_mtd
, parsed_parts
, nr_parts
);
66 static void __exit
cleanup_mpc1211_maps(void)
69 del_mtd_partitions(flash_mtd
);
71 del_mtd_device(flash_mtd
);
72 map_destroy(flash_mtd
);
75 module_init(init_mpc1211_maps
);
76 module_exit(cleanup_mpc1211_maps
);
78 MODULE_LICENSE("GPL");
79 MODULE_AUTHOR("Saito.K & Jeanne <ksaito@interface.co.jp>");
80 MODULE_DESCRIPTION("MTD map driver for MPC-1211 boards. Interface");