6 #include <linux/module.h>
7 #include <linux/types.h>
8 #include <linux/kernel.h>
10 #include <asm/byteorder.h>
11 #include <linux/errno.h>
12 #include <linux/slab.h>
18 static int mapram_read (
struct mtd_info *, loff_t,
size_t,
size_t *,
u_char *);
19 static int mapram_write (
struct mtd_info *, loff_t,
size_t,
size_t *,
const u_char *);
21 static void mapram_nop (
struct mtd_info *);
23 static unsigned long mapram_unmapped_area(
struct mtd_info *,
unsigned long,
24 unsigned long,
unsigned long);
28 .probe = map_ram_probe,
39 map_write8(map, 0x55, 0);
40 if (map_read8(map, 0) != 0x55)
43 map_write8(map, 0xAA, 0);
44 if (map_read8(map, 0) != 0xAA)
48 map_write8(map, 0x55, map->
size-1);
49 if (map_read8(map, map->
size-1) != 0x55)
52 map_write8(map, 0xAA, map->
size-1);
53 if (map_read8(map, map->
size-1) != 0xAA)
62 map->
fldrv = &mapram_chipdrv;
67 mtd->
_erase = mapram_erase;
69 mtd->
_read = mapram_read;
70 mtd->
_write = mapram_write;
71 mtd->
_sync = mapram_nop;
89 static unsigned long mapram_unmapped_area(
struct mtd_info *mtd,
107 static int mapram_write (
struct mtd_info *mtd, loff_t to,
size_t len,
size_t *retlen,
const u_char *
buf)
124 allff = map_word_ff(map);
125 for (i=0; i<instr->
len; i += map_bankwidth(map))
132 static void mapram_nop(
struct mtd_info *mtd)
137 static int __init map_ram_init(
void)
143 static void __exit map_ram_exit(
void)