Lines Matching full:erase
75 * op code and erase sector size to be used by Sector Erase commands.
297 /* Erase Type 1 in DWORD8 bits[15:0] */
300 /* Erase Type 2 in DWORD8 bits[31:16] */
303 /* Erase Type 3 in DWORD9 bits[15:0] */
306 /* Erase Type 4 in DWORD9 bits[31:16] */
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
317 * The supported Erase Types will be sorted at init in ascending order, with
318 * the smallest Erase Type size being the first member in the erase_type array
319 * of the spi_nor_erase_map structure. Save the Erase Type index as sorted in
321 * synchronize with the supported Erase Types defined in SFDP optional tables.
324 spi_nor_set_erase_settings_from_bfpt(struct spi_nor_erase_type *erase, in spi_nor_set_erase_settings_from_bfpt() argument
327 erase->idx = i; in spi_nor_set_erase_settings_from_bfpt()
328 spi_nor_set_erase_type(erase, size, opcode); in spi_nor_set_erase_settings_from_bfpt()
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. */ in spi_nor_sort_erase_mask()
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. */ in spi_nor_regions_sort_erase_types()
417 * the number of address bytes for Fast Read, Page Program and Sector Erase
424 * For Sector Erase commands, this table stores the supported instruction op
520 * Sector Erase settings. Reinitialize the uniform erase map using the in spi_nor_parse_bfpt()
521 * Erase Types defined in the bfpt table. in spi_nor_parse_bfpt()
533 /* erasesize == 0 means this Erase Type is not supported. */ in spi_nor_parse_bfpt()
545 * Sort all the map's Erase Types in ascending order with the smallest in spi_nor_parse_bfpt()
546 * erase size being the first member in the erase_type array. in spi_nor_parse_bfpt()
551 * Sort the erase types in the uniform region in order to update the in spi_nor_parse_bfpt()
553 * selecting the uniform erase. in spi_nor_parse_bfpt()
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, in spi_nor_region_check_overlay() argument
806 if (!(erase[i].size && erase_type & BIT(erase[i].idx))) in spi_nor_region_check_overlay()
808 if (region->size & erase[i].size_mask) { in spi_nor_region_check_overlay()
816 * spi_nor_init_non_uniform_erase_map() - initialize the non-uniform erase map
826 struct spi_nor_erase_type *erase = map->erase_type; in spi_nor_init_non_uniform_erase_map() local
855 spi_nor_region_check_overlay(®ion[i], erase, erase_type); in spi_nor_init_non_uniform_erase_map()
858 * Save the erase types that are supported in all regions and in spi_nor_init_non_uniform_erase_map()
859 * can erase the entire flash memory. in spi_nor_init_non_uniform_erase_map()
864 * regions_erase_type mask will indicate all the erase types in spi_nor_init_non_uniform_erase_map()
888 * BFPT advertises all the erase types supported by all the possible in spi_nor_init_non_uniform_erase_map()
889 * map configurations. Mask out the erase types that are not supported in spi_nor_init_non_uniform_erase_map()
893 if (!(regions_erase_type & BIT(erase[i].idx))) in spi_nor_init_non_uniform_erase_map()
894 spi_nor_mask_erase_type(&erase[i]); in spi_nor_init_non_uniform_erase_map()
906 * device and to identify which Erase Types are supported by each sector.
1047 * Compute the subset of Sector Erase commands for which the 4-byte in spi_nor_parse_4bait()
1052 const struct sfdp_4bait *erase = &erases[i]; in spi_nor_parse_4bait() local
1054 if (dwords[SFDP_DWORD(1)] & erase->supported_bit) in spi_nor_parse_4bait()
1058 /* Replicate the sort done for the map's erase types in BFPT. */ in spi_nor_parse_4bait()
1062 * We need at least one 4-byte op code per read, program and erase in spi_nor_parse_4bait()
1063 * operation; the .read(), .write() and .erase() hooks share the in spi_nor_parse_4bait()
1114 * this latest function implements a legacy quirk for the erase size of in spi_nor_parse_4bait()
1390 * as Fast Read, Page Program or Sector Erase commands.