git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 1.9.5.x5
[linux-2.6.git]
/
drivers
/
mtd
/
maps
/
lubbock-flash.c
diff --git
a/drivers/mtd/maps/lubbock-flash.c
b/drivers/mtd/maps/lubbock-flash.c
index
c7e2546
..
1298de4
100644
(file)
--- a/
drivers/mtd/maps/lubbock-flash.c
+++ b/
drivers/mtd/maps/lubbock-flash.c
@@
-1,5
+1,5
@@
/*
/*
- * $Id: lubbock-flash.c,v 1.
9 2003/06/23 11:48:18 dwmw2
Exp $
+ * $Id: lubbock-flash.c,v 1.
19 2004/11/04 13:24:15 gleixner
Exp $
*
* Map driver for the Lubbock developer platform.
*
*
* Map driver for the Lubbock developer platform.
*
@@
-15,11
+15,14
@@
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/init.h>
-#include <
asm/io
.h>
+#include <
linux/dma-mapping
.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>
#include <linux/mtd/partitions.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>
#include <linux/mtd/partitions.h>
+#include <asm/io.h>
#include <asm/hardware.h>
#include <asm/hardware.h>
+#include <asm/arch/pxa-regs.h>
+#include <asm/arch/lubbock.h>
#define ROM_ADDR 0x00000000
#define ROM_ADDR 0x00000000
@@
-27,12
+30,19
@@
#define WINDOW_SIZE 64*1024*1024
#define WINDOW_SIZE 64*1024*1024
+static void lubbock_map_inval_cache(struct map_info *map, unsigned long from, ssize_t len)
+{
+ consistent_sync((char *)map->cached + from, len, DMA_FROM_DEVICE);
+}
+
static struct map_info lubbock_maps[2] = { {
.size = WINDOW_SIZE,
.phys = 0x00000000,
static struct map_info lubbock_maps[2] = { {
.size = WINDOW_SIZE,
.phys = 0x00000000,
+ .inval_cache = lubbock_map_inval_cache,
}, {
.size = WINDOW_SIZE,
.phys = 0x04000000,
}, {
.size = WINDOW_SIZE,
.phys = 0x04000000,
+ .inval_cache = lubbock_map_inval_cache,
} };
static struct mtd_partition lubbock_partitions[] = {
} };
static struct mtd_partition lubbock_partitions[] = {
@@
-63,7
+73,7
@@
static int __init init_lubbock(void)
int flashboot = (LUB_CONF_SWITCHES & 1);
int ret = 0, i;
int flashboot = (LUB_CONF_SWITCHES & 1);
int ret = 0, i;
- lubbock_maps[0].b
uswidth = lubbock_maps[1].bus
width =
+ lubbock_maps[0].b
ankwidth = lubbock_maps[1].bank
width =
(BOOT_DEF & 1) ? 2 : 4;
/* Compensate for the nROMBT switch which swaps the flash banks */
(BOOT_DEF & 1) ? 2 : 4;
/* Compensate for the nROMBT switch which swaps the flash banks */
@@
-74,23
+84,28
@@
static int __init init_lubbock(void)
lubbock_maps[flashboot].name = "Lubbock Boot ROM";
for (i = 0; i < 2; i++) {
lubbock_maps[flashboot].name = "Lubbock Boot ROM";
for (i = 0; i < 2; i++) {
- lubbock_maps[i].virt =
(unsigned long)
ioremap(lubbock_maps[i].phys, WINDOW_SIZE);
+ lubbock_maps[i].virt = ioremap(lubbock_maps[i].phys, WINDOW_SIZE);
if (!lubbock_maps[i].virt) {
printk(KERN_WARNING "Failed to ioremap %s\n", lubbock_maps[i].name);
if (!ret)
ret = -ENOMEM;
continue;
}
if (!lubbock_maps[i].virt) {
printk(KERN_WARNING "Failed to ioremap %s\n", lubbock_maps[i].name);
if (!ret)
ret = -ENOMEM;
continue;
}
+ lubbock_maps[i].cached = ioremap_cached(lubbock_maps[i].phys, WINDOW_SIZE);
+ if (!lubbock_maps[i].cached)
+ printk(KERN_WARNING "Failed to ioremap cached %s\n", lubbock_maps[i].name);
simple_map_init(&lubbock_maps[i]);
simple_map_init(&lubbock_maps[i]);
- printk(KERN_NOTICE "Probing %s at physical address 0x%08lx (%d-bit b
us
width)\n",
+ printk(KERN_NOTICE "Probing %s at physical address 0x%08lx (%d-bit b
ank
width)\n",
lubbock_maps[i].name, lubbock_maps[i].phys,
lubbock_maps[i].name, lubbock_maps[i].phys,
- lubbock_maps[i].b
us
width * 8);
+ lubbock_maps[i].b
ank
width * 8);
mymtds[i] = do_map_probe("cfi_probe", &lubbock_maps[i]);
if (!mymtds[i]) {
iounmap((void *)lubbock_maps[i].virt);
mymtds[i] = do_map_probe("cfi_probe", &lubbock_maps[i]);
if (!mymtds[i]) {
iounmap((void *)lubbock_maps[i].virt);
+ if (lubbock_maps[i].cached)
+ iounmap(lubbock_maps[i].cached);
if (!ret)
ret = -EIO;
continue;
if (!ret)
ret = -EIO;
continue;
@@
-137,6
+152,8
@@
static void __exit cleanup_lubbock(void)
map_destroy(mymtds[i]);
iounmap((void *)lubbock_maps[i].virt);
map_destroy(mymtds[i]);
iounmap((void *)lubbock_maps[i].virt);
+ if (lubbock_maps[i].cached)
+ iounmap(lubbock_maps[i].cached);
if (parsed_parts[i])
kfree(parsed_parts[i]);
if (parsed_parts[i])
kfree(parsed_parts[i]);