diff options
author | Jiri Kosina <jkosina@suse.cz> | 2010-08-11 03:36:51 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2010-08-11 03:36:51 -0400 |
commit | 6396fc3b3ff3f6b942992b653a62df11dcef9bea (patch) | |
tree | db3c7cbe833b43c653adc99f70941431c5ff7c4e /drivers/mtd/maps/redwood.c | |
parent | 4785879e4d340e24e54f6de2ccfc42728b912808 (diff) | |
parent | 3d30701b58970425e1d45994d6cb82f828924fdd (diff) |
Merge branch 'master' into for-next
Conflicts:
fs/exofs/inode.c
Diffstat (limited to 'drivers/mtd/maps/redwood.c')
-rw-r--r-- | drivers/mtd/maps/redwood.c | 131 |
1 files changed, 0 insertions, 131 deletions
diff --git a/drivers/mtd/maps/redwood.c b/drivers/mtd/maps/redwood.c deleted file mode 100644 index d2c9db00db0c..000000000000 --- a/drivers/mtd/maps/redwood.c +++ /dev/null | |||
@@ -1,131 +0,0 @@ | |||
1 | /* | ||
2 | * drivers/mtd/maps/redwood.c | ||
3 | * | ||
4 | * FLASH map for the IBM Redwood 4/5/6 boards. | ||
5 | * | ||
6 | * Author: MontaVista Software, Inc. <source@mvista.com> | ||
7 | * | ||
8 | * 2001-2003 (c) MontaVista, Software, Inc. This file is licensed under | ||
9 | * the terms of the GNU General Public License version 2. This program | ||
10 | * is licensed "as is" without any warranty of any kind, whether express | ||
11 | * or implied. | ||
12 | */ | ||
13 | |||
14 | #include <linux/module.h> | ||
15 | #include <linux/types.h> | ||
16 | #include <linux/kernel.h> | ||
17 | #include <linux/init.h> | ||
18 | |||
19 | #include <linux/mtd/mtd.h> | ||
20 | #include <linux/mtd/map.h> | ||
21 | #include <linux/mtd/partitions.h> | ||
22 | |||
23 | #include <asm/io.h> | ||
24 | |||
25 | #define WINDOW_ADDR 0xffc00000 | ||
26 | #define WINDOW_SIZE 0x00400000 | ||
27 | |||
28 | #define RW_PART0_OF 0 | ||
29 | #define RW_PART0_SZ 0x10000 | ||
30 | #define RW_PART1_OF RW_PART0_SZ | ||
31 | #define RW_PART1_SZ 0x200000 - 0x10000 | ||
32 | #define RW_PART2_OF 0x200000 | ||
33 | #define RW_PART2_SZ 0x10000 | ||
34 | #define RW_PART3_OF 0x210000 | ||
35 | #define RW_PART3_SZ 0x200000 - (0x10000 + 0x20000) | ||
36 | #define RW_PART4_OF 0x3e0000 | ||
37 | #define RW_PART4_SZ 0x20000 | ||
38 | |||
39 | static struct mtd_partition redwood_flash_partitions[] = { | ||
40 | { | ||
41 | .name = "Redwood OpenBIOS Vital Product Data", | ||
42 | .offset = RW_PART0_OF, | ||
43 | .size = RW_PART0_SZ, | ||
44 | .mask_flags = MTD_WRITEABLE /* force read-only */ | ||
45 | }, | ||
46 | { | ||
47 | .name = "Redwood kernel", | ||
48 | .offset = RW_PART1_OF, | ||
49 | .size = RW_PART1_SZ | ||
50 | }, | ||
51 | { | ||
52 | .name = "Redwood OpenBIOS non-volatile storage", | ||
53 | .offset = RW_PART2_OF, | ||
54 | .size = RW_PART2_SZ, | ||
55 | .mask_flags = MTD_WRITEABLE /* force read-only */ | ||
56 | }, | ||
57 | { | ||
58 | .name = "Redwood filesystem", | ||
59 | .offset = RW_PART3_OF, | ||
60 | .size = RW_PART3_SZ | ||
61 | }, | ||
62 | { | ||
63 | .name = "Redwood OpenBIOS", | ||
64 | .offset = RW_PART4_OF, | ||
65 | .size = RW_PART4_SZ, | ||
66 | .mask_flags = MTD_WRITEABLE /* force read-only */ | ||
67 | } | ||
68 | }; | ||
69 | |||
70 | struct map_info redwood_flash_map = { | ||
71 | .name = "IBM Redwood", | ||
72 | .size = WINDOW_SIZE, | ||
73 | .bankwidth = 2, | ||
74 | .phys = WINDOW_ADDR, | ||
75 | }; | ||
76 | |||
77 | |||
78 | #define NUM_REDWOOD_FLASH_PARTITIONS ARRAY_SIZE(redwood_flash_partitions) | ||
79 | |||
80 | static struct mtd_info *redwood_mtd; | ||
81 | |||
82 | static int __init init_redwood_flash(void) | ||
83 | { | ||
84 | int err; | ||
85 | |||
86 | printk(KERN_NOTICE "redwood: flash mapping: %x at %x\n", | ||
87 | WINDOW_SIZE, WINDOW_ADDR); | ||
88 | |||
89 | redwood_flash_map.virt = ioremap(WINDOW_ADDR, WINDOW_SIZE); | ||
90 | |||
91 | if (!redwood_flash_map.virt) { | ||
92 | printk("init_redwood_flash: failed to ioremap\n"); | ||
93 | return -EIO; | ||
94 | } | ||
95 | simple_map_init(&redwood_flash_map); | ||
96 | |||
97 | redwood_mtd = do_map_probe("cfi_probe",&redwood_flash_map); | ||
98 | |||
99 | if (redwood_mtd) { | ||
100 | redwood_mtd->owner = THIS_MODULE; | ||
101 | err = add_mtd_partitions(redwood_mtd, | ||
102 | redwood_flash_partitions, | ||
103 | NUM_REDWOOD_FLASH_PARTITIONS); | ||
104 | if (err) { | ||
105 | printk("init_redwood_flash: add_mtd_partitions failed\n"); | ||
106 | iounmap(redwood_flash_map.virt); | ||
107 | } | ||
108 | return err; | ||
109 | |||
110 | } | ||
111 | |||
112 | iounmap(redwood_flash_map.virt); | ||
113 | return -ENXIO; | ||
114 | } | ||
115 | |||
116 | static void __exit cleanup_redwood_flash(void) | ||
117 | { | ||
118 | if (redwood_mtd) { | ||
119 | del_mtd_partitions(redwood_mtd); | ||
120 | /* moved iounmap after map_destroy - armin */ | ||
121 | map_destroy(redwood_mtd); | ||
122 | iounmap((void *)redwood_flash_map.virt); | ||
123 | } | ||
124 | } | ||
125 | |||
126 | module_init(init_redwood_flash); | ||
127 | module_exit(cleanup_redwood_flash); | ||
128 | |||
129 | MODULE_LICENSE("GPL"); | ||
130 | MODULE_AUTHOR("MontaVista Software <source@mvista.com>"); | ||
131 | MODULE_DESCRIPTION("MTD map driver for the IBM Redwood reference boards"); | ||