]> git.dujemihanovic.xyz Git - u-boot.git/commit
mtd: spi-nor-core: allow truncated erases
authorPratyush Yadav <p.yadav@ti.com>
Fri, 25 Jun 2021 19:17:26 +0000 (00:47 +0530)
committerJagan Teki <jagan@amarulasolutions.com>
Mon, 28 Jun 2021 06:35:38 +0000 (12:05 +0530)
commitaba0bcd7bda494d7fe9c82e581db9791ce41e2f3
treed9ab3d4ddd58485112c888851371ed2508690c74
parent0be8ab1f166844d53477387dc9a1184161ef44ef
mtd: spi-nor-core: allow truncated erases

On devices with non-uniform sector sizes like Spansion S25 or S28 family
of flashes the sector under erase does not necessarily have to be
mtd->erasesize bytes long. For example, on S28 flashes the first 128 KiB
region is composed of 32 4 KiB sectors, then a 128 KiB sector, and then
256 KiB sectors till the end.

Let the flash-specific erase functions erase less than the requested
length in case of the 4 or 128 KiB sectors and report the number of
bytes erased back to the calling function.

Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
drivers/mtd/spi/spi-nor-core.c