diff options
author | Alexander Shiyan <shc_work@mail.ru> | 2012-11-17 08:57:12 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2012-11-21 12:57:41 -0500 |
commit | 86449336dd3c6e0edf97b971db2daa88917c1d7e (patch) | |
tree | 47059fc28b556d62909eebd18ef28235e690956b /drivers | |
parent | ea7d1bc97d91e9b83436a6188cde987aab79aacf (diff) |
ARM: clps711x: cdb89712: Special driver for handling memory is removed
This patch provide migration to using "physmap-flash" and "mtd-ram"
drivers instead of using special driver for handling memory.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/maps/Kconfig | 7 | ||||
-rw-r--r-- | drivers/mtd/maps/Makefile | 1 | ||||
-rw-r--r-- | drivers/mtd/maps/cdb89712.c | 278 |
3 files changed, 0 insertions, 286 deletions
diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig index 2e47c2ed0a2d..df304868bebb 100644 --- a/drivers/mtd/maps/Kconfig +++ b/drivers/mtd/maps/Kconfig | |||
@@ -324,13 +324,6 @@ config MTD_SOLUTIONENGINE | |||
324 | This enables access to the flash chips on the Hitachi SolutionEngine and | 324 | This enables access to the flash chips on the Hitachi SolutionEngine and |
325 | similar boards. Say 'Y' if you are building a kernel for such a board. | 325 | similar boards. Say 'Y' if you are building a kernel for such a board. |
326 | 326 | ||
327 | config MTD_CDB89712 | ||
328 | tristate "Cirrus CDB89712 evaluation board mappings" | ||
329 | depends on MTD_CFI && ARCH_CDB89712 | ||
330 | help | ||
331 | This enables access to the flash or ROM chips on the CDB89712 board. | ||
332 | If you have such a board, say 'Y'. | ||
333 | |||
334 | config MTD_SA1100 | 327 | config MTD_SA1100 |
335 | tristate "CFI Flash device mapped on StrongARM SA11x0" | 328 | tristate "CFI Flash device mapped on StrongARM SA11x0" |
336 | depends on MTD_CFI && ARCH_SA1100 | 329 | depends on MTD_CFI && ARCH_SA1100 |
diff --git a/drivers/mtd/maps/Makefile b/drivers/mtd/maps/Makefile index deb43e9a1e7f..a0240edd1961 100644 --- a/drivers/mtd/maps/Makefile +++ b/drivers/mtd/maps/Makefile | |||
@@ -7,7 +7,6 @@ obj-$(CONFIG_MTD) += map_funcs.o | |||
7 | endif | 7 | endif |
8 | 8 | ||
9 | # Chip mappings | 9 | # Chip mappings |
10 | obj-$(CONFIG_MTD_CDB89712) += cdb89712.o | ||
11 | obj-$(CONFIG_MTD_CFI_FLAGADM) += cfi_flagadm.o | 10 | obj-$(CONFIG_MTD_CFI_FLAGADM) += cfi_flagadm.o |
12 | obj-$(CONFIG_MTD_DC21285) += dc21285.o | 11 | obj-$(CONFIG_MTD_DC21285) += dc21285.o |
13 | obj-$(CONFIG_MTD_DILNETPC) += dilnetpc.o | 12 | obj-$(CONFIG_MTD_DILNETPC) += dilnetpc.o |
diff --git a/drivers/mtd/maps/cdb89712.c b/drivers/mtd/maps/cdb89712.c deleted file mode 100644 index c29cbf87ea0c..000000000000 --- a/drivers/mtd/maps/cdb89712.c +++ /dev/null | |||
@@ -1,278 +0,0 @@ | |||
1 | /* | ||
2 | * Flash on Cirrus CDB89712 | ||
3 | * | ||
4 | */ | ||
5 | |||
6 | #include <linux/module.h> | ||
7 | #include <linux/types.h> | ||
8 | #include <linux/kernel.h> | ||
9 | #include <linux/ioport.h> | ||
10 | #include <linux/init.h> | ||
11 | #include <asm/io.h> | ||
12 | #include <mach/hardware.h> | ||
13 | #include <linux/mtd/mtd.h> | ||
14 | #include <linux/mtd/map.h> | ||
15 | #include <linux/mtd/partitions.h> | ||
16 | |||
17 | /* dynamic ioremap() areas */ | ||
18 | #define FLASH_START 0x00000000 | ||
19 | #define FLASH_SIZE 0x800000 | ||
20 | #define FLASH_WIDTH 4 | ||
21 | |||
22 | #define SRAM_START 0x60000000 | ||
23 | #define SRAM_SIZE 0xc000 | ||
24 | #define SRAM_WIDTH 4 | ||
25 | |||
26 | #define BOOTROM_START 0x70000000 | ||
27 | #define BOOTROM_SIZE 0x80 | ||
28 | #define BOOTROM_WIDTH 4 | ||
29 | |||
30 | |||
31 | static struct mtd_info *flash_mtd; | ||
32 | |||
33 | struct map_info cdb89712_flash_map = { | ||
34 | .name = "flash", | ||
35 | .size = FLASH_SIZE, | ||
36 | .bankwidth = FLASH_WIDTH, | ||
37 | .phys = FLASH_START, | ||
38 | }; | ||
39 | |||
40 | struct resource cdb89712_flash_resource = { | ||
41 | .name = "Flash", | ||
42 | .start = FLASH_START, | ||
43 | .end = FLASH_START + FLASH_SIZE - 1, | ||
44 | .flags = IORESOURCE_IO | IORESOURCE_BUSY, | ||
45 | }; | ||
46 | |||
47 | static int __init init_cdb89712_flash (void) | ||
48 | { | ||
49 | int err; | ||
50 | |||
51 | if (request_resource (&ioport_resource, &cdb89712_flash_resource)) { | ||
52 | printk(KERN_NOTICE "Failed to reserve Cdb89712 FLASH space\n"); | ||
53 | err = -EBUSY; | ||
54 | goto out; | ||
55 | } | ||
56 | |||
57 | cdb89712_flash_map.virt = ioremap(FLASH_START, FLASH_SIZE); | ||
58 | if (!cdb89712_flash_map.virt) { | ||
59 | printk(KERN_NOTICE "Failed to ioremap Cdb89712 FLASH space\n"); | ||
60 | err = -EIO; | ||
61 | goto out_resource; | ||
62 | } | ||
63 | simple_map_init(&cdb89712_flash_map); | ||
64 | flash_mtd = do_map_probe("cfi_probe", &cdb89712_flash_map); | ||
65 | if (!flash_mtd) { | ||
66 | flash_mtd = do_map_probe("map_rom", &cdb89712_flash_map); | ||
67 | if (flash_mtd) | ||
68 | flash_mtd->erasesize = 0x10000; | ||
69 | } | ||
70 | if (!flash_mtd) { | ||
71 | printk("FLASH probe failed\n"); | ||
72 | err = -ENXIO; | ||
73 | goto out_ioremap; | ||
74 | } | ||
75 | |||
76 | flash_mtd->owner = THIS_MODULE; | ||
77 | |||
78 | if (mtd_device_register(flash_mtd, NULL, 0)) { | ||
79 | printk("FLASH device addition failed\n"); | ||
80 | err = -ENOMEM; | ||
81 | goto out_probe; | ||
82 | } | ||
83 | |||
84 | return 0; | ||
85 | |||
86 | out_probe: | ||
87 | map_destroy(flash_mtd); | ||
88 | flash_mtd = 0; | ||
89 | out_ioremap: | ||
90 | iounmap((void *)cdb89712_flash_map.virt); | ||
91 | out_resource: | ||
92 | release_resource (&cdb89712_flash_resource); | ||
93 | out: | ||
94 | return err; | ||
95 | } | ||
96 | |||
97 | |||
98 | |||
99 | |||
100 | |||
101 | static struct mtd_info *sram_mtd; | ||
102 | |||
103 | struct map_info cdb89712_sram_map = { | ||
104 | .name = "SRAM", | ||
105 | .size = SRAM_SIZE, | ||
106 | .bankwidth = SRAM_WIDTH, | ||
107 | .phys = SRAM_START, | ||
108 | }; | ||
109 | |||
110 | struct resource cdb89712_sram_resource = { | ||
111 | .name = "SRAM", | ||
112 | .start = SRAM_START, | ||
113 | .end = SRAM_START + SRAM_SIZE - 1, | ||
114 | .flags = IORESOURCE_IO | IORESOURCE_BUSY, | ||
115 | }; | ||
116 | |||
117 | static int __init init_cdb89712_sram (void) | ||
118 | { | ||
119 | int err; | ||
120 | |||
121 | if (request_resource (&ioport_resource, &cdb89712_sram_resource)) { | ||
122 | printk(KERN_NOTICE "Failed to reserve Cdb89712 SRAM space\n"); | ||
123 | err = -EBUSY; | ||
124 | goto out; | ||
125 | } | ||
126 | |||
127 | cdb89712_sram_map.virt = ioremap(SRAM_START, SRAM_SIZE); | ||
128 | if (!cdb89712_sram_map.virt) { | ||
129 | printk(KERN_NOTICE "Failed to ioremap Cdb89712 SRAM space\n"); | ||
130 | err = -EIO; | ||
131 | goto out_resource; | ||
132 | } | ||
133 | simple_map_init(&cdb89712_sram_map); | ||
134 | sram_mtd = do_map_probe("map_ram", &cdb89712_sram_map); | ||
135 | if (!sram_mtd) { | ||
136 | printk("SRAM probe failed\n"); | ||
137 | err = -ENXIO; | ||
138 | goto out_ioremap; | ||
139 | } | ||
140 | |||
141 | sram_mtd->owner = THIS_MODULE; | ||
142 | sram_mtd->erasesize = 16; | ||
143 | |||
144 | if (mtd_device_register(sram_mtd, NULL, 0)) { | ||
145 | printk("SRAM device addition failed\n"); | ||
146 | err = -ENOMEM; | ||
147 | goto out_probe; | ||
148 | } | ||
149 | |||
150 | return 0; | ||
151 | |||
152 | out_probe: | ||
153 | map_destroy(sram_mtd); | ||
154 | sram_mtd = 0; | ||
155 | out_ioremap: | ||
156 | iounmap((void *)cdb89712_sram_map.virt); | ||
157 | out_resource: | ||
158 | release_resource (&cdb89712_sram_resource); | ||
159 | out: | ||
160 | return err; | ||
161 | } | ||
162 | |||
163 | |||
164 | |||
165 | |||
166 | |||
167 | |||
168 | |||
169 | static struct mtd_info *bootrom_mtd; | ||
170 | |||
171 | struct map_info cdb89712_bootrom_map = { | ||
172 | .name = "BootROM", | ||
173 | .size = BOOTROM_SIZE, | ||
174 | .bankwidth = BOOTROM_WIDTH, | ||
175 | .phys = BOOTROM_START, | ||
176 | }; | ||
177 | |||
178 | struct resource cdb89712_bootrom_resource = { | ||
179 | .name = "BootROM", | ||
180 | .start = BOOTROM_START, | ||
181 | .end = BOOTROM_START + BOOTROM_SIZE - 1, | ||
182 | .flags = IORESOURCE_IO | IORESOURCE_BUSY, | ||
183 | }; | ||
184 | |||
185 | static int __init init_cdb89712_bootrom (void) | ||
186 | { | ||
187 | int err; | ||
188 | |||
189 | if (request_resource (&ioport_resource, &cdb89712_bootrom_resource)) { | ||
190 | printk(KERN_NOTICE "Failed to reserve Cdb89712 BOOTROM space\n"); | ||
191 | err = -EBUSY; | ||
192 | goto out; | ||
193 | } | ||
194 | |||
195 | cdb89712_bootrom_map.virt = ioremap(BOOTROM_START, BOOTROM_SIZE); | ||
196 | if (!cdb89712_bootrom_map.virt) { | ||
197 | printk(KERN_NOTICE "Failed to ioremap Cdb89712 BootROM space\n"); | ||
198 | err = -EIO; | ||
199 | goto out_resource; | ||
200 | } | ||
201 | simple_map_init(&cdb89712_bootrom_map); | ||
202 | bootrom_mtd = do_map_probe("map_rom", &cdb89712_bootrom_map); | ||
203 | if (!bootrom_mtd) { | ||
204 | printk("BootROM probe failed\n"); | ||
205 | err = -ENXIO; | ||
206 | goto out_ioremap; | ||
207 | } | ||
208 | |||
209 | bootrom_mtd->owner = THIS_MODULE; | ||
210 | bootrom_mtd->erasesize = 0x10000; | ||
211 | |||
212 | if (mtd_device_register(bootrom_mtd, NULL, 0)) { | ||
213 | printk("BootROM device addition failed\n"); | ||
214 | err = -ENOMEM; | ||
215 | goto out_probe; | ||
216 | } | ||
217 | |||
218 | return 0; | ||
219 | |||
220 | out_probe: | ||
221 | map_destroy(bootrom_mtd); | ||
222 | bootrom_mtd = 0; | ||
223 | out_ioremap: | ||
224 | iounmap((void *)cdb89712_bootrom_map.virt); | ||
225 | out_resource: | ||
226 | release_resource (&cdb89712_bootrom_resource); | ||
227 | out: | ||
228 | return err; | ||
229 | } | ||
230 | |||
231 | |||
232 | |||
233 | |||
234 | |||
235 | static int __init init_cdb89712_maps(void) | ||
236 | { | ||
237 | |||
238 | printk(KERN_INFO "Cirrus CDB89712 MTD mappings:\n Flash 0x%x at 0x%x\n SRAM 0x%x at 0x%x\n BootROM 0x%x at 0x%x\n", | ||
239 | FLASH_SIZE, FLASH_START, SRAM_SIZE, SRAM_START, BOOTROM_SIZE, BOOTROM_START); | ||
240 | |||
241 | init_cdb89712_flash(); | ||
242 | init_cdb89712_sram(); | ||
243 | init_cdb89712_bootrom(); | ||
244 | |||
245 | return 0; | ||
246 | } | ||
247 | |||
248 | |||
249 | static void __exit cleanup_cdb89712_maps(void) | ||
250 | { | ||
251 | if (sram_mtd) { | ||
252 | mtd_device_unregister(sram_mtd); | ||
253 | map_destroy(sram_mtd); | ||
254 | iounmap((void *)cdb89712_sram_map.virt); | ||
255 | release_resource (&cdb89712_sram_resource); | ||
256 | } | ||
257 | |||
258 | if (flash_mtd) { | ||
259 | mtd_device_unregister(flash_mtd); | ||
260 | map_destroy(flash_mtd); | ||
261 | iounmap((void *)cdb89712_flash_map.virt); | ||
262 | release_resource (&cdb89712_flash_resource); | ||
263 | } | ||
264 | |||
265 | if (bootrom_mtd) { | ||
266 | mtd_device_unregister(bootrom_mtd); | ||
267 | map_destroy(bootrom_mtd); | ||
268 | iounmap((void *)cdb89712_bootrom_map.virt); | ||
269 | release_resource (&cdb89712_bootrom_resource); | ||
270 | } | ||
271 | } | ||
272 | |||
273 | module_init(init_cdb89712_maps); | ||
274 | module_exit(cleanup_cdb89712_maps); | ||
275 | |||
276 | MODULE_AUTHOR("Ray L"); | ||
277 | MODULE_DESCRIPTION("ARM CDB89712 map driver"); | ||
278 | MODULE_LICENSE("GPL"); | ||