Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0-only
0002 menuconfig MTD_SPI_NOR
0003         tristate "SPI NOR device support"
0004         depends on MTD
0005         depends on MTD && SPI_MASTER
0006         select SPI_MEM
0007         help
0008           This is the framework for the SPI NOR which can be used by the SPI
0009           device drivers and the SPI NOR device driver.
0010 
0011 if MTD_SPI_NOR
0012 
0013 config MTD_SPI_NOR_USE_4K_SECTORS
0014         bool "Use small 4096 B erase sectors"
0015         default y
0016         help
0017           Many flash memories support erasing small (4096 B) sectors. Depending
0018           on the usage this feature may provide performance gain in comparison
0019           to erasing whole blocks (32/64 KiB).
0020           Changing a small part of the flash's contents is usually faster with
0021           small sectors. On the other hand erasing should be faster when using
0022           64 KiB block instead of 16 × 4 KiB sectors.
0023 
0024           Please note that some tools/drivers/filesystems may not work with
0025           4096 B erase size (e.g. UBIFS requires 15 KiB as a minimum).
0026 
0027 choice
0028         prompt "Software write protection at boot"
0029         default MTD_SPI_NOR_SWP_DISABLE_ON_VOLATILE
0030 
0031 config MTD_SPI_NOR_SWP_DISABLE
0032         bool "Disable SWP on any flashes (legacy behavior)"
0033         help
0034           This option disables the software write protection on any SPI
0035           flashes at boot-up.
0036 
0037           Depending on the flash chip this either clears the block protection
0038           bits or does a "Global Unprotect" command.
0039 
0040           Don't use this if you intent to use the software write protection
0041           of your SPI flash. This is only to keep backwards compatibility.
0042 
0043 config MTD_SPI_NOR_SWP_DISABLE_ON_VOLATILE
0044         bool "Disable SWP on flashes w/ volatile protection bits"
0045         help
0046           Some SPI flashes have volatile block protection bits, ie. after a
0047           power-up or a reset the flash is software write protected by
0048           default.
0049 
0050           This option disables the software write protection for these kind
0051           of flashes while keeping it enabled for any other SPI flashes
0052           which have non-volatile write protection bits.
0053 
0054           If the software write protection will be disabled depending on
0055           the flash either the block protection bits are cleared or a
0056           "Global Unprotect" command is issued.
0057 
0058           If you are unsure, select this option.
0059 
0060 config MTD_SPI_NOR_SWP_KEEP
0061         bool "Keep software write protection as is"
0062         help
0063           If you select this option the software write protection of any
0064           SPI flashes will not be changed. If your flash is software write
0065           protected or will be automatically software write protected after
0066           power-up you have to manually unlock it before you are able to
0067           write to it.
0068 
0069 endchoice
0070 
0071 source "drivers/mtd/spi-nor/controllers/Kconfig"
0072 
0073 endif # MTD_SPI_NOR