18 #include <linux/module.h>
28 #define WINDOW_START 0xd8000
29 #define WINDOW_LENGTH 0x2000
30 #define WINDOW_SHIFT 25
31 #define WINDOW_MASK 0x1FFF
47 static inline void vmax301_page(
struct map_info *
map,
52 __vmax301_page(map, page);
58 spin_lock(&vmax301_spin);
59 vmax301_page(map, ofs);
61 spin_unlock(&vmax301_spin);
65 static void vmax301_copy_from(
struct map_info *map,
void *to,
unsigned long from,
ssize_t len)
68 unsigned long thislen = len;
71 spin_lock(&vmax301_spin);
72 vmax301_page(map, from);
74 spin_unlock(&vmax301_spin);
83 spin_lock(&vmax301_spin);
84 vmax301_page(map, adr);
86 spin_unlock(&vmax301_spin);
89 static void vmax301_copy_to(
struct map_info *map,
unsigned long to,
const void *from,
ssize_t len)
92 unsigned long thislen = len;
96 spin_lock(&vmax301_spin);
97 vmax301_page(map, to);
99 spin_unlock(&vmax301_spin);
106 static struct map_info vmax_map[2] = {
108 .name =
"VMAX301 Internal Flash",
110 .size = 3*2*1024*1024,
112 .read = vmax301_read8,
113 .copy_from = vmax301_copy_from,
114 .write = vmax301_write8,
115 .copy_to = vmax301_copy_to,
117 .map_priv_2 = 0xFFFFFFFF
120 .name =
"VMAX301 Socket",
124 .read = vmax301_read8,
125 .copy_from = vmax301_copy_from,
126 .write = vmax301_write8,
127 .copy_to = vmax301_copy_to,
135 static void __exit cleanup_vmax301(
void)
139 for (i=0; i<2; i++) {
148 static int __init init_vmax301(
void)
151 unsigned long iomapadr;
158 printk(
"Failed to ioremap memory region\n");
169 for (i=0; i<2; i++) {
183 if (!vmax_mtd[0] && !vmax_mtd[1]) {