1 diff -urN linux.old/drivers/mtd/maps/Kconfig linux.dev/drivers/mtd/maps/Kconfig
2 --- linux.old/drivers/mtd/maps/Kconfig 2006-08-30 06:30:59.000000000 +0200
3 +++ linux.dev/drivers/mtd/maps/Kconfig 2006-08-30 06:11:51.000000000 +0200
5 Walnut board. If you have one of these boards and would like to
6 use the flash chips on it, say 'Y'.
9 + tristate "Flash device mapped on IBM 405EP MagicBox"
10 + depends on MTD_CFI && MTD_PARTITIONS && 40x && MAGICBOX
12 + This enables access routines for the flash chips on the IBM 405EP
13 + MagicBox board. If you have one of these boards and would like to
14 + use the flash chips on it, say 'Y'.
18 tristate "Flash devices mapped on IBM 440GP Ebony"
19 depends on MTD_JEDECPROBE && EBONY
20 diff -urN linux.old/drivers/mtd/maps/magicmap.c linux.dev/drivers/mtd/maps/magicmap.c
21 --- linux.old/drivers/mtd/maps/magicmap.c 1970-01-01 01:00:00.000000000 +0100
22 +++ linux.dev/drivers/mtd/maps/magicmap.c 2006-08-30 06:52:34.000000000 +0200
25 + * magicmap.c: Copyleft 2005 Karol Lewandowski
27 + * Mapping for MagicBox flash.
28 + * Based on walnut.c.
30 + * Heikki Lindholm <holindho@infradead.org>
33 + * This program is free software; you can redistribute it and/or modify it
34 + * under the terms of the GNU General Public License as published by the
35 + * Free Software Foundation; either version 2 of the License, or (at your
36 + * option) any later version.
39 +#include <linux/module.h>
40 +#include <linux/types.h>
41 +#include <linux/kernel.h>
42 +#include <linux/init.h>
43 +#include <linux/mtd/mtd.h>
44 +#include <linux/mtd/map.h>
45 +#include <linux/mtd/partitions.h>
46 +#include <linux/autoconf.h>
49 +static struct mtd_info *flash;
51 +static struct map_info magic_map = {
52 + .name = "Magically mapped flash",
58 +static struct mtd_partition magic_partitions[] = {
70 + .name = "bootloader",
73 + .mask_flags = MTD_WRITEABLE,
77 +int __init init_magic(void)
82 + (void __iomem *)ioremap(magic_map.phys, magic_map.size);
84 + if (!magic_map.virt) {
85 + printk("Failed to ioremap flash.\n");
89 + simple_map_init(&magic_map);
91 + flash = do_map_probe("cfi_probe", &magic_map);
93 + flash->owner = THIS_MODULE;
94 + if (flash->read(flash, 12, sizeof(u32), &len, (char *) &size) ||
97 + size += 0x40; /* header size of the uImage */
98 + if (size < 0x400000) {
99 + /* skip to next erase block */
100 + if (size & (flash->erasesize - 1)) {
101 + size |= (flash->erasesize - 1);
104 + magic_partitions[1].offset = size;
105 + magic_partitions[1].size = magic_partitions[2].offset - size;
108 + add_mtd_partitions(flash, magic_partitions,
109 + ARRAY_SIZE(magic_partitions));
111 + printk("map probe failed for flash\n");
118 +static void __exit cleanup_magic(void)
121 + del_mtd_partitions(flash);
122 + map_destroy(flash);
125 + if (magic_map.virt) {
126 + iounmap((void *)magic_map.virt);
127 + magic_map.virt = NULL;
131 +module_init(init_magic);
132 +module_exit(cleanup_magic);
134 +MODULE_LICENSE("GPL");
135 +MODULE_AUTHOR("Karol Lewandowski");
136 +MODULE_DESCRIPTION("MTD map and partitions for IBM 405EP MagicBox boards");
137 diff -urN linux.old/drivers/mtd/maps/Makefile linux.dev/drivers/mtd/maps/Makefile
138 --- linux.old/drivers/mtd/maps/Makefile 2006-08-30 06:30:59.000000000 +0200
139 +++ linux.dev/drivers/mtd/maps/Makefile 2006-08-30 06:11:51.000000000 +0200
141 obj-$(CONFIG_MTD_BEECH) += beech-mtd.o
142 obj-$(CONFIG_MTD_ARCTIC) += arctic-mtd.o
143 obj-$(CONFIG_MTD_WALNUT) += walnut.o
144 +obj-$(CONFIG_MTD_MAGICMAP) += magicmap.o
145 obj-$(CONFIG_MTD_H720X) += h720x-flash.o
146 obj-$(CONFIG_MTD_SBC8240) += sbc8240.o
147 obj-$(CONFIG_MTD_NOR_TOTO) += omap-toto-flash.o