2 * drivers/mtd/maps/chestnut.c
4 * $Id: chestnut.c,v 1.1 2005/01/05 16:59:50 dwmw2 Exp $
6 * Flash map driver for IBM Chestnut (750FXGX Eval)
8 * Chose not to enable 8 bit flash as it contains the firmware and board
9 * info. Thus only the 32bit flash is supported.
11 * Author: <source@mvista.com>
13 * 2004 (c) MontaVista Software, Inc. This file is licensed under
14 * the terms of the GNU General Public License version 2. This program
15 * is licensed "as is" without any warranty of any kind, whether express
19 #include <linux/module.h>
20 #include <linux/init.h>
21 #include <linux/types.h>
22 #include <linux/kernel.h>
24 #include <linux/mtd/mtd.h>
25 #include <linux/mtd/map.h>
26 #include <linux/mtd/partitions.h>
27 #include <platforms/chestnut.h>
29 static struct map_info chestnut32_map = {
31 .size = CHESTNUT_32BIT_SIZE,
33 .phys = CHESTNUT_32BIT_BASE,
36 static struct mtd_partition chestnut32_partitions[] = {
40 .size = CHESTNUT_32BIT_SIZE,
44 static struct mtd_info *flash32;
46 int __init init_chestnut(void)
50 chestnut32_map.virt = ioremap(chestnut32_map.phys, chestnut32_map.size);
52 if (!chestnut32_map.virt) {
53 printk(KERN_NOTICE "Failed to ioremap 32-bit flash\n");
57 simple_map_init(&chestnut32_map);
59 flash32 = do_map_probe("cfi_probe", &chestnut32_map);
61 flash32->owner = THIS_MODULE;
62 add_mtd_partitions(flash32, chestnut32_partitions,
63 ARRAY_SIZE(chestnut32_partitions));
65 printk(KERN_NOTICE "map probe failed for 32-bit flash\n");
73 cleanup_chestnut(void)
76 del_mtd_partitions(flash32);
80 if (chestnut32_map.virt) {
81 iounmap((void *)chestnut32_map.virt);
82 chestnut32_map.virt = 0;
86 module_init(init_chestnut);
87 module_exit(cleanup_chestnut);
89 MODULE_DESCRIPTION("MTD map and partitions for IBM Chestnut (750fxgx Eval)");
90 MODULE_AUTHOR("<source@mvista.com>");
91 MODULE_LICENSE("GPL");