Lines Matching refs:fi
26 flash_info_t *fi = mtd->priv; in cfi_mtd_erase() local
27 size_t a_start = fi->start[0] + instr->addr; in cfi_mtd_erase()
33 for (sect = 0; sect < fi->sector_count; sect++) { in cfi_mtd_erase()
34 if (a_start == fi->start[sect]) in cfi_mtd_erase()
37 if (sect < fi->sector_count - 1) { in cfi_mtd_erase()
38 if (a_end == fi->start[sect + 1]) { in cfi_mtd_erase()
52 error = flash_erase(fi, s_first, s_last); in cfi_mtd_erase()
71 flash_info_t *fi = mtd->priv; in cfi_mtd_read() local
72 u_char *f = (u_char*)(fi->start[0]) + from; in cfi_mtd_read()
84 flash_info_t *fi = mtd->priv; in cfi_mtd_write() local
85 u_long t = fi->start[0] + to; in cfi_mtd_write()
89 error = write_buff(fi, (u_char*)buf, t, len); in cfi_mtd_write()
111 flash_info_t *fi = mtd->priv; in cfi_mtd_lock() local
114 flash_protect(FLAG_PROTECT_SET, fi->start[0] + ofs, in cfi_mtd_lock()
115 fi->start[0] + ofs + len - 1, fi); in cfi_mtd_lock()
123 flash_info_t *fi = mtd->priv; in cfi_mtd_unlock() local
126 flash_protect(FLAG_PROTECT_CLEAR, fi->start[0] + ofs, in cfi_mtd_unlock()
127 fi->start[0] + ofs + len - 1, fi); in cfi_mtd_unlock()
133 static int cfi_mtd_set_erasesize(struct mtd_info *mtd, flash_info_t *fi) in cfi_mtd_set_erasesize() argument
147 for (sect = 0; sect < fi->sector_count; sect++) { in cfi_mtd_set_erasesize()
148 if (sect_size_old != flash_sector_size(fi, sect)) in cfi_mtd_set_erasesize()
150 sect_size_old = flash_sector_size(fi, sect); in cfi_mtd_set_erasesize()
169 base_addr = offset = fi->start[0]; in cfi_mtd_set_erasesize()
170 sect_size_old = flash_sector_size(fi, 0); in cfi_mtd_set_erasesize()
171 for (sect = 0; sect < fi->sector_count; sect++) { in cfi_mtd_set_erasesize()
172 if (sect_size_old != flash_sector_size(fi, sect)) { in cfi_mtd_set_erasesize()
179 offset = fi->start[sect]; in cfi_mtd_set_erasesize()
186 if (flash_sector_size(fi, sect) > sect_size) in cfi_mtd_set_erasesize()
187 sect_size = flash_sector_size(fi, sect); in cfi_mtd_set_erasesize()
189 sect_size_old = flash_sector_size(fi, sect); in cfi_mtd_set_erasesize()
207 flash_info_t *fi; in cfi_mtd_init() local
215 fi = &flash_info[i]; in cfi_mtd_init()
220 error = cfi_mtd_set_erasesize(mtd, fi); in cfi_mtd_init()
228 mtd->size = fi->size; in cfi_mtd_init()
238 mtd->priv = fi; in cfi_mtd_init()