Lines Matching refs:erase
75 * op code and erase sector size to be used by Sector Erase commands.
311 * spi_nor_set_erase_settings_from_bfpt() - set erase type settings from BFPT
312 * @erase: pointer to a structure that describes a SPI NOR erase type
313 * @size: the size of the sector/block erased by the erase type
314 * @opcode: the SPI command op code to erase the sector/block
315 * @i: erase type index as sorted in the Basic Flash Parameter Table
324 spi_nor_set_erase_settings_from_bfpt(struct spi_nor_erase_type *erase,
327 erase->idx = i;
328 spi_nor_set_erase_type(erase, size, opcode);
332 * spi_nor_map_cmp_erase_type() - compare the map's erase types by size
337 * map's erase types, the smallest erase type size being the first member in the
350 * spi_nor_sort_erase_mask() - sort erase mask
351 * @map: the erase map of the SPI NOR
352 * @erase_mask: the erase type mask to be sorted
354 * Replicate the sort done for the map's erase types in BFPT: sort the erase
355 * mask in ascending order with the smallest erase type size starting from
356 * BIT(0) in the sorted erase mask.
358 * Return: sorted erase mask.
369 /* Replicate the sort done for the map's erase types. */
378 * spi_nor_regions_sort_erase_types() - sort erase types in each region
379 * @map: the erase map of the SPI NOR
381 * Function assumes that the erase types defined in the erase map are already
382 * sorted in ascending order, with the smallest erase type size being the first
384 * erase types. Each region's erase bitmask will indicate which erase types are
385 * supported from the sorted erase types defined in the erase map.
386 * Sort the all region's erase type at init in order to speed up the process of
387 * finding the best erase command at runtime.
400 /* Overwrite erase mask. */
520 * Sector Erase settings. Reinitialize the uniform erase map using the
546 * erase size being the first member in the erase_type array.
551 * Sort the erase types in the uniform region in order to update the
553 * selecting the uniform erase.
794 * @region: pointer to a structure that describes a SPI NOR erase region
795 * @erase: pointer to a structure that describes a SPI NOR erase type
796 * @erase_type: erase type bitmask
800 const struct spi_nor_erase_type *erase,
806 if (!(erase[i].size && erase_type & BIT(erase[i].idx)))
808 if (region->size & erase[i].size_mask) {
816 * spi_nor_init_non_uniform_erase_map() - initialize the non-uniform erase map
826 struct spi_nor_erase_type *erase = map->erase_type;
855 spi_nor_region_check_overlay(®ion[i], erase, erase_type);
858 * Save the erase types that are supported in all regions and
859 * can erase the entire flash memory.
864 * regions_erase_type mask will indicate all the erase types
888 * BFPT advertises all the erase types supported by all the possible
889 * map configurations. Mask out the erase types that are not supported
893 if (!(regions_erase_type & BIT(erase[i].idx)))
894 spi_nor_mask_erase_type(&erase[i]);
1052 const struct sfdp_4bait *erase = &erases[i];
1054 if (dwords[SFDP_DWORD(1)] & erase->supported_bit)
1058 /* Replicate the sort done for the map's erase types in BFPT. */
1062 * We need at least one 4-byte op code per read, program and erase
1063 * operation; the .read(), .write() and .erase() hooks share the
1114 * this latest function implements a legacy quirk for the erase size of