summaryrefslogtreecommitdiffstats
path: root/linux-2.4.x/drivers/mtd/maps/tsunami_flash.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux-2.4.x/drivers/mtd/maps/tsunami_flash.c')
-rw-r--r--linux-2.4.x/drivers/mtd/maps/tsunami_flash.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/linux-2.4.x/drivers/mtd/maps/tsunami_flash.c b/linux-2.4.x/drivers/mtd/maps/tsunami_flash.c
index 33b6350..9e21e6c 100644
--- a/linux-2.4.x/drivers/mtd/maps/tsunami_flash.c
+++ b/linux-2.4.x/drivers/mtd/maps/tsunami_flash.c
@@ -2,25 +2,29 @@
* tsunami_flash.c
*
* flash chip on alpha ds10...
- * $Id: tsunami_flash.c,v 1.1 2002/01/10 22:59:13 eric Exp $
+ * $Id: tsunami_flash.c,v 1.10 2005/11/07 11:14:29 gleixner Exp $
*/
#include <asm/io.h>
#include <asm/core_tsunami.h>
+#include <linux/init.h>
#include <linux/mtd/map.h>
+#include <linux/mtd/mtd.h>
#define FLASH_ENABLE_PORT 0x00C00001
#define FLASH_ENABLE_BYTE 0x01
#define FLASH_DISABLE_BYTE 0x00
#define MAX_TIG_FLASH_SIZE (12*1024*1024)
-static inline __u8 tsunami_flash_read8(struct map_info *map, unsigned long offset)
+static inline map_word tsunami_flash_read8(struct map_info *map, unsigned long offset)
{
- return tsunami_tig_readb(offset);
+ map_word val;
+ val.x[0] = tsunami_tig_readb(offset);
+ return val;
}
-static void tsunami_flash_write8(struct map_info *map, __u8 value, unsigned long offset)
+static void tsunami_flash_write8(struct map_info *map, map_word value, unsigned long offset)
{
- tsunami_tig_writeb(value, offset);
+ tsunami_tig_writeb(value.x[0], offset);
}
static void tsunami_flash_copy_from(
@@ -37,7 +41,7 @@ static void tsunami_flash_copy_from(
}
static void tsunami_flash_copy_to(
- struct map_info *map, unsigned long offset,
+ struct map_info *map, unsigned long offset,
const void *addr, ssize_t len)
{
const unsigned char *src;
@@ -58,18 +62,12 @@ static void tsunami_flash_copy_to(
static struct map_info tsunami_flash_map = {
.name = "flash chip on the Tsunami TIG bus",
.size = MAX_TIG_FLASH_SIZE,
- .buswidth = 1,
- .read8 = tsunami_flash_read8,
- .read16 = 0,
- .read32 = 0,
+ .phys = NO_XIP;
+ .bankwidth = 1,
+ .read = tsunami_flash_read8,
.copy_from = tsunami_flash_copy_from,
- .write8 = tsunami_flash_write8,
- .write16 = 0,
- .write32 = 0,
+ .write = tsunami_flash_write8,
.copy_to = tsunami_flash_copy_to,
- .set_vpp = 0,
- .map_priv_1 = 0,
-
};
static struct mtd_info *tsunami_flash_mtd;
@@ -88,18 +86,18 @@ static void __exit cleanup_tsunami_flash(void)
static int __init init_tsunami_flash(void)
{
- static const char *rom_probe_types[] = { "cfi_probe", "jedec_probe", "map_rom", 0 };
+ static const char *rom_probe_types[] = { "cfi_probe", "jedec_probe", "map_rom", NULL };
char **type;
tsunami_tig_writeb(FLASH_ENABLE_BYTE, FLASH_ENABLE_PORT);
-
+
tsunami_flash_mtd = 0;
type = rom_probe_types;
for(; !tsunami_flash_mtd && *type; type++) {
tsunami_flash_mtd = do_map_probe(*type, &tsunami_flash_map);
}
if (tsunami_flash_mtd) {
- tsunami_flash_mtd->module = THIS_MODULE;
+ tsunami_flash_mtd->owner = THIS_MODULE;
add_mtd_device(tsunami_flash_mtd);
return 0;
}