Lines Matching defs:map

23 #include <linux/mtd/map.h>
41 struct map_info *map, struct cfi_private *cfi)
43 unsigned bankwidth = map_bankwidth(map);
67 map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cfi_private *cfi)
78 if (map_bankwidth_is_large(map)) {
80 words_per_bus = (map_bankwidth(map)) / wordwidth; // i.e. normally 1
82 wordwidth = map_bankwidth(map);
86 chip_mode = map_bankwidth(map) / cfi_interleave(cfi);
87 chips_per_word = wordwidth * cfi_interleave(cfi) / map_bankwidth(map);
97 onecmd = cpu_to_cfi16(map, cmd);
100 onecmd = cpu_to_cfi32(map, cmd);
133 unsigned long cfi_merge_status(map_word val, struct map_info *map,
144 if (map_bankwidth_is_large(map)) {
146 words_per_bus = (map_bankwidth(map)) / wordwidth; // i.e. normally 1
148 wordwidth = map_bankwidth(map);
152 chip_mode = map_bankwidth(map) / cfi_interleave(cfi);
153 chips_per_word = wordwidth * cfi_interleave(cfi) / map_bankwidth(map);
185 res = cfi16_to_cpu(map, res);
188 res = cfi32_to_cpu(map, res);
204 struct map_info *map, struct cfi_private *cfi,
208 uint32_t addr = base + cfi_build_cmd_addr(cmd_addr, map, cfi);
209 val = cfi_build_cmd(cmd, map, cfi);
212 *prev_val = map_read(map, addr);
214 map_write(map, val, addr);
220 int __xipram cfi_qry_present(struct map_info *map, __u32 base,
227 qry[0] = cfi_build_cmd('Q', map, cfi);
228 qry[1] = cfi_build_cmd('R', map, cfi);
229 qry[2] = cfi_build_cmd('Y', map, cfi);
231 val[0] = map_read(map, base + osf*0x10);
232 val[1] = map_read(map, base + osf*0x11);
233 val[2] = map_read(map, base + osf*0x12);
235 if (!map_word_equal(map, qry[0], val[0]))
238 if (!map_word_equal(map, qry[1], val[1]))
241 if (!map_word_equal(map, qry[2], val[2]))
248 int __xipram cfi_qry_mode_on(uint32_t base, struct map_info *map,
251 cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
252 cfi_send_gen_cmd(0x98, 0x55, base, map, cfi, cfi->device_type, NULL);
253 if (cfi_qry_present(map, base, cfi))
257 cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
258 cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL);
259 cfi_send_gen_cmd(0x98, 0x55, base, map, cfi, cfi->device_type, NULL);
260 if (cfi_qry_present(map, base, cfi))
263 cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
264 cfi_send_gen_cmd(0x98, 0x555, base, map, cfi, cfi->device_type, NULL);
265 if (cfi_qry_present(map, base, cfi))
268 cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
269 cfi_send_gen_cmd(0xAA, 0x5555, base, map, cfi, cfi->device_type, NULL);
270 cfi_send_gen_cmd(0x55, 0x2AAA, base, map, cfi, cfi->device_type, NULL);
271 cfi_send_gen_cmd(0x98, 0x5555, base, map, cfi, cfi->device_type, NULL);
272 if (cfi_qry_present(map, base, cfi))
275 cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
276 cfi_send_gen_cmd(0xAA, 0x555, base, map, cfi, cfi->device_type, NULL);
277 cfi_send_gen_cmd(0x55, 0x2AA, base, map, cfi, cfi->device_type, NULL);
278 cfi_send_gen_cmd(0x98, 0x555, base, map, cfi, cfi->device_type, NULL);
279 if (cfi_qry_present(map, base, cfi))
286 void __xipram cfi_qry_mode_off(uint32_t base, struct map_info *map,
289 cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
290 cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL);
294 cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
299 __xipram cfi_read_pri(struct map_info *map, __u16 adr, __u16 size, const char* name)
301 struct cfi_private *cfi = map->fldrv_priv;
321 cfi_qry_mode_on(base, map, cfi);
325 cfi_read_query(map, base+((adr+i)*ofs_factor));
329 cfi_qry_mode_off(base, map, cfi);
332 (void) map_read(map, base);
344 struct map_info *map = mtd->priv;
345 struct cfi_private *cfi = map->fldrv_priv;
361 struct map_info *map = mtd->priv;
362 struct cfi_private *cfi = map->fldrv_priv;
419 ret = (*frob)(map, &cfi->chips[chipnum], adr, size, thunk);