141-Revert-mtd-spi-nor-disable-protection-for-Winbond-fl.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  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. This reverts commit c6fc2171b249e73745c497b578b417a2946f1b2f.
  6. This commit is breaking read access on at least s25fl064k, but also
  7. possibly other Spansion flash chips.
  8. Any mtd read seems to succeed, but simply returns a zero-filled buffer.
  9. Signed-off-by: Felix Fietkau <nbd@nbd.name>
  10. ---
  11. --- a/drivers/mtd/spi-nor/spi-nor.c
  12. +++ b/drivers/mtd/spi-nor/spi-nor.c
  13. @@ -1194,14 +1194,13 @@ int spi_nor_scan(struct spi_nor *nor, co
  14. mutex_init(&nor->lock);
  15. /*
  16. - * Atmel, SST, Intel/Numonyx, and others serial NOR tend to power up
  17. - * with the software protection bits set
  18. + * Atmel, SST and Intel/Numonyx serial nor tend to power
  19. + * up with the software protection bits set
  20. */
  21. if (JEDEC_MFR(info) == SNOR_MFR_ATMEL ||
  22. JEDEC_MFR(info) == SNOR_MFR_INTEL ||
  23. - JEDEC_MFR(info) == SNOR_MFR_SST ||
  24. - JEDEC_MFR(info) == SNOR_MFR_WINBOND) {
  25. + JEDEC_MFR(info) == SNOR_MFR_SST) {
  26. write_enable(nor);
  27. write_sr(nor, 0);
  28. }