0032-kernel-mtd-spi-nor-unlock-Winbond-flashs.patch 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Sat, 7 May 2016 00:29:06 +0200
  3. Subject: kernel: mtd: spi-nor: unlock Winbond flashs
  4. diff --git a/target/linux/generic/patches-3.18/463-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch b/target/linux/generic/patches-3.18/463-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch
  5. new file mode 100644
  6. index 0000000..4682b7a
  7. --- /dev/null
  8. +++ b/target/linux/generic/patches-3.18/463-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch
  9. @@ -0,0 +1,46 @@
  10. +From 20bbd73b6b04677a73933830363ab3178adc2ce9 Mon Sep 17 00:00:00 2001
  11. +Message-Id: <20bbd73b6b04677a73933830363ab3178adc2ce9.1462573588.git.mschiffer@universe-factory.net>
  12. +From: Matthias Schiffer <mschiffer@universe-factory.net>
  13. +Date: Sat, 7 May 2016 00:26:23 +0200
  14. +Subject: [PATCH] Revert "mtd: spi-nor: fix Spansion regressions (aliased with
  15. + Winbond)"
  16. +
  17. +This reverts commit 67b9bcd36906e12a15ffec19463afbbd6a41660e.
  18. +---
  19. + drivers/mtd/spi-nor/spi-nor.c | 6 ++++--
  20. + include/linux/mtd/spi-nor.h | 2 +-
  21. + 2 files changed, 5 insertions(+), 3 deletions(-)
  22. +
  23. +--- a/drivers/mtd/spi-nor/spi-nor.c
  24. ++++ b/drivers/mtd/spi-nor/spi-nor.c
  25. +@@ -1165,7 +1165,8 @@ int spi_nor_scan(struct spi_nor *nor, co
  26. + if (JEDEC_MFR(info) == SNOR_MFR_ATMEL ||
  27. + JEDEC_MFR(info) == SNOR_MFR_INTEL ||
  28. + JEDEC_MFR(info) == SNOR_MFR_MACRONIX ||
  29. +- JEDEC_MFR(info) == SNOR_MFR_SST) {
  30. ++ JEDEC_MFR(info) == SNOR_MFR_SST ||
  31. ++ JEDEC_MFR(info) == SNOR_MFR_WINBOND) {
  32. + write_enable(nor);
  33. + write_sr(nor, 0);
  34. + spi_nor_wait_till_ready(nor);
  35. +@@ -1182,7 +1183,8 @@ int spi_nor_scan(struct spi_nor *nor, co
  36. + mtd->_read = spi_nor_read;
  37. +
  38. + /* NOR protection support for STmicro/Micron chips and similar */
  39. +- if (JEDEC_MFR(info) == SNOR_MFR_MICRON) {
  40. ++ if (JEDEC_MFR(info) == SNOR_MFR_MICRON ||
  41. ++ JEDEC_MFR(info) == SNOR_MFR_WINBOND) {
  42. + nor->flash_lock = stm_lock;
  43. + nor->flash_unlock = stm_unlock;
  44. + nor->flash_is_locked = stm_is_locked;
  45. +--- a/include/linux/mtd/spi-nor.h
  46. ++++ b/include/linux/mtd/spi-nor.h
  47. +@@ -25,7 +25,7 @@
  48. + #define SNOR_MFR_MACRONIX CFI_MFR_MACRONIX
  49. + #define SNOR_MFR_SPANSION CFI_MFR_AMD
  50. + #define SNOR_MFR_SST CFI_MFR_SST
  51. +-#define SNOR_MFR_WINBOND 0xef /* Also used by some Spansion */
  52. ++#define SNOR_MFR_WINBOND 0xef
  53. +
  54. + /*
  55. + * Note on opcode nomenclature: some opcodes have a format like