2 * Flash device on the ADM5120 board
4 * Copyright Jeroen Vreeken (pe1rxq@amsat.org), 2005
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License version
8 * 2 as published by the Free Software Foundation.
11 #include <linux/autoconf.h>
12 #include <linux/module.h>
13 #include <linux/kernel.h>
14 #include <linux/mtd/mtd.h>
15 #include <linux/mtd/map.h>
17 #define FLASH_PHYS_ADDR 0x1FC00000
18 #define FLASH_SIZE 0x200000
20 static struct mtd_info *adm5120_mtd;
22 static struct map_info adm5120_mtd_map = {
26 .phys = FLASH_PHYS_ADDR,
29 static int __init adm5120_mtd_init(void)
31 printk(KERN_INFO "ADM5120 board flash (0x%x at 0x%x)\n", FLASH_SIZE,
33 adm5120_mtd_map.virt = ioremap_nocache(FLASH_PHYS_ADDR, FLASH_SIZE);
34 simple_map_init(&adm5120_mtd_map);
35 adm5120_mtd = do_map_probe("cfi_probe", &adm5120_mtd_map);
37 adm5120_mtd->owner = THIS_MODULE;
38 add_mtd_device(adm5120_mtd);
44 static void __exit adm5120_mtd_exit(void)
46 del_mtd_device(adm5120_mtd);
47 map_destroy(adm5120_mtd);
50 module_init(adm5120_mtd_init);
51 module_exit(adm5120_mtd_exit);
53 MODULE_LICENSE("GPL");
54 MODULE_AUTHOR("Jeroen Vreeken (pe1rxq@amsat.org)");
55 MODULE_DESCRIPTION("MTD map driver for ADM5120 boards");