Lines Matching refs:part
57 struct efx_mtd_partition part[0]; member
60 #define efx_for_each_partition(part, efx_mtd) \ argument
61 for ((part) = &(efx_mtd)->part[0]; \
62 (part) != &(efx_mtd)->part[(efx_mtd)->n_parts]; \
63 (part)++)
74 efx_spi_slow_wait(struct efx_mtd_partition *part, bool uninterruptible) in efx_spi_slow_wait() argument
76 struct efx_mtd *efx_mtd = part->mtd.priv; in efx_spi_slow_wait()
96 pr_err("%s: timed out waiting for %s\n", part->name, efx_mtd->name); in efx_spi_slow_wait()
136 efx_spi_erase(struct efx_mtd_partition *part, loff_t start, size_t len) in efx_spi_erase() argument
138 struct efx_mtd *efx_mtd = part->mtd.priv; in efx_spi_erase()
162 rc = efx_spi_slow_wait(part, false); in efx_spi_erase()
204 struct efx_mtd_partition *part = to_efx_mtd_partition(mtd); in efx_mtd_sync() local
211 part->name, efx_mtd->name, rc); in efx_mtd_sync()
214 static void efx_mtd_remove_partition(struct efx_mtd_partition *part) in efx_mtd_remove_partition() argument
219 rc = mtd_device_unregister(&part->mtd); in efx_mtd_remove_partition()
229 struct efx_mtd_partition *part; in efx_mtd_remove_device() local
231 efx_for_each_partition(part, efx_mtd) in efx_mtd_remove_device()
232 efx_mtd_remove_partition(part); in efx_mtd_remove_device()
239 struct efx_mtd_partition *part; in efx_mtd_rename_device() local
241 efx_for_each_partition(part, efx_mtd) in efx_mtd_rename_device()
243 snprintf(part->name, sizeof(part->name), in efx_mtd_rename_device()
245 part->type_name, part->mcdi.fw_subtype); in efx_mtd_rename_device()
247 snprintf(part->name, sizeof(part->name), in efx_mtd_rename_device()
249 part->type_name); in efx_mtd_rename_device()
254 struct efx_mtd_partition *part; in efx_mtd_probe_device() local
260 efx_for_each_partition(part, efx_mtd) { in efx_mtd_probe_device()
261 part->mtd.writesize = 1; in efx_mtd_probe_device()
263 part->mtd.owner = THIS_MODULE; in efx_mtd_probe_device()
264 part->mtd.priv = efx_mtd; in efx_mtd_probe_device()
265 part->mtd.name = part->name; in efx_mtd_probe_device()
266 part->mtd._erase = efx_mtd_erase; in efx_mtd_probe_device()
267 part->mtd._read = efx_mtd->ops->read; in efx_mtd_probe_device()
268 part->mtd._write = efx_mtd->ops->write; in efx_mtd_probe_device()
269 part->mtd._sync = efx_mtd_sync; in efx_mtd_probe_device()
271 if (mtd_device_register(&part->mtd, NULL, 0)) in efx_mtd_probe_device()
279 while (part != &efx_mtd->part[0]) { in efx_mtd_probe_device()
280 --part; in efx_mtd_probe_device()
281 efx_mtd_remove_partition(part); in efx_mtd_probe_device()
320 struct efx_mtd_partition *part = to_efx_mtd_partition(mtd); in falcon_mtd_read() local
330 rc = falcon_spi_read(efx, spi, part->offset + start, len, in falcon_mtd_read()
338 struct efx_mtd_partition *part = to_efx_mtd_partition(mtd); in falcon_mtd_erase() local
347 rc = efx_spi_erase(part, part->offset + start, len); in falcon_mtd_erase()
355 struct efx_mtd_partition *part = to_efx_mtd_partition(mtd); in falcon_mtd_write() local
365 rc = falcon_spi_write(efx, spi, part->offset + start, len, in falcon_mtd_write()
373 struct efx_mtd_partition *part = to_efx_mtd_partition(mtd); in falcon_mtd_sync() local
380 rc = efx_spi_slow_wait(part, true); in falcon_mtd_sync()
403 efx_mtd = kzalloc(sizeof(*efx_mtd) + sizeof(efx_mtd->part[0]), in falcon_mtd_probe()
413 efx_mtd->part[0].mtd.type = MTD_NORFLASH; in falcon_mtd_probe()
414 efx_mtd->part[0].mtd.flags = MTD_CAP_NORFLASH; in falcon_mtd_probe()
415 efx_mtd->part[0].mtd.size = spi->size - FALCON_FLASH_BOOTCODE_START; in falcon_mtd_probe()
416 efx_mtd->part[0].mtd.erasesize = spi->erase_size; in falcon_mtd_probe()
417 efx_mtd->part[0].offset = FALCON_FLASH_BOOTCODE_START; in falcon_mtd_probe()
418 efx_mtd->part[0].type_name = "sfc_flash_bootrom"; in falcon_mtd_probe()
429 efx_mtd = kzalloc(sizeof(*efx_mtd) + sizeof(efx_mtd->part[0]), in falcon_mtd_probe()
439 efx_mtd->part[0].mtd.type = MTD_RAM; in falcon_mtd_probe()
440 efx_mtd->part[0].mtd.flags = MTD_CAP_RAM; in falcon_mtd_probe()
441 efx_mtd->part[0].mtd.size = in falcon_mtd_probe()
444 efx_mtd->part[0].mtd.erasesize = spi->erase_size; in falcon_mtd_probe()
445 efx_mtd->part[0].offset = EFX_EEPROM_BOOTCONFIG_START; in falcon_mtd_probe()
446 efx_mtd->part[0].type_name = "sfc_bootconfig"; in falcon_mtd_probe()
463 struct efx_mtd_partition *part = to_efx_mtd_partition(mtd); in siena_mtd_read() local
473 rc = efx_mcdi_nvram_read(efx, part->mcdi.nvram_type, offset, in siena_mtd_read()
487 struct efx_mtd_partition *part = to_efx_mtd_partition(mtd); in siena_mtd_erase() local
492 size_t chunk = part->mtd.erasesize; in siena_mtd_erase()
495 if (!part->mcdi.updating) { in siena_mtd_erase()
496 rc = efx_mcdi_nvram_update_start(efx, part->mcdi.nvram_type); in siena_mtd_erase()
499 part->mcdi.updating = true; in siena_mtd_erase()
506 rc = efx_mcdi_nvram_erase(efx, part->mcdi.nvram_type, offset, in siena_mtd_erase()
519 struct efx_mtd_partition *part = to_efx_mtd_partition(mtd); in siena_mtd_write() local
527 if (!part->mcdi.updating) { in siena_mtd_write()
528 rc = efx_mcdi_nvram_update_start(efx, part->mcdi.nvram_type); in siena_mtd_write()
531 part->mcdi.updating = true; in siena_mtd_write()
536 rc = efx_mcdi_nvram_write(efx, part->mcdi.nvram_type, offset, in siena_mtd_write()
550 struct efx_mtd_partition *part = to_efx_mtd_partition(mtd); in siena_mtd_sync() local
555 if (part->mcdi.updating) { in siena_mtd_sync()
556 part->mcdi.updating = false; in siena_mtd_sync()
557 rc = efx_mcdi_nvram_update_finish(efx, part->mcdi.nvram_type); in siena_mtd_sync()
596 struct efx_mtd_partition *part = &efx_mtd->part[part_id]; in siena_mtd_probe_partition() local
617 part->mcdi.nvram_type = type; in siena_mtd_probe_partition()
618 part->type_name = info->name; in siena_mtd_probe_partition()
620 part->mtd.type = MTD_NORFLASH; in siena_mtd_probe_partition()
621 part->mtd.flags = MTD_CAP_NORFLASH; in siena_mtd_probe_partition()
622 part->mtd.size = size; in siena_mtd_probe_partition()
623 part->mtd.erasesize = erase_size; in siena_mtd_probe_partition()
631 struct efx_mtd_partition *part; in siena_mtd_get_fw_subtypes() local
640 efx_for_each_partition(part, efx_mtd) in siena_mtd_get_fw_subtypes()
641 part->mcdi.fw_subtype = fw_subtype_list[part->mcdi.nvram_type]; in siena_mtd_get_fw_subtypes()
660 hweight32(nvram_types) * sizeof(efx_mtd->part[0]), in siena_mtd_probe()