Lines Matching refs:map

18 #include <linux/mtd/map.h>
28 static int cfi_probe_chip(struct map_info *map, __u32 base,
30 static int cfi_chip_setup(struct map_info *map, struct cfi_private *cfi);
32 struct mtd_info *cfi_probe(struct map_info *map);
39 #define xip_allowed(base, map) \
41 (void) map_read(map, base); \
46 #define xip_enable(base, map, cfi) \
48 cfi_qry_mode_off(base, map, cfi); \
49 xip_allowed(base, map); \
52 #define xip_disable_qry(base, map, cfi) \
55 cfi_qry_mode_on(base, map, cfi); \
61 #define xip_allowed(base, map) do { } while (0)
62 #define xip_enable(base, map, cfi) do { } while (0)
63 #define xip_disable_qry(base, map, cfi) do { } while (0)
96 static int __xipram cfi_probe_chip(struct map_info *map, __u32 base,
101 if ((base + 0) >= map->size) {
103 "Probe at base[0x00](0x%08lx) past the end of the map(0x%08lx)\n",
104 (unsigned long)base, map->size -1);
107 if ((base + 0xff) >= map->size) {
109 "Probe at base[0x55](0x%08lx) past the end of the map(0x%08lx)\n",
110 (unsigned long)base + 0x55, map->size -1);
115 if (!cfi_qry_mode_on(base, map, cfi)) {
116 xip_enable(base, map, cfi);
123 return cfi_chip_setup(map, cfi);
136 if (cfi_qry_present(map, start, cfi)) {
139 cfi_qry_mode_off(start, map, cfi);
142 if (!cfi_qry_present(map, start, cfi)) {
143 xip_allowed(base, map);
145 map->name, base, start);
152 cfi_qry_mode_off(base, map, cfi);
154 if (cfi_qry_present(map, base, cfi)) {
155 xip_allowed(base, map);
157 map->name, base, start);
165 set_bit((base >> cfi->chipshift), chip_map); /* Update chip map */
169 cfi_qry_mode_off(base, map, cfi);
170 xip_allowed(base, map);
173 map->name, cfi->interleave, cfi->device_type*8, base,
174 map->bankwidth*8);
195 static int __xipram cfi_chip_setup(struct map_info *map,
200 int num_erase_regions = cfi_read_query(map, base + (0x10 + 28)*ofs_factor);
204 xip_enable(base, map, cfi);
222 xip_disable_qry(base, map, cfi);
224 ((unsigned char *)cfi->cfiq)[i] = cfi_read_query(map,base + (0x10 + i)*ofs_factor);
263 cfi_send_gen_cmd(0xf0, 0, base, map, cfi, cfi->device_type, NULL);
264 cfi_send_gen_cmd(0xaa, addr_unlock1, base, map, cfi, cfi->device_type, NULL);
265 cfi_send_gen_cmd(0x55, addr_unlock2, base, map, cfi, cfi->device_type, NULL);
266 cfi_send_gen_cmd(0x90, addr_unlock1, base, map, cfi, cfi->device_type, NULL);
267 cfi->mfr = cfi_read_query16(map, base);
268 cfi->id = cfi_read_query16(map, base + ofs_factor);
272 cfi->id = cfi_read_query(map, base + 0xe * ofs_factor) << 8 |
273 cfi_read_query(map, base + 0xf * ofs_factor);
276 cfi_qry_mode_off(base, map, cfi);
277 xip_allowed(base, map);
282 map->name, cfi->interleave, cfi->device_type*8, base,
283 map->bankwidth*8, cfi->mfr, cfi->id);
432 struct mtd_info *cfi_probe(struct map_info *map)
438 return mtd_do_chip_probe(map, &cfi_chip_probe);