Lines Matching refs:cfi
1 /* $NetBSD: cfi.h,v 1.8 2022/01/05 16:01:54 andvar Exp $ */
31 * CFI Query structure
94 * id_pri: CFI Command set and control assignments
123 struct cfi; /* fwd ref */
126 void (*cfi_reset)(struct cfi *);
127 int (*cfi_busy)(struct cfi *, flash_off_t);
128 int (*cfi_program_word)(struct cfi *, flash_off_t);
129 int (*cfi_erase_sector)(struct cfi *, flash_off_t);
155 extern void cfi_0002_stats_reset(struct cfi *);
156 extern void cfi_0002_stats_print(struct cfi *);
157 #define CFI_0002_STATS_INIT(dev, cfi) \
159 aprint_normal_dev(dev, "cfi=%p\n", cfi); \
160 cfi_0002_stats_reset(cfi); \
162 #define CFI_0002_STATS_INC(cfi, field) (cfi)->cfi_0002_stats.field++
166 #define CFI_0002_STATS_INIT(dev, cfi)
167 #define CFI_0002_STATS_INC(cfi, field)
171 struct cfi {
180 struct cfi_query_data cfi_qry_data; /* CFI Query data */
194 * - values needed to fill in struct cfi (i.e. fields we depend on)
237 cfi_reset(struct cfi * const cfi)
239 KASSERT(cfi->cfi_ops.cfi_reset != NULL);
240 cfi->cfi_ops.cfi_reset(cfi);
244 cfi_erase_sector(struct cfi * const cfi, flash_off_t offset)
246 KASSERT(cfi->cfi_ops.cfi_erase_sector != NULL);
247 return cfi->cfi_ops.cfi_erase_sector(cfi, offset);
251 cfi_program_word(struct cfi * const cfi, flash_off_t offset)
253 KASSERT(cfi->cfi_ops.cfi_program_word != NULL);
254 return cfi->cfi_ops.cfi_program_word(cfi, offset);
259 extern bool cfi_probe(struct cfi * const);
260 extern bool cfi_identify(struct cfi * const);
261 extern void cfi_print(device_t, struct cfi * const);
262 extern void cfi_reset_default(struct cfi * const);
263 extern void cfi_reset_std(struct cfi * const);
264 extern void cfi_reset_alt(struct cfi * const);
265 extern void cfi_cmd(struct cfi * const, bus_size_t, uint32_t);