generic: mtd: backport SPI_NOR_HAS_LOCK
[openwrt/openwrt.git] / target / linux / generic / patches-4.4 / 465-m25p80-mx-disable-software-protection.patch
1 Disable software protection bits for Macronix flashes.
2
3 Signed-off-by: Felix Fietkau <nbd@nbd.name>
4
5 --- a/drivers/mtd/spi-nor/spi-nor.c
6 +++ b/drivers/mtd/spi-nor/spi-nor.c
7 @@ -1159,6 +1159,7 @@ int spi_nor_scan(struct spi_nor *nor, co
8
9 if (JEDEC_MFR(info) == SNOR_MFR_ATMEL ||
10 JEDEC_MFR(info) == SNOR_MFR_INTEL ||
11 + JEDEC_MFR(info) == SNOR_MFR_MACRONIX ||
12 JEDEC_MFR(info) == SNOR_MFR_SST ||
13 info->flags & SPI_NOR_HAS_LOCK) {
14 write_enable(nor);