u-boot-brain/drivers/mtd/spi
Simon Glass b3b60f5912 sf: Support querying write-protect
This feature was dropped from U-Boot some time ago:

   f12f96cfaf (sf: Drop spl_flash_get_sw_write_prot")

However, we do need a way to see if a flash device is write-protected,
since if it is, it may not be possible to write to do (i.e. failing to
write is expected).

I am not sure of the correct layer to implement this, so this patch is a
stab at it. If spi-flash makes sense then I will add to the 'sf' also.

Re the points mentioned in the removal commit:

    1) This kind of requirement can be achieved using existing
       flash operations and flash locking API calls instead of
       making a separate flash API.

Which uclass is this?

    2) Technically there is no real hardware user for this API to
       use in the source tree.

I do want coral (at least) to support this.

    3) Having a flash operations API for simple register read bits
       also make difficult to extend the flash operations.

This new patch only mentions write-protect being on or off, rather than
the actual mechanism.

    4) Instead of touching generic code, it is possible to have
       this functionality inside spinor operations in the form of
       flash hooks or fixups for associated flash chips.

That sounds to me like what drivers are for. But we still need some sort
of API for it to be accessible.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-27 15:04:31 +13:00
..
Kconfig mtd: spi-nor: add unlock all config option 2021-02-08 14:01:13 +05:30
Makefile spi: Allow separate control of SPI_FLASH_TINY for SPL/TPL 2020-08-03 22:19:54 -04:00
fsl_espi_spl.c common: Move hang() to the same header as panic() 2020-01-17 17:53:40 -05:00
sandbox.c dm: Avoid accessing seq directly 2020-12-18 20:32:21 -07:00
sf-uclass.c sf: Support querying write-protect 2021-03-27 15:04:31 +13:00
sf_dataflash.c dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
sf_internal.h sf: Support querying write-protect 2021-03-27 15:04:31 +13:00
sf_mtd.c common: Drop flash.h from common header 2020-05-18 14:53:28 -04:00
sf_probe.c sf: Support querying write-protect 2021-03-27 15:04:31 +13:00
spi-nor-core.c sf: Support querying write-protect 2021-03-27 15:04:31 +13:00
spi-nor-ids.c mtd: spi-nor-ids: Add support of flash protection to w25q128 2021-02-26 13:35:25 +05:30
spi-nor-tiny.c sf: Support querying write-protect 2021-03-27 15:04:31 +13:00