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()
191 kfree(cfi->cmdset_priv); in cfi_staa_setup()
196 for (i=0; i<cfi->cfiq->NumEraseRegions; i++) { in cfi_staa_setup()
198 ersize = ((cfi->cfiq->EraseRegionInfo[i] >> 8) & ~0xff) * cfi->interleave; in cfi_staa_setup()
199 ernum = (cfi->cfiq->EraseRegionInfo[i] & 0xffff) + 1; in cfi_staa_setup()
204 for (j=0; j<cfi->numchips; j++) { in cfi_staa_setup()
205 mtd->eraseregions[(j*cfi->cfiq->NumEraseRegions)+i].offset = (j*devsize)+offset; in cfi_staa_setup()
206 mtd->eraseregions[(j*cfi->cfiq->NumEraseRegions)+i].erasesize = ersize; in cfi_staa_setup()
207 mtd->eraseregions[(j*cfi->cfiq->NumEraseRegions)+i].numblocks = ernum; in cfi_staa_setup()
216 kfree(cfi->cmdset_priv); in cfi_staa_setup()
240 mtd->writebufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize; in cfi_staa_setup()
255 struct cfi_private *cfi = map->fldrv_priv; in do_read_onechip() local
274 if (!(((struct cfi_pri_intelext *)cfi->cmdset_priv)->FeatureSupport & 2)) in do_read_onechip()
386 struct cfi_private *cfi = map->fldrv_priv; in cfi_staa_read() local
392 chipnum = (from >> cfi->chipshift); in cfi_staa_read()
393 ofs = from - (chipnum << cfi->chipshift); in cfi_staa_read()
398 if (chipnum >= cfi->numchips) in cfi_staa_read()
401 if ((len + ofs -1) >> cfi->chipshift) in cfi_staa_read()
402 thislen = (1<<cfi->chipshift) - ofs; in cfi_staa_read()
406 ret = do_read_onechip(map, &cfi->chips[chipnum], ofs, thislen, buf); in cfi_staa_read()
423 struct cfi_private *cfi = map->fldrv_priv; in do_write_buffer() local
433 wbufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize; in do_write_buffer()
610 struct cfi_private *cfi = map->fldrv_priv; in cfi_staa_write_buffers() local
611 int wbufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize; in cfi_staa_write_buffers()
616 chipnum = to >> cfi->chipshift; in cfi_staa_write_buffers()
617 ofs = to - (chipnum << cfi->chipshift); in cfi_staa_write_buffers()
633 ret = do_write_buffer(map, &cfi->chips[chipnum], in cfi_staa_write_buffers()
643 if (ofs >> cfi->chipshift) { in cfi_staa_write_buffers()
646 if (chipnum == cfi->numchips) in cfi_staa_write_buffers()
734 struct cfi_private *cfi = map->fldrv_priv; in do_erase_oneblock() local
851 for (i = 0; i<cfi_interleave(cfi); i++) { in do_erase_oneblock()
852 chipstatus |= status.x[w] >> (cfi->device_type * 8); in do_erase_oneblock()
893 struct cfi_private *cfi = map->fldrv_priv; in cfi_staa_erase_varsize() local
942 chipnum = instr->addr >> cfi->chipshift; in cfi_staa_erase_varsize()
943 adr = instr->addr - (chipnum << cfi->chipshift); in cfi_staa_erase_varsize()
949 ret = do_erase_oneblock(map, &cfi->chips[chipnum], adr); in cfi_staa_erase_varsize()
957 …if (adr % (1<< cfi->chipshift) == (((unsigned long)regions[i].offset + (regions[i].erasesize * reg… in cfi_staa_erase_varsize()
960 if (adr >> cfi->chipshift) { in cfi_staa_erase_varsize()
964 if (chipnum >= cfi->numchips) in cfi_staa_erase_varsize()
975 struct cfi_private *cfi = map->fldrv_priv; in cfi_staa_sync() local
981 for (i=0; !ret && i<cfi->numchips; i++) { in cfi_staa_sync()
982 chip = &cfi->chips[i]; in cfi_staa_sync()
1019 chip = &cfi->chips[i]; in cfi_staa_sync()
1033 struct cfi_private *cfi = map->fldrv_priv; in do_lock_oneblock() local
1129 struct cfi_private *cfi = map->fldrv_priv; in cfi_staa_lock() local
1133 int ofs_factor = cfi->interleave * cfi->device_type; in cfi_staa_lock()
1142 chipnum = ofs >> cfi->chipshift; in cfi_staa_lock()
1143 adr = ofs - (chipnum << cfi->chipshift); in cfi_staa_lock()
1148 cfi_send_gen_cmd(0x90, 0x55, 0, map, cfi, cfi->device_type, NULL); in cfi_staa_lock()
1150 cfi_send_gen_cmd(0xff, 0x55, 0, map, cfi, cfi->device_type, NULL); in cfi_staa_lock()
1153 ret = do_lock_oneblock(map, &cfi->chips[chipnum], adr); in cfi_staa_lock()
1156 cfi_send_gen_cmd(0x90, 0x55, 0, map, cfi, cfi->device_type, NULL); in cfi_staa_lock()
1158 cfi_send_gen_cmd(0xff, 0x55, 0, map, cfi, cfi->device_type, NULL); in cfi_staa_lock()
1167 if (adr >> cfi->chipshift) { in cfi_staa_lock()
1171 if (chipnum >= cfi->numchips) in cfi_staa_lock()
1179 struct cfi_private *cfi = map->fldrv_priv; in do_unlock_oneblock() local
1275 struct cfi_private *cfi = map->fldrv_priv; in cfi_staa_unlock() local
1279 int ofs_factor = cfi->interleave * cfi->device_type; in cfi_staa_unlock()
1282 chipnum = ofs >> cfi->chipshift; in cfi_staa_unlock()
1283 adr = ofs - (chipnum << cfi->chipshift); in cfi_staa_unlock()
1290 cfi_send_gen_cmd(0x90, 0x55, 0, map, cfi, cfi->device_type, NULL); in cfi_staa_unlock()
1296 cfi_send_gen_cmd(0xff, 0x55, 0, map, cfi, cfi->device_type, NULL); in cfi_staa_unlock()
1300 ret = do_unlock_oneblock(map, &cfi->chips[chipnum], adr); in cfi_staa_unlock()
1303 cfi_send_gen_cmd(0x90, 0x55, 0, map, cfi, cfi->device_type, NULL); in cfi_staa_unlock()
1305 cfi_send_gen_cmd(0xff, 0x55, 0, map, cfi, cfi->device_type, NULL); in cfi_staa_unlock()
1314 struct cfi_private *cfi = map->fldrv_priv; in cfi_staa_suspend() local
1319 for (i=0; !ret && i<cfi->numchips; i++) { in cfi_staa_suspend()
1320 chip = &cfi->chips[i]; in cfi_staa_suspend()
1349 chip = &cfi->chips[i]; in cfi_staa_suspend()
1370 struct cfi_private *cfi = map->fldrv_priv; in cfi_staa_resume() local
1374 for (i=0; i<cfi->numchips; i++) { in cfi_staa_resume()
1376 chip = &cfi->chips[i]; in cfi_staa_resume()
1394 struct cfi_private *cfi = map->fldrv_priv; in cfi_staa_destroy() local
1395 kfree(cfi->cmdset_priv); in cfi_staa_destroy()
1396 kfree(cfi); in cfi_staa_destroy()