11 #include <linux/module.h>
12 #include <linux/types.h>
13 #include <linux/kernel.h>
15 #include <asm/byteorder.h>
17 #include <linux/errno.h>
18 #include <linux/slab.h>
33 qry[0] = cfi_build_cmd(
'Q', map, cfi);
34 qry[1] = cfi_build_cmd(
'R', map, cfi);
35 qry[2] = cfi_build_cmd(
'Y', map, cfi);
37 val[0] =
map_read(map, base + osf*0x10);
38 val[1] =
map_read(map, base + osf*0x11);
39 val[2] =
map_read(map, base + osf*0x12);
41 if (!map_word_equal(map, qry[0], val[0]))
44 if (!map_word_equal(map, qry[1], val[1]))
47 if (!map_word_equal(map, qry[2], val[2]))
124 #ifdef CONFIG_MTD_XIP
131 for (i=0; i<
size; i++) {
132 ((
unsigned char *)extp)[
i] =
133 cfi_read_query(map, base+((adr+i)*ofs_factor));
139 #ifdef CONFIG_MTD_XIP
156 for (f=fixups; f->
fixup; f++) {
167 loff_t ofs,
size_t len,
void *thunk)
172 int chipnum,
ret = 0;
188 while (i < mtd->numeraseregions && ofs >= regions[i].
offset)
208 while (i<mtd->numeraseregions && (ofs + len) >= regions[i].offset)
216 if ((ofs + len) & (regions[i].
erasesize-1))
227 ret = (*frob)(
map, &cfi->
chips[chipnum], adr,
size, thunk);
236 if (ofs == regions[i].offset + size * regions[i].
numblocks)