aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-10 14:49:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-10 14:49:21 -0400
commite8a89cebdbaab14caaa26debdb4ffd493b8831af (patch)
treee0843f082628408ce259c72db36da54dff603987 /drivers/mtd/maps
parent8196867c74890ccdf40a2b5e3e173597fbc4f9ac (diff)
parent6ae0185fe201eae0548dace2a84acb5050fc8606 (diff)
Merge git://git.infradead.org/mtd-2.6
* git://git.infradead.org/mtd-2.6: (79 commits) mtd: Remove obsolete <mtd/compatmac.h> include mtd: Update copyright notices jffs2: Update copyright notices mtd-physmap: add support users can assign the probe type in board files mtd: remove redwood map driver mxc_nand: Add v3 (i.MX51) Support mxc_nand: support 8bit ecc mxc_nand: fix correct_data function mxc_nand: add V1_V2 namespace to registers mxc_nand: factor out a check_int function mxc_nand: make some internally used functions overwriteable mxc_nand: rework get_dev_status mxc_nand: remove 0xe00 offset from registers mtd: denali: Add multi connected NAND support mtd: denali: Remove set_ecc_config function mtd: denali: Remove unuseful code in get_xx_nand_para functions mtd: denali: Remove device_info_tag structure mtd: m25p80: add support for the Winbond W25Q32 SPI flash chip mtd: m25p80: add support for the Intel/Numonyx {16,32,64}0S33B SPI flash chips mtd: m25p80: add support for the EON EN25P{32, 64} SPI flash chips ... Fix up trivial conflicts in drivers/mtd/maps/{Kconfig,redwood.c} due to redwood driver removal.
Diffstat (limited to 'drivers/mtd/maps')
-rw-r--r--drivers/mtd/maps/Kconfig8
-rw-r--r--drivers/mtd/maps/Makefile1
-rw-r--r--drivers/mtd/maps/ixp4xx.c35
-rw-r--r--drivers/mtd/maps/physmap.c14
-rw-r--r--drivers/mtd/maps/physmap_of.c6
-rw-r--r--drivers/mtd/maps/redwood.c131
6 files changed, 39 insertions, 156 deletions
diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig
index 6629d09f3b38..701d942c6795 100644
--- a/drivers/mtd/maps/Kconfig
+++ b/drivers/mtd/maps/Kconfig
@@ -319,14 +319,6 @@ config MTD_CFI_FLAGADM
319 Mapping for the Flaga digital module. If you don't have one, ignore 319 Mapping for the Flaga digital module. If you don't have one, ignore
320 this setting. 320 this setting.
321 321
322config MTD_REDWOOD
323 tristate "CFI Flash devices mapped on IBM Redwood"
324 depends on MTD_CFI
325 help
326 This enables access routines for the flash chips on the IBM
327 Redwood board. If you have one of these boards and would like to
328 use the flash chips on it, say 'Y'.
329
330config MTD_SOLUTIONENGINE 322config MTD_SOLUTIONENGINE
331 tristate "CFI Flash device mapped on Hitachi SolutionEngine" 323 tristate "CFI Flash device mapped on Hitachi SolutionEngine"
332 depends on SUPERH && SOLUTION_ENGINE && MTD_CFI && MTD_REDBOOT_PARTS 324 depends on SUPERH && SOLUTION_ENGINE && MTD_CFI && MTD_REDBOOT_PARTS
diff --git a/drivers/mtd/maps/Makefile b/drivers/mtd/maps/Makefile
index bb035cd54c72..f216bb573713 100644
--- a/drivers/mtd/maps/Makefile
+++ b/drivers/mtd/maps/Makefile
@@ -44,7 +44,6 @@ obj-$(CONFIG_MTD_AUTCPU12) += autcpu12-nvram.o
44obj-$(CONFIG_MTD_EDB7312) += edb7312.o 44obj-$(CONFIG_MTD_EDB7312) += edb7312.o
45obj-$(CONFIG_MTD_IMPA7) += impa7.o 45obj-$(CONFIG_MTD_IMPA7) += impa7.o
46obj-$(CONFIG_MTD_FORTUNET) += fortunet.o 46obj-$(CONFIG_MTD_FORTUNET) += fortunet.o
47obj-$(CONFIG_MTD_REDWOOD) += redwood.o
48obj-$(CONFIG_MTD_UCLINUX) += uclinux.o 47obj-$(CONFIG_MTD_UCLINUX) += uclinux.o
49obj-$(CONFIG_MTD_NETtel) += nettel.o 48obj-$(CONFIG_MTD_NETtel) += nettel.o
50obj-$(CONFIG_MTD_SCB2_FLASH) += scb2_flash.o 49obj-$(CONFIG_MTD_SCB2_FLASH) += scb2_flash.o
diff --git a/drivers/mtd/maps/ixp4xx.c b/drivers/mtd/maps/ixp4xx.c
index e0a5e0426ead..1f9fde0dad35 100644
--- a/drivers/mtd/maps/ixp4xx.c
+++ b/drivers/mtd/maps/ixp4xx.c
@@ -118,7 +118,7 @@ static void ixp4xx_copy_from(struct map_info *map, void *to,
118 *dest++ = BYTE1(data); 118 *dest++ = BYTE1(data);
119 src += 2; 119 src += 2;
120 len -= 2; 120 len -= 2;
121 } 121 }
122 122
123 if (len > 0) 123 if (len > 0)
124 *dest++ = BYTE0(flash_read16(src)); 124 *dest++ = BYTE0(flash_read16(src));
@@ -185,6 +185,8 @@ static int ixp4xx_flash_probe(struct platform_device *dev)
185{ 185{
186 struct flash_platform_data *plat = dev->dev.platform_data; 186 struct flash_platform_data *plat = dev->dev.platform_data;
187 struct ixp4xx_flash_info *info; 187 struct ixp4xx_flash_info *info;
188 const char *part_type = NULL;
189 int nr_parts = 0;
188 int err = -1; 190 int err = -1;
189 191
190 if (!plat) 192 if (!plat)
@@ -218,9 +220,9 @@ static int ixp4xx_flash_probe(struct platform_device *dev)
218 */ 220 */
219 info->map.bankwidth = 2; 221 info->map.bankwidth = 2;
220 info->map.name = dev_name(&dev->dev); 222 info->map.name = dev_name(&dev->dev);
221 info->map.read = ixp4xx_read16, 223 info->map.read = ixp4xx_read16;
222 info->map.write = ixp4xx_probe_write16, 224 info->map.write = ixp4xx_probe_write16;
223 info->map.copy_from = ixp4xx_copy_from, 225 info->map.copy_from = ixp4xx_copy_from;
224 226
225 info->res = request_mem_region(dev->resource->start, 227 info->res = request_mem_region(dev->resource->start,
226 resource_size(dev->resource), 228 resource_size(dev->resource),
@@ -248,11 +250,28 @@ static int ixp4xx_flash_probe(struct platform_device *dev)
248 info->mtd->owner = THIS_MODULE; 250 info->mtd->owner = THIS_MODULE;
249 251
250 /* Use the fast version */ 252 /* Use the fast version */
251 info->map.write = ixp4xx_write16, 253 info->map.write = ixp4xx_write16;
254
255#ifdef CONFIG_MTD_PARTITIONS
256 nr_parts = parse_mtd_partitions(info->mtd, probes, &info->partitions,
257 dev->resource->start);
258#endif
259 if (nr_parts > 0) {
260 part_type = "dynamic";
261 } else {
262 info->partitions = plat->parts;
263 nr_parts = plat->nr_parts;
264 part_type = "static";
265 }
266 if (nr_parts == 0) {
267 printk(KERN_NOTICE "IXP4xx flash: no partition info "
268 "available, registering whole flash\n");
269 err = add_mtd_device(info->mtd);
270 } else {
271 printk(KERN_NOTICE "IXP4xx flash: using %s partition "
272 "definition\n", part_type);
273 err = add_mtd_partitions(info->mtd, info->partitions, nr_parts);
252 274
253 err = parse_mtd_partitions(info->mtd, probes, &info->partitions, dev->resource->start);
254 if (err > 0) {
255 err = add_mtd_partitions(info->mtd, info->partitions, err);
256 if(err) 275 if(err)
257 printk(KERN_ERR "Could not parse partitions\n"); 276 printk(KERN_ERR "Could not parse partitions\n");
258 } 277 }
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
index 426461a5f0d4..4c18b98a3110 100644
--- a/drivers/mtd/maps/physmap.c
+++ b/drivers/mtd/maps/physmap.c
@@ -106,12 +106,12 @@ static int physmap_flash_probe(struct platform_device *dev)
106 106
107 for (i = 0; i < dev->num_resources; i++) { 107 for (i = 0; i < dev->num_resources; i++) {
108 printk(KERN_NOTICE "physmap platform flash device: %.8llx at %.8llx\n", 108 printk(KERN_NOTICE "physmap platform flash device: %.8llx at %.8llx\n",
109 (unsigned long long)(dev->resource[i].end - dev->resource[i].start + 1), 109 (unsigned long long)resource_size(&dev->resource[i]),
110 (unsigned long long)dev->resource[i].start); 110 (unsigned long long)dev->resource[i].start);
111 111
112 if (!devm_request_mem_region(&dev->dev, 112 if (!devm_request_mem_region(&dev->dev,
113 dev->resource[i].start, 113 dev->resource[i].start,
114 dev->resource[i].end - dev->resource[i].start + 1, 114 resource_size(&dev->resource[i]),
115 dev_name(&dev->dev))) { 115 dev_name(&dev->dev))) {
116 dev_err(&dev->dev, "Could not reserve memory region\n"); 116 dev_err(&dev->dev, "Could not reserve memory region\n");
117 err = -ENOMEM; 117 err = -ENOMEM;
@@ -120,7 +120,7 @@ static int physmap_flash_probe(struct platform_device *dev)
120 120
121 info->map[i].name = dev_name(&dev->dev); 121 info->map[i].name = dev_name(&dev->dev);
122 info->map[i].phys = dev->resource[i].start; 122 info->map[i].phys = dev->resource[i].start;
123 info->map[i].size = dev->resource[i].end - dev->resource[i].start + 1; 123 info->map[i].size = resource_size(&dev->resource[i]);
124 info->map[i].bankwidth = physmap_data->width; 124 info->map[i].bankwidth = physmap_data->width;
125 info->map[i].set_vpp = physmap_data->set_vpp; 125 info->map[i].set_vpp = physmap_data->set_vpp;
126 info->map[i].pfow_base = physmap_data->pfow_base; 126 info->map[i].pfow_base = physmap_data->pfow_base;
@@ -136,8 +136,12 @@ static int physmap_flash_probe(struct platform_device *dev)
136 simple_map_init(&info->map[i]); 136 simple_map_init(&info->map[i]);
137 137
138 probe_type = rom_probe_types; 138 probe_type = rom_probe_types;
139 for (; info->mtd[i] == NULL && *probe_type != NULL; probe_type++) 139 if (physmap_data->probe_type == NULL) {
140 info->mtd[i] = do_map_probe(*probe_type, &info->map[i]); 140 for (; info->mtd[i] == NULL && *probe_type != NULL; probe_type++)
141 info->mtd[i] = do_map_probe(*probe_type, &info->map[i]);
142 } else
143 info->mtd[i] = do_map_probe(physmap_data->probe_type, &info->map[i]);
144
141 if (info->mtd[i] == NULL) { 145 if (info->mtd[i] == NULL) {
142 dev_err(&dev->dev, "map_probe failed\n"); 146 dev_err(&dev->dev, "map_probe failed\n");
143 err = -ENXIO; 147 err = -ENXIO;
diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
index ba124baa646d..6ac5f9f28ac3 100644
--- a/drivers/mtd/maps/physmap_of.c
+++ b/drivers/mtd/maps/physmap_of.c
@@ -353,7 +353,7 @@ static int __devinit of_flash_probe(struct of_device *dev,
353 &info->parts, 0); 353 &info->parts, 0);
354 if (err < 0) { 354 if (err < 0) {
355 of_free_probes(part_probe_types); 355 of_free_probes(part_probe_types);
356 return err; 356 goto err_out;
357 } 357 }
358 of_free_probes(part_probe_types); 358 of_free_probes(part_probe_types);
359 359
@@ -361,14 +361,14 @@ static int __devinit of_flash_probe(struct of_device *dev,
361 if (err == 0) { 361 if (err == 0) {
362 err = of_mtd_parse_partitions(&dev->dev, dp, &info->parts); 362 err = of_mtd_parse_partitions(&dev->dev, dp, &info->parts);
363 if (err < 0) 363 if (err < 0)
364 return err; 364 goto err_out;
365 } 365 }
366#endif 366#endif
367 367
368 if (err == 0) { 368 if (err == 0) {
369 err = parse_obsolete_partitions(dev, info, dp); 369 err = parse_obsolete_partitions(dev, info, dp);
370 if (err < 0) 370 if (err < 0)
371 return err; 371 goto err_out;
372 } 372 }
373 373
374 if (err > 0) 374 if (err > 0)
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
39static 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
70struct 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
80static struct mtd_info *redwood_mtd;
81
82static 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
116static 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
126module_init(init_redwood_flash);
127module_exit(cleanup_redwood_flash);
128
129MODULE_LICENSE("GPL");
130MODULE_AUTHOR("MontaVista Software <source@mvista.com>");
131MODULE_DESCRIPTION("MTD map driver for the IBM Redwood reference boards");