Lines Matching refs:cfi
115 struct cfi_private *cfi = map->fldrv_priv; in cfi_cmdset_0020() local
118 if (cfi->cfi_mode) { in cfi_cmdset_0020()
124 __u16 adr = primary?cfi->cfiq->P_ADR:cfi->cfiq->A_ADR; in cfi_cmdset_0020()
151 cfi->cmdset_priv = extp; in cfi_cmdset_0020()
154 for (i=0; i< cfi->numchips; i++) { in cfi_cmdset_0020()
155 cfi->chips[i].word_write_time = 128; in cfi_cmdset_0020()
156 cfi->chips[i].buffer_write_time = 128; in cfi_cmdset_0020()
157 cfi->chips[i].erase_time = 1024; in cfi_cmdset_0020()
158 cfi->chips[i].ref_point_counter = 0; in cfi_cmdset_0020()
159 init_waitqueue_head(&(cfi->chips[i].wq)); in cfi_cmdset_0020()
168 struct cfi_private *cfi = map->fldrv_priv; in cfi_staa_setup() local
172 unsigned long devsize = (1<<cfi->cfiq->DevSize) * cfi->interleave; in cfi_staa_setup()
178 kfree(cfi->cmdset_priv); in cfi_staa_setup()
184 mtd->size = devsize * cfi->numchips; in cfi_staa_setup()
186 mtd->numeraseregions = cfi->cfiq->NumEraseRegions * cfi->numchips; in cfi_staa_setup()
190 kfree(cfi->cmdset_priv); in cfi_staa_setup()
195 for (i=0; i<cfi->cfiq->NumEraseRegions; i++) { in cfi_staa_setup()
197 ersize = ((cfi->cfiq->EraseRegionInfo[i] >> 8) & ~0xff) * cfi->interleave; in cfi_staa_setup()
198 ernum = (cfi->cfiq->EraseRegionInfo[i] & 0xffff) + 1; in cfi_staa_setup()
203 for (j=0; j<cfi->numchips; j++) { in cfi_staa_setup()
204 mtd->eraseregions[(j*cfi->cfiq->NumEraseRegions)+i].offset = (j*devsize)+offset; in cfi_staa_setup()
205 mtd->eraseregions[(j*cfi->cfiq->NumEraseRegions)+i].erasesize = ersize; in cfi_staa_setup()
206 mtd->eraseregions[(j*cfi->cfiq->NumEraseRegions)+i].numblocks = ernum; in cfi_staa_setup()
215 kfree(cfi->cmdset_priv); in cfi_staa_setup()
239 mtd->writebufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize; in cfi_staa_setup()
254 struct cfi_private *cfi = map->fldrv_priv; in do_read_onechip() local
273 if (!(((struct cfi_pri_intelext *)cfi->cmdset_priv)->FeatureSupport & 2)) in do_read_onechip()
385 struct cfi_private *cfi = map->fldrv_priv; in cfi_staa_read() local
391 chipnum = (from >> cfi->chipshift); in cfi_staa_read()
392 ofs = from - (chipnum << cfi->chipshift); in cfi_staa_read()
397 if (chipnum >= cfi->numchips) in cfi_staa_read()
400 if ((len + ofs -1) >> cfi->chipshift) in cfi_staa_read()
401 thislen = (1<<cfi->chipshift) - ofs; in cfi_staa_read()
405 ret = do_read_onechip(map, &cfi->chips[chipnum], ofs, thislen, buf); in cfi_staa_read()
422 struct cfi_private *cfi = map->fldrv_priv; in do_write_buffer() local
432 wbufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize; in do_write_buffer()
609 struct cfi_private *cfi = map->fldrv_priv; in cfi_staa_write_buffers() local
610 int wbufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize; in cfi_staa_write_buffers()
615 chipnum = to >> cfi->chipshift; in cfi_staa_write_buffers()
616 ofs = to - (chipnum << cfi->chipshift); in cfi_staa_write_buffers()
632 ret = do_write_buffer(map, &cfi->chips[chipnum], in cfi_staa_write_buffers()
642 if (ofs >> cfi->chipshift) { in cfi_staa_write_buffers()
645 if (chipnum == cfi->numchips) in cfi_staa_write_buffers()
733 struct cfi_private *cfi = map->fldrv_priv; in do_erase_oneblock() local
850 for (i = 0; i<cfi_interleave(cfi); i++) { in do_erase_oneblock()
851 chipstatus |= status.x[w] >> (cfi->device_type * 8); in do_erase_oneblock()
892 struct cfi_private *cfi = map->fldrv_priv; in cfi_staa_erase_varsize() local
941 chipnum = instr->addr >> cfi->chipshift; in cfi_staa_erase_varsize()
942 adr = instr->addr - (chipnum << cfi->chipshift); in cfi_staa_erase_varsize()
948 ret = do_erase_oneblock(map, &cfi->chips[chipnum], adr); in cfi_staa_erase_varsize()
956 …if (adr % (1<< cfi->chipshift) == (((unsigned long)regions[i].offset + (regions[i].erasesize * reg… in cfi_staa_erase_varsize()
959 if (adr >> cfi->chipshift) { in cfi_staa_erase_varsize()
963 if (chipnum >= cfi->numchips) in cfi_staa_erase_varsize()
977 struct cfi_private *cfi = map->fldrv_priv; in cfi_staa_sync() local
983 for (i=0; !ret && i<cfi->numchips; i++) { in cfi_staa_sync()
984 chip = &cfi->chips[i]; in cfi_staa_sync()
1020 chip = &cfi->chips[i]; in cfi_staa_sync()
1034 struct cfi_private *cfi = map->fldrv_priv; in do_lock_oneblock() local
1130 struct cfi_private *cfi = map->fldrv_priv; in cfi_staa_lock() local
1134 int ofs_factor = cfi->interleave * cfi->device_type; in cfi_staa_lock()
1143 chipnum = ofs >> cfi->chipshift; in cfi_staa_lock()
1144 adr = ofs - (chipnum << cfi->chipshift); in cfi_staa_lock()
1149 cfi_send_gen_cmd(0x90, 0x55, 0, map, cfi, cfi->device_type, NULL); in cfi_staa_lock()
1151 cfi_send_gen_cmd(0xff, 0x55, 0, map, cfi, cfi->device_type, NULL); in cfi_staa_lock()
1154 ret = do_lock_oneblock(map, &cfi->chips[chipnum], adr); in cfi_staa_lock()
1157 cfi_send_gen_cmd(0x90, 0x55, 0, map, cfi, cfi->device_type, NULL); in cfi_staa_lock()
1159 cfi_send_gen_cmd(0xff, 0x55, 0, map, cfi, cfi->device_type, NULL); in cfi_staa_lock()
1168 if (adr >> cfi->chipshift) { in cfi_staa_lock()
1172 if (chipnum >= cfi->numchips) in cfi_staa_lock()
1180 struct cfi_private *cfi = map->fldrv_priv; in do_unlock_oneblock() local
1276 struct cfi_private *cfi = map->fldrv_priv; in cfi_staa_unlock() local
1280 int ofs_factor = cfi->interleave * cfi->device_type; in cfi_staa_unlock()
1283 chipnum = ofs >> cfi->chipshift; in cfi_staa_unlock()
1284 adr = ofs - (chipnum << cfi->chipshift); in cfi_staa_unlock()
1291 cfi_send_gen_cmd(0x90, 0x55, 0, map, cfi, cfi->device_type, NULL); in cfi_staa_unlock()
1297 cfi_send_gen_cmd(0xff, 0x55, 0, map, cfi, cfi->device_type, NULL); in cfi_staa_unlock()
1301 ret = do_unlock_oneblock(map, &cfi->chips[chipnum], adr); in cfi_staa_unlock()
1304 cfi_send_gen_cmd(0x90, 0x55, 0, map, cfi, cfi->device_type, NULL); in cfi_staa_unlock()
1306 cfi_send_gen_cmd(0xff, 0x55, 0, map, cfi, cfi->device_type, NULL); in cfi_staa_unlock()
1315 struct cfi_private *cfi = map->fldrv_priv; in cfi_staa_suspend() local
1320 for (i=0; !ret && i<cfi->numchips; i++) { in cfi_staa_suspend()
1321 chip = &cfi->chips[i]; in cfi_staa_suspend()
1350 chip = &cfi->chips[i]; in cfi_staa_suspend()
1371 struct cfi_private *cfi = map->fldrv_priv; in cfi_staa_resume() local
1375 for (i=0; i<cfi->numchips; i++) { in cfi_staa_resume()
1377 chip = &cfi->chips[i]; in cfi_staa_resume()
1395 struct cfi_private *cfi = map->fldrv_priv; in cfi_staa_destroy() local
1396 kfree(cfi->cmdset_priv); in cfi_staa_destroy()
1397 kfree(cfi); in cfi_staa_destroy()