2 * $Id: rpxlite.c,v 1.22 2004/11/04 13:24:15 gleixner Exp $
4 * Handle mapping of the flash on the RPX Lite and CLLF boards
7 #include <linux/module.h>
8 #include <linux/types.h>
9 #include <linux/kernel.h>
10 #include <linux/init.h>
12 #include <linux/mtd/mtd.h>
13 #include <linux/mtd/map.h>
16 #define WINDOW_ADDR 0xfe000000
17 #define WINDOW_SIZE 0x800000
19 static struct mtd_info *mymtd;
21 static struct map_info rpxlite_map = {
28 int __init init_rpxlite(void)
30 printk(KERN_NOTICE "RPX Lite or CLLF flash device: %x at %x\n", WINDOW_SIZE*4, WINDOW_ADDR);
31 rpxlite_map.virt = ioremap(WINDOW_ADDR, WINDOW_SIZE * 4);
33 if (!rpxlite_map.virt) {
34 printk("Failed to ioremap\n");
37 simple_map_init(&rpxlite_map);
38 mymtd = do_map_probe("cfi_probe", &rpxlite_map);
40 mymtd->owner = THIS_MODULE;
41 add_mtd_device(mymtd);
45 iounmap((void *)rpxlite_map.virt);
49 static void __exit cleanup_rpxlite(void)
52 del_mtd_device(mymtd);
55 if (rpxlite_map.virt) {
56 iounmap((void *)rpxlite_map.virt);
61 module_init(init_rpxlite);
62 module_exit(cleanup_rpxlite);
64 MODULE_LICENSE("GPL");
65 MODULE_AUTHOR("Arnold Christensen <AKC@pel.dk>");
66 MODULE_DESCRIPTION("MTD map driver for RPX Lite and CLLF boards");