0020-generic-mtd-spi-nor-disable-protection-for-Winbond-flash-at-startup.patch 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Tue, 29 Mar 2016 21:58:53 +0200
  3. Subject: generic: mtd: spi-nor: disable protection for Winbond flash at startup
  4. diff --git a/target/linux/generic/patches-3.18/463-mtd-spi-nor-wait-until-lock-unlock-operations-are-re.patch b/target/linux/generic/patches-3.18/463-mtd-spi-nor-wait-until-lock-unlock-operations-are-re.patch
  5. new file mode 100644
  6. index 0000000..c906425
  7. --- /dev/null
  8. +++ b/target/linux/generic/patches-3.18/463-mtd-spi-nor-wait-until-lock-unlock-operations-are-re.patch
  9. @@ -0,0 +1,47 @@
  10. +From 26e4790ddad59038ece16c8b89ad856bee946d75 Mon Sep 17 00:00:00 2001
  11. +Message-Id: <26e4790ddad59038ece16c8b89ad856bee946d75.1459281384.git.mschiffer@universe-factory.net>
  12. +From: Matthias Schiffer <mschiffer@universe-factory.net>
  13. +Date: Tue, 29 Mar 2016 21:51:10 +0200
  14. +Subject: [PATCH 1/2] mtd: spi-nor: wait until lock/unlock operations are ready
  15. +
  16. +Upstream commits:
  17. +
  18. +32321e950d8a237d7e8f3a9b76220007dfa87544
  19. +edf891ef9ab773363f8e58022a26d7d31604aed6
  20. +---
  21. + drivers/mtd/spi-nor/spi-nor.c | 5 +++++
  22. + 1 file changed, 5 insertions(+)
  23. +
  24. +diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
  25. +index ef783a4..1ab6e24 100644
  26. +--- a/drivers/mtd/spi-nor/spi-nor.c
  27. ++++ b/drivers/mtd/spi-nor/spi-nor.c
  28. +@@ -370,6 +370,8 @@ static int spi_nor_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
  29. + ret = write_sr(nor, status_new);
  30. + if (ret)
  31. + goto err;
  32. ++
  33. ++ ret = wait_till_ready(nor);
  34. + }
  35. +
  36. + err:
  37. +@@ -417,6 +419,8 @@ static int spi_nor_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
  38. + ret = write_sr(nor, status_new);
  39. + if (ret)
  40. + goto err;
  41. ++
  42. ++ ret = wait_till_ready(nor);
  43. + }
  44. +
  45. + err:
  46. +@@ -966,6 +970,7 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
  47. + JEDEC_MFR(info->jedec_id) == CFI_MFR_SST) {
  48. + write_enable(nor);
  49. + write_sr(nor, 0);
  50. ++ wait_till_ready(nor);
  51. + }
  52. +
  53. + if (!mtd->name)
  54. +--
  55. +2.7.4
  56. +
  57. diff --git a/target/linux/generic/patches-3.18/464-mtd-spi-nor-disable-protection-for-Winbond-flash-at-.patch b/target/linux/generic/patches-3.18/464-mtd-spi-nor-disable-protection-for-Winbond-flash-at-.patch
  58. new file mode 100644
  59. index 0000000..7b45666
  60. --- /dev/null
  61. +++ b/target/linux/generic/patches-3.18/464-mtd-spi-nor-disable-protection-for-Winbond-flash-at-.patch
  62. @@ -0,0 +1,31 @@
  63. +From 03485b7e91a8f6e69e4945f937f266c59c1376d0 Mon Sep 17 00:00:00 2001
  64. +Message-Id: <03485b7e91a8f6e69e4945f937f266c59c1376d0.1459281384.git.mschiffer@universe-factory.net>
  65. +In-Reply-To: <26e4790ddad59038ece16c8b89ad856bee946d75.1459281384.git.mschiffer@universe-factory.net>
  66. +References: <26e4790ddad59038ece16c8b89ad856bee946d75.1459281384.git.mschiffer@universe-factory.net>
  67. +From: Matthias Schiffer <mschiffer@universe-factory.net>
  68. +Date: Tue, 29 Mar 2016 21:55:55 +0200
  69. +Subject: [PATCH 2/2] mtd: spi-nor: disable protection for Winbond flash at
  70. + startup
  71. +
  72. +Upstream commit: c6fc2171b249e73745c497b578b417a2946f1b2f
  73. +---
  74. + drivers/mtd/spi-nor/spi-nor.c | 3 ++-
  75. + 1 file changed, 2 insertions(+), 1 deletion(-)
  76. +
  77. +diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
  78. +index 1ab6e24..ea7fa30 100644
  79. +--- a/drivers/mtd/spi-nor/spi-nor.c
  80. ++++ b/drivers/mtd/spi-nor/spi-nor.c
  81. +@@ -967,7 +967,8 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
  82. + if (JEDEC_MFR(info->jedec_id) == CFI_MFR_ATMEL ||
  83. + JEDEC_MFR(info->jedec_id) == CFI_MFR_INTEL ||
  84. + JEDEC_MFR(info->jedec_id) == CFI_MFR_MACRONIX ||
  85. +- JEDEC_MFR(info->jedec_id) == CFI_MFR_SST) {
  86. ++ JEDEC_MFR(info->jedec_id) == CFI_MFR_SST ||
  87. ++ JEDEC_MFR(info->jedec_id) == CFI_MFR_WINBOND) {
  88. + write_enable(nor);
  89. + write_sr(nor, 0);
  90. + wait_till_ready(nor);
  91. +--
  92. +2.7.4
  93. +