]> git.baikalelectronics.ru Git - uboot.git/commit
mtd: spi-nor-core: Add non-uniform erase for Spansion/Cypress
authorTakahiro Kuwano <Takahiro.Kuwano@infineon.com>
Fri, 25 Jun 2021 19:17:27 +0000 (00:47 +0530)
committerJagan Teki <jagan@amarulasolutions.com>
Mon, 28 Jun 2021 06:36:07 +0000 (12:06 +0530)
commit62fee3483dbdd94827fa7ac671c72dacdb4ff78f
treee61be487cd84cfab3f5e941c6519febabfe498ee
parent51581e07755ee38012c8c665a485b14f19200b2c
mtd: spi-nor-core: Add non-uniform erase for Spansion/Cypress

Some of Spansion/Cypress chips have overlaid 4KB sectors at top and/or
bottom, depending on the device configuration, while U-Boot supports
uniform sector layout only.

The spansion_erase_non_uniform()  erases overlaid 4KB sectors,
non-overlaid portion of normal sector, and remaining normal sectors, by
selecting correct erase command and size based on the address to erase
and size of overlaid portion in parameters. Since different Spansion
flashes can use different opcode for erasing the 4K sectors, the opcode
must be passed in as a parameter based on the flash being used.

Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
[p.yadav@ti.com: Refactor the function to be compatible with nor->erase,
make 4K opcode customizable, call spi_nor_setup_op() before executing
the op.]
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
drivers/mtd/spi/spi-nor-core.c