1 # SPDX-License-Identifier: GPL-2.0-only
3 tristate "SPI NOR device support"
5 depends on MTD && SPI_MASTER
8 This is the framework for the SPI NOR which can be used by the SPI
9 device drivers and the SPI NOR device driver.
13 config MTD_SPI_NOR_USE_4K_SECTORS
14 bool "Use small 4096 B erase sectors"
17 Many flash memories support erasing small (4096 B) sectors. Depending
18 on the usage this feature may provide performance gain in comparison
19 to erasing whole blocks (32/64 KiB).
20 Changing a small part of the flash's contents is usually faster with
21 small sectors. On the other hand erasing should be faster when using
22 64 KiB block instead of 16 × 4 KiB sectors.
24 Please note that some tools/drivers/filesystems may not work with
25 4096 B erase size (e.g. UBIFS requires 15 KiB as a minimum).
28 prompt "Software write protection at boot"
29 default MTD_SPI_NOR_SWP_DISABLE_ON_VOLATILE
31 config MTD_SPI_NOR_SWP_DISABLE
32 bool "Disable SWP on any flashes (legacy behavior)"
34 This option disables the software write protection on any SPI
37 Depending on the flash chip this either clears the block protection
38 bits or does a "Global Unprotect" command.
40 Don't use this if you intent to use the software write protection
41 of your SPI flash. This is only to keep backwards compatibility.
43 config MTD_SPI_NOR_SWP_DISABLE_ON_VOLATILE
44 bool "Disable SWP on flashes w/ volatile protection bits"
46 Some SPI flashes have volatile block protection bits, ie. after a
47 power-up or a reset the flash is software write protected by
50 This option disables the software write protection for these kind
51 of flashes while keeping it enabled for any other SPI flashes
52 which have non-volatile write protection bits.
54 If the software write protection will be disabled depending on
55 the flash either the block protection bits are cleared or a
56 "Global Unprotect" command is issued.
58 If you are unsure, select this option.
60 config MTD_SPI_NOR_SWP_KEEP
61 bool "Keep software write protection as is"
63 If you select this option the software write protection of any
64 SPI flashes will not be changed. If your flash is software write
65 protected or will be automatically software write protected after
66 power-up you have to manually unlock it before you are able to
71 source "drivers/mtd/spi-nor/controllers/Kconfig"