Lines Matching defs:map

22 #include <linux/mtd/map.h>
1911 static inline u32 jedec_read_mfr(struct map_info *map, uint32_t base,
1923 uint32_t ofs = cfi_build_cmd_addr(0 + (bank << 8), map, cfi);
1925 if (ofs >= map->size)
1927 result = map_read(map, base + ofs);
1934 static inline u32 jedec_read_id(struct map_info *map, uint32_t base,
1939 u32 ofs = cfi_build_cmd_addr(1, map, cfi);
1941 result = map_read(map, base + ofs);
1945 static void jedec_reset(u32 base, struct map_info *map, struct cfi_private *cfi)
1958 cfi_send_gen_cmd(0xaa, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL);
1959 cfi_send_gen_cmd(0x55, cfi->addr_unlock2, base, map, cfi, cfi->device_type, NULL);
1962 cfi_send_gen_cmd(0xF0, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL);
1968 cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL);
1973 static int cfi_jedec_setup(struct map_info *map, struct cfi_private *cfi, int index)
1990 //xx printk(KERN_WARNING "%s: kmalloc failed for CFI ident structure\n", map->name);
2032 struct map_info *map,
2085 if ( base + cfi_interleave(cfi) * ( 1 << finfo->dev_size ) > map->size ) {
2120 jedec_reset( base, map, cfi );
2121 mfr = jedec_read_mfr( map, base, cfi );
2122 id = jedec_read_id( map, base, cfi );
2139 cfi_send_gen_cmd(0xaa, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL);
2140 cfi_send_gen_cmd(0x55, cfi->addr_unlock2, base, map, cfi, cfi->device_type, NULL);
2142 cfi_send_gen_cmd(0x90, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL);
2150 static int jedec_probe_chip(struct map_info *map, __u32 base,
2168 /* Make certain we aren't probing past the end of map */
2169 if (base >= map->size) {
2171 "Probe at base(0x%08x) past the end of the map(0x%08lx)\n",
2172 base, map->size -1);
2176 /* Ensure the unlock addresses we try stay inside the map */
2177 probe_offset1 = cfi_build_cmd_addr(cfi->addr_unlock1, map, cfi);
2178 probe_offset2 = cfi_build_cmd_addr(cfi->addr_unlock2, map, cfi);
2179 if ( ((base + probe_offset1 + map_bankwidth(map)) >= map->size) ||
2180 ((base + probe_offset2 + map_bankwidth(map)) >= map->size))
2184 jedec_reset(base, map, cfi);
2188 cfi_send_gen_cmd(0xaa, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL);
2189 cfi_send_gen_cmd(0x55, cfi->addr_unlock2, base, map, cfi, cfi->device_type, NULL);
2191 cfi_send_gen_cmd(0x90, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL);
2198 cfi->mfr = jedec_read_mfr(map, base, cfi);
2199 cfi->id = jedec_read_id(map, base, cfi);
2203 if ( jedec_match( base, map, cfi, &jedec_table[i] ) ) {
2207 if (!cfi_jedec_setup(map, cfi, i))
2218 mfr = jedec_read_mfr(map, base, cfi);
2219 id = jedec_read_id(map, base, cfi);
2223 map->name, mfr, id, base);
2224 jedec_reset(base, map, cfi);
2236 if (jedec_read_mfr(map, start, cfi) == cfi->mfr &&
2237 jedec_read_id(map, start, cfi) == cfi->id) {
2240 jedec_reset(start, map, cfi);
2243 if (jedec_read_mfr(map, base, cfi) != cfi->mfr ||
2244 jedec_read_id(map, base, cfi) != cfi->id) {
2246 map->name, base, start);
2254 jedec_reset(base, map, cfi);
2255 if (jedec_read_mfr(map, base, cfi) == cfi->mfr &&
2256 jedec_read_id(map, base, cfi) == cfi->id) {
2258 map->name, base, start);
2266 set_bit((base >> cfi->chipshift), chip_map); /* Update chip map */
2271 jedec_reset(base, map, cfi);
2274 map->name, cfi_interleave(cfi), cfi->device_type*8, base,
2275 map->bankwidth*8);
2285 static struct mtd_info *jedec_probe(struct map_info *map)
2291 return mtd_do_chip_probe(map, &jedec_chip_probe);