Skip to content

Commit 6235608

Browse files
mtd: spi-nor: fix Spansion regressions (aliased with Winbond)
Spansion and Winbond have occasionally used the same manufacturer ID, and they don't support the same features. Particularly, writing SR=0 seems to break read access for Spansion's s25fl064k. Unfortunately, we don't currently have a way to differentiate these Spansion and Winbond parts, so rather than regressing support for these Spansion flash, let's drop the new Winbond lock/unlock support for now. We can try to address Winbond support during the next release cycle. Original discussion: http://patchwork.ozlabs.org/patch/549173/ http://patchwork.ozlabs.org/patch/553683/ Fixes: 25fad83 ("mtd: spi-nor: support lock/unlock/is_locked for Winbond") Fixes: ed9729c ("mtd: spi-nor: disable protection for Winbond flash at startup") Signed-off-by: Brian Norris <[email protected]> Reported-by: Felix Fietkau <[email protected]> Cc: Felix Fietkau <[email protected]>
1 parent 4bd0684 commit 6235608

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

drivers/mtd/spi-nor/spi-nor.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,8 +1200,7 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
12001200

12011201
if (JEDEC_MFR(info) == SNOR_MFR_ATMEL ||
12021202
JEDEC_MFR(info) == SNOR_MFR_INTEL ||
1203-
JEDEC_MFR(info) == SNOR_MFR_SST ||
1204-
JEDEC_MFR(info) == SNOR_MFR_WINBOND) {
1203+
JEDEC_MFR(info) == SNOR_MFR_SST) {
12051204
write_enable(nor);
12061205
write_sr(nor, 0);
12071206
}
@@ -1217,8 +1216,7 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
12171216
mtd->_read = spi_nor_read;
12181217

12191218
/* NOR protection support for STmicro/Micron chips and similar */
1220-
if (JEDEC_MFR(info) == SNOR_MFR_MICRON ||
1221-
JEDEC_MFR(info) == SNOR_MFR_WINBOND) {
1219+
if (JEDEC_MFR(info) == SNOR_MFR_MICRON) {
12221220
nor->flash_lock = stm_lock;
12231221
nor->flash_unlock = stm_unlock;
12241222
nor->flash_is_locked = stm_is_locked;

include/linux/mtd/spi-nor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#define SNOR_MFR_MACRONIX CFI_MFR_MACRONIX
2626
#define SNOR_MFR_SPANSION CFI_MFR_AMD
2727
#define SNOR_MFR_SST CFI_MFR_SST
28-
#define SNOR_MFR_WINBOND 0xef
28+
#define SNOR_MFR_WINBOND 0xef /* Also used by some Spansion */
2929

3030
/*
3131
* Note on opcode nomenclature: some opcodes have a format like

0 commit comments

Comments
 (0)