aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/maps')
-rw-r--r--drivers/mtd/maps/Kconfig10
-rw-r--r--drivers/mtd/maps/Makefile2
-rw-r--r--drivers/mtd/maps/omap_nor.c2
-rw-r--r--drivers/mtd/maps/pcmciamtd.c22
4 files changed, 14 insertions, 22 deletions
diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig
index c7e97cf4c77e..4c364d44ad59 100644
--- a/drivers/mtd/maps/Kconfig
+++ b/drivers/mtd/maps/Kconfig
@@ -1,5 +1,3 @@
1# drivers/mtd/maps/Kconfig
2
3menu "Mapping drivers for chip access" 1menu "Mapping drivers for chip access"
4 depends on MTD!=n 2 depends on MTD!=n
5 3
@@ -74,7 +72,7 @@ config MTD_PHYSMAP_BANKWIDTH
74 72
75config MTD_PHYSMAP_OF 73config MTD_PHYSMAP_OF
76 tristate "Flash device in physical memory map based on OF description" 74 tristate "Flash device in physical memory map based on OF description"
77 depends on PPC_OF && (MTD_CFI || MTD_JEDECPROBE || MTD_ROM) 75 depends on (MICROBLAZE || PPC_OF) && (MTD_CFI || MTD_JEDECPROBE || MTD_ROM)
78 help 76 help
79 This provides a 'mapping' driver which allows the NOR Flash and 77 This provides a 'mapping' driver which allows the NOR Flash and
80 ROM driver code to communicate with chips which are mapped 78 ROM driver code to communicate with chips which are mapped
@@ -383,9 +381,9 @@ config MTD_IXP2000
383 depends on MTD_CFI && MTD_COMPLEX_MAPPINGS && ARCH_IXP2000 381 depends on MTD_CFI && MTD_COMPLEX_MAPPINGS && ARCH_IXP2000
384 help 382 help
385 This enables MTD access to flash devices on platforms based 383 This enables MTD access to flash devices on platforms based
386 on Intel's IXP2000 family of network processors such as the 384 on Intel's IXP2000 family of network processors. If you have an
387 IXDP425 and Coyote. If you have an IXP2000 based board and 385 IXP2000 based board and would like to use the flash chips on it,
388 would like to use the flash chips on it, say 'Y'. 386 say 'Y'.
389 387
390config MTD_FORTUNET 388config MTD_FORTUNET
391 tristate "CFI Flash device mapped on the FortuNet board" 389 tristate "CFI Flash device mapped on the FortuNet board"
diff --git a/drivers/mtd/maps/Makefile b/drivers/mtd/maps/Makefile
index 3078d6d0112f..ce315214ff2b 100644
--- a/drivers/mtd/maps/Makefile
+++ b/drivers/mtd/maps/Makefile
@@ -58,4 +58,6 @@ obj-$(CONFIG_MTD_PLATRAM) += plat-ram.o
58obj-$(CONFIG_MTD_OMAP_NOR) += omap_nor.o 58obj-$(CONFIG_MTD_OMAP_NOR) += omap_nor.o
59obj-$(CONFIG_MTD_INTEL_VR_NOR) += intel_vr_nor.o 59obj-$(CONFIG_MTD_INTEL_VR_NOR) += intel_vr_nor.o
60obj-$(CONFIG_MTD_BFIN_ASYNC) += bfin-async-flash.o 60obj-$(CONFIG_MTD_BFIN_ASYNC) += bfin-async-flash.o
61obj-$(CONFIG_MTD_RBTX4939) += rbtx4939-flash.o
62obj-$(CONFIG_MTD_VMU) += vmu-flash.o
61obj-$(CONFIG_MTD_GPIO_ADDR) += gpio-addr-flash.o 63obj-$(CONFIG_MTD_GPIO_ADDR) += gpio-addr-flash.o
diff --git a/drivers/mtd/maps/omap_nor.c b/drivers/mtd/maps/omap_nor.c
index a24478102b11..ead0b2fab670 100644
--- a/drivers/mtd/maps/omap_nor.c
+++ b/drivers/mtd/maps/omap_nor.c
@@ -45,7 +45,7 @@
45#include <asm/io.h> 45#include <asm/io.h>
46#include <mach/hardware.h> 46#include <mach/hardware.h>
47#include <asm/mach/flash.h> 47#include <asm/mach/flash.h>
48#include <mach/tc.h> 48#include <plat/tc.h>
49 49
50#ifdef CONFIG_MTD_PARTITIONS 50#ifdef CONFIG_MTD_PARTITIONS
51static const char *part_probes[] = { /* "RedBoot", */ "cmdlinepart", NULL }; 51static const char *part_probes[] = { /* "RedBoot", */ "cmdlinepart", NULL };
diff --git a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c
index 52c07f21be01..689d6a79ffc0 100644
--- a/drivers/mtd/maps/pcmciamtd.c
+++ b/drivers/mtd/maps/pcmciamtd.c
@@ -118,11 +118,9 @@ static caddr_t remap_window(struct map_info *map, unsigned long to)
118 DEBUG(2, "Remapping window from 0x%8.8x to 0x%8.8x", 118 DEBUG(2, "Remapping window from 0x%8.8x to 0x%8.8x",
119 dev->offset, mrq.CardOffset); 119 dev->offset, mrq.CardOffset);
120 mrq.Page = 0; 120 mrq.Page = 0;
121 ret = pcmcia_map_mem_page(win, &mrq); 121 ret = pcmcia_map_mem_page(dev->p_dev, win, &mrq);
122 if (ret != 0) { 122 if (ret != 0)
123 cs_error(dev->p_dev, MapMemPage, ret);
124 return NULL; 123 return NULL;
125 }
126 dev->offset = mrq.CardOffset; 124 dev->offset = mrq.CardOffset;
127 } 125 }
128 return dev->win_base + (to & (dev->win_size-1)); 126 return dev->win_base + (to & (dev->win_size-1));
@@ -327,8 +325,6 @@ static void pcmciamtd_set_vpp(struct map_info *map, int on)
327 325
328 DEBUG(2, "dev = %p on = %d vpp = %d\n", dev, on, dev->vpp); 326 DEBUG(2, "dev = %p on = %d vpp = %d\n", dev, on, dev->vpp);
329 ret = pcmcia_modify_configuration(link, &mod); 327 ret = pcmcia_modify_configuration(link, &mod);
330 if (ret != 0)
331 cs_error(link, ModifyConfiguration, ret);
332} 328}
333 329
334 330
@@ -348,7 +344,7 @@ static void pcmciamtd_release(struct pcmcia_device *link)
348 iounmap(dev->win_base); 344 iounmap(dev->win_base);
349 dev->win_base = NULL; 345 dev->win_base = NULL;
350 } 346 }
351 pcmcia_release_window(link->win); 347 pcmcia_release_window(link, link->win);
352 } 348 }
353 pcmcia_disable_device(link); 349 pcmcia_disable_device(link);
354} 350}
@@ -393,6 +389,7 @@ static int pcmciamtd_cistpl_device(struct pcmcia_device *p_dev,
393 struct pcmciamtd_dev *dev = priv_data; 389 struct pcmciamtd_dev *dev = priv_data;
394 cisparse_t parse; 390 cisparse_t parse;
395 cistpl_device_t *t = &parse.device; 391 cistpl_device_t *t = &parse.device;
392 int i;
396 393
397 if (pcmcia_parse_tuple(tuple, &parse)) 394 if (pcmcia_parse_tuple(tuple, &parse))
398 return -EINVAL; 395 return -EINVAL;
@@ -416,6 +413,7 @@ static int pcmciamtd_cistpl_geo(struct pcmcia_device *p_dev,
416 struct pcmciamtd_dev *dev = priv_data; 413 struct pcmciamtd_dev *dev = priv_data;
417 cisparse_t parse; 414 cisparse_t parse;
418 cistpl_device_geo_t *t = &parse.device_geo; 415 cistpl_device_geo_t *t = &parse.device_geo;
416 int i;
419 417
420 if (pcmcia_parse_tuple(tuple, &parse)) 418 if (pcmcia_parse_tuple(tuple, &parse))
421 return -EINVAL; 419 return -EINVAL;
@@ -488,16 +486,12 @@ static void card_settings(struct pcmciamtd_dev *dev, struct pcmcia_device *link,
488 * MTD device available to the system. 486 * MTD device available to the system.
489 */ 487 */
490 488
491#define CS_CHECK(fn, ret) \
492do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
493
494static int pcmciamtd_config(struct pcmcia_device *link) 489static int pcmciamtd_config(struct pcmcia_device *link)
495{ 490{
496 struct pcmciamtd_dev *dev = link->priv; 491 struct pcmciamtd_dev *dev = link->priv;
497 struct mtd_info *mtd = NULL; 492 struct mtd_info *mtd = NULL;
498 cs_status_t status; 493 cs_status_t status;
499 win_req_t req; 494 win_req_t req;
500 int last_ret = 0, last_fn = 0;
501 int ret; 495 int ret;
502 int i; 496 int i;
503 static char *probes[] = { "jedec_probe", "cfi_probe" }; 497 static char *probes[] = { "jedec_probe", "cfi_probe" };
@@ -536,7 +530,7 @@ static int pcmciamtd_config(struct pcmcia_device *link)
536 int ret; 530 int ret;
537 DEBUG(2, "requesting window with size = %dKiB memspeed = %d", 531 DEBUG(2, "requesting window with size = %dKiB memspeed = %d",
538 req.Size >> 10, req.AccessSpeed); 532 req.Size >> 10, req.AccessSpeed);
539 ret = pcmcia_request_window(&link, &req, &link->win); 533 ret = pcmcia_request_window(link, &req, &link->win);
540 DEBUG(2, "ret = %d dev->win_size = %d", ret, dev->win_size); 534 DEBUG(2, "ret = %d dev->win_size = %d", ret, dev->win_size);
541 if(ret) { 535 if(ret) {
542 req.Size >>= 1; 536 req.Size >>= 1;
@@ -584,7 +578,6 @@ static int pcmciamtd_config(struct pcmcia_device *link)
584 DEBUG(2, "Setting Configuration"); 578 DEBUG(2, "Setting Configuration");
585 ret = pcmcia_request_configuration(link, &link->conf); 579 ret = pcmcia_request_configuration(link, &link->conf);
586 if (ret != 0) { 580 if (ret != 0) {
587 cs_error(link, RequestConfiguration, ret);
588 if (dev->win_base) { 581 if (dev->win_base) {
589 iounmap(dev->win_base); 582 iounmap(dev->win_base);
590 dev->win_base = NULL; 583 dev->win_base = NULL;
@@ -659,8 +652,7 @@ static int pcmciamtd_config(struct pcmcia_device *link)
659 link->dev_node = &dev->node; 652 link->dev_node = &dev->node;
660 return 0; 653 return 0;
661 654
662 cs_failed: 655 failed:
663 cs_error(link, last_fn, last_ret);
664 err("CS Error, exiting"); 656 err("CS Error, exiting");
665 pcmciamtd_release(link); 657 pcmciamtd_release(link);
666 return -ENODEV; 658 return -ENODEV;