ar71xx: fix legacy image build error
[openwrt/openwrt.git] / target / linux / generic / patches-4.1 / 141-Revert-mtd-spi-nor-disable-protection-for-Winbond-fl.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Thu, 26 Nov 2015 17:03:46 +0100
3 Subject: [PATCH] Revert "mtd: spi-nor: disable protection for Winbond flash at
4 startup"
5
6 This reverts commit c6fc2171b249e73745c497b578b417a2946f1b2f.
7
8 This commit is breaking read access on at least s25fl064k, but also
9 possibly other Spansion flash chips.
10
11 Any mtd read seems to succeed, but simply returns a zero-filled buffer.
12
13 Signed-off-by: Felix Fietkau <nbd@nbd.name>
14 ---
15
16 --- a/drivers/mtd/spi-nor/spi-nor.c
17 +++ b/drivers/mtd/spi-nor/spi-nor.c
18 @@ -1194,14 +1194,13 @@ int spi_nor_scan(struct spi_nor *nor, co
19 mutex_init(&nor->lock);
20
21 /*
22 - * Atmel, SST, Intel/Numonyx, and others serial NOR tend to power up
23 - * with the software protection bits set
24 + * Atmel, SST and Intel/Numonyx serial nor tend to power
25 + * up with the software protection bits set
26 */
27
28 if (JEDEC_MFR(info) == SNOR_MFR_ATMEL ||
29 JEDEC_MFR(info) == SNOR_MFR_INTEL ||
30 - JEDEC_MFR(info) == SNOR_MFR_SST ||
31 - JEDEC_MFR(info) == SNOR_MFR_WINBOND) {
32 + JEDEC_MFR(info) == SNOR_MFR_SST) {
33 write_enable(nor);
34 write_sr(nor, 0);
35 }