Lines Matching refs:cfi
1911 struct cfi_private *cfi) in jedec_read_mfr() argument
1922 uint32_t ofs = cfi_build_cmd_addr(0 + (bank << 8), map, cfi); in jedec_read_mfr()
1923 mask = (1 << (cfi->device_type * 8)) - 1; in jedec_read_mfr()
1934 struct cfi_private *cfi) in jedec_read_id() argument
1938 u32 ofs = cfi_build_cmd_addr(1, map, cfi); in jedec_read_id()
1939 mask = (1 << (cfi->device_type * 8)) -1; in jedec_read_id()
1944 static void jedec_reset(u32 base, struct map_info *map, struct cfi_private *cfi) in jedec_reset() argument
1954 if (cfi->addr_unlock1) { in jedec_reset()
1956 cfi->addr_unlock1,cfi->addr_unlock2); in jedec_reset()
1957 cfi_send_gen_cmd(0xaa, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL); in jedec_reset()
1958 cfi_send_gen_cmd(0x55, cfi->addr_unlock2, base, map, cfi, cfi->device_type, NULL); in jedec_reset()
1961 cfi_send_gen_cmd(0xF0, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL); in jedec_reset()
1967 cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL); in jedec_reset()
1972 static int cfi_jedec_setup(struct map_info *map, struct cfi_private *cfi, int index) in cfi_jedec_setup() argument
1977 if (!(jedec_table[index].devtypes & cfi->device_type)) { in cfi_jedec_setup()
1979 jedec_table[index].name, 4 * (1<<cfi->device_type)); in cfi_jedec_setup()
1987 cfi->cfiq = kmalloc(sizeof(struct cfi_ident) + num_erase_regions * 4, GFP_KERNEL); in cfi_jedec_setup()
1988 if (!cfi->cfiq) { in cfi_jedec_setup()
1993 memset(cfi->cfiq, 0, sizeof(struct cfi_ident)); in cfi_jedec_setup()
1995 cfi->cfiq->P_ID = jedec_table[index].cmd_set; in cfi_jedec_setup()
1996 cfi->cfiq->NumEraseRegions = jedec_table[index].nr_regions; in cfi_jedec_setup()
1997 cfi->cfiq->DevSize = jedec_table[index].dev_size; in cfi_jedec_setup()
1998 cfi->cfi_mode = CFI_MODE_JEDEC; in cfi_jedec_setup()
1999 cfi->sector_erase_cmd = CMD(0x30); in cfi_jedec_setup()
2002 cfi->cfiq->EraseRegionInfo[i] = jedec_table[index].regions[i]; in cfi_jedec_setup()
2004 cfi->cmdset_priv = NULL; in cfi_jedec_setup()
2007 cfi->mfr = jedec_table[index].mfr_id; in cfi_jedec_setup()
2008 cfi->id = jedec_table[index].dev_id; in cfi_jedec_setup()
2016 cfi->addr_unlock1 = unlock_addrs[uaddr].addr1 / cfi->device_type; in cfi_jedec_setup()
2017 cfi->addr_unlock2 = unlock_addrs[uaddr].addr2 / cfi->device_type; in cfi_jedec_setup()
2032 struct cfi_private *cfi, in jedec_match() argument
2048 switch (cfi->device_type) { in jedec_match()
2074 __func__, cfi->device_type); in jedec_match()
2077 if ( cfi->mfr != mfr || cfi->id != id ) { in jedec_match()
2084 if ( base + cfi_interleave(cfi) * ( 1 << finfo->dev_size ) > map->size ) { in jedec_match()
2091 if (! (finfo->devtypes & cfi->device_type)) in jedec_match()
2097 __func__, cfi->addr_unlock1, cfi->addr_unlock2 ); in jedec_match()
2099 && ( unlock_addrs[uaddr].addr1 / cfi->device_type != cfi->addr_unlock1 || in jedec_match()
2100 unlock_addrs[uaddr].addr2 / cfi->device_type != cfi->addr_unlock2 ) ) { in jedec_match()
2119 jedec_reset( base, map, cfi ); in jedec_match()
2120 mfr = jedec_read_mfr( map, base, cfi ); in jedec_match()
2121 id = jedec_read_id( map, base, cfi ); in jedec_match()
2122 if ( mfr == cfi->mfr && id == cfi->id ) { in jedec_match()
2125 __func__, cfi->mfr, cfi->id ); in jedec_match()
2137 if (cfi->addr_unlock1) { in jedec_match()
2138 cfi_send_gen_cmd(0xaa, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL); in jedec_match()
2139 cfi_send_gen_cmd(0x55, cfi->addr_unlock2, base, map, cfi, cfi->device_type, NULL); in jedec_match()
2141 cfi_send_gen_cmd(0x90, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL); in jedec_match()
2150 unsigned long *chip_map, struct cfi_private *cfi) in jedec_probe_chip() argument
2157 if (!cfi->numchips) { in jedec_probe_chip()
2163 cfi->addr_unlock1 = unlock_addrs[uaddr_idx].addr1 / cfi->device_type; in jedec_probe_chip()
2164 cfi->addr_unlock2 = unlock_addrs[uaddr_idx].addr2 / cfi->device_type; in jedec_probe_chip()
2176 probe_offset1 = cfi_build_cmd_addr(cfi->addr_unlock1, map, cfi); in jedec_probe_chip()
2177 probe_offset2 = cfi_build_cmd_addr(cfi->addr_unlock2, map, cfi); in jedec_probe_chip()
2183 jedec_reset(base, map, cfi); in jedec_probe_chip()
2186 if(cfi->addr_unlock1) { in jedec_probe_chip()
2187 cfi_send_gen_cmd(0xaa, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL); in jedec_probe_chip()
2188 cfi_send_gen_cmd(0x55, cfi->addr_unlock2, base, map, cfi, cfi->device_type, NULL); in jedec_probe_chip()
2190 cfi_send_gen_cmd(0x90, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL); in jedec_probe_chip()
2193 if (!cfi->numchips) { in jedec_probe_chip()
2197 cfi->mfr = jedec_read_mfr(map, base, cfi); in jedec_probe_chip()
2198 cfi->id = jedec_read_id(map, base, cfi); in jedec_probe_chip()
2200 cfi->mfr, cfi->id, cfi_interleave(cfi), cfi->device_type); in jedec_probe_chip()
2202 if ( jedec_match( base, map, cfi, &jedec_table[i] ) ) { in jedec_probe_chip()
2204 __func__, cfi->mfr, cfi->id, in jedec_probe_chip()
2205 cfi->addr_unlock1, cfi->addr_unlock2 ); in jedec_probe_chip()
2206 if (!cfi_jedec_setup(map, cfi, i)) in jedec_probe_chip()
2217 mfr = jedec_read_mfr(map, base, cfi); in jedec_probe_chip()
2218 id = jedec_read_id(map, base, cfi); in jedec_probe_chip()
2220 if ((mfr != cfi->mfr) || (id != cfi->id)) { in jedec_probe_chip()
2223 jedec_reset(base, map, cfi); in jedec_probe_chip()
2229 for (i=0; i < (base >> cfi->chipshift); i++) { in jedec_probe_chip()
2234 start = i << cfi->chipshift; in jedec_probe_chip()
2235 if (jedec_read_mfr(map, start, cfi) == cfi->mfr && in jedec_probe_chip()
2236 jedec_read_id(map, start, cfi) == cfi->id) { in jedec_probe_chip()
2239 jedec_reset(start, map, cfi); in jedec_probe_chip()
2242 if (jedec_read_mfr(map, base, cfi) != cfi->mfr || in jedec_probe_chip()
2243 jedec_read_id(map, base, cfi) != cfi->id) { in jedec_probe_chip()
2253 jedec_reset(base, map, cfi); in jedec_probe_chip()
2254 if (jedec_read_mfr(map, base, cfi) == cfi->mfr && in jedec_probe_chip()
2255 jedec_read_id(map, base, cfi) == cfi->id) { in jedec_probe_chip()
2265 set_bit((base >> cfi->chipshift), chip_map); /* Update chip map */ in jedec_probe_chip()
2266 cfi->numchips++; in jedec_probe_chip()
2270 jedec_reset(base, map, cfi); in jedec_probe_chip()
2273 map->name, cfi_interleave(cfi), cfi->device_type*8, base, in jedec_probe_chip()