Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1402986

[PATCH 2/2] mtd: spi-nor: disable software protection for Winbond flash at startup (again)

From Matthias Schiffer <mschiffer@universe-factory.net>
Newsgroups linux.kernel
Subject [PATCH 2/2] mtd: spi-nor: disable software protection for Winbond flash at startup (again)
Date 2016-05-18 15:50 +0200
Message-ID <rAa1k-2O5-11@gated-at.bofh.it> (permalink)
References <rAa1k-2O5-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Support for unlocking Winbond flash had been originally added in c6fc217
("mtd: spi-nor: disable protection for Winbond flash at startup"), but was
reverted in 67b9bcd ("mtd: spi-nor: fix Spansion regressions (aliased with
Winbond)"), as some Spansion chips using the Winbond manufacturer ID
weren't working correctly with it.

The actual issue has been fixed meanwhile in 32321e9 ("mtd: spi-nor: wait
until lock/unlock operations are ready") and edf891e ("mtd: spi-nor: wait
for SR_WIP to clear on initial unlock"). After this fix, the Winbond flash
can be unlocked without causing havoc for Spansion chips.

We have verified that everything is working correctly on some Winbond chips
(like the w25q64, which is aliased with the Spansion s25fl064k) and
Spansion chips.

As an additional test, I also tried enabling the initial unlocking code for
the Spansion manufacturer ID. All tested Spansion flash chips showed the
same behaviour: without 32321e9 and edf891e, subsequent reads only returned
zeros (as reported by Felix Fietkau, leading to 67b9bcd), but with 32321e9
and edf891e, the chip continued to work correctly.

Cc: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
---
 drivers/mtd/spi-nor/spi-nor.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
index d681003..a834e66 100644
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -1306,6 +1306,7 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
 	    JEDEC_MFR(info) == SNOR_MFR_INTEL ||
 	    JEDEC_MFR(info) == SNOR_MFR_MACRONIX ||
 	    JEDEC_MFR(info) == SNOR_MFR_SST ||
+	    JEDEC_MFR(info) == SNOR_MFR_WINBOND ||
 	    info->flags & SPI_NOR_HAS_LOCK) {
 		write_enable(nor);
 		write_sr(nor, 0);
-- 
2.8.2

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 2/2] mtd: spi-nor: disable software protection for Winbond flash at startup (again) Matthias Schiffer <mschiffer@universe-factory.net> - 2016-05-18 15:50 +0200

csiph-web