2
0

479-mtd-spi-nor-add-xtx-xt25f128b.patch 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. From patchwork Thu Feb 6 17:19:41 2020
  2. Content-Type: text/plain; charset="utf-8"
  3. MIME-Version: 1.0
  4. Content-Transfer-Encoding: 7bit
  5. X-Patchwork-Submitter: Daniel Golle <[email protected]>
  6. X-Patchwork-Id: 1234465
  7. Date: Thu, 6 Feb 2020 19:19:41 +0200
  8. From: Daniel Golle <[email protected]>
  9. To: [email protected]
  10. Subject: [PATCH v2] mtd: spi-nor: Add support for xt25f128b chip
  11. Message-ID: <[email protected]>
  12. MIME-Version: 1.0
  13. Content-Disposition: inline
  14. List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-mtd>,
  15. <mailto:[email protected]?subject=subscribe>
  16. Cc: Eitan Cohen <[email protected]>, Piotr Dymacz <[email protected]>,
  17. Tudor Ambarus <[email protected]>
  18. Sender: "linux-mtd" <[email protected]>
  19. Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org
  20. Add XT25F128B made by XTX Technology (Shenzhen) Limited.
  21. This chip supports dual and quad read and uniform 4K-byte erase.
  22. Verified on Teltonika RUT955 which comes with XT25F128B in recent
  23. versions of the device.
  24. Signed-off-by: Daniel Golle <[email protected]>
  25. Signed-off-by: Felix Fietkau <[email protected]>
  26. ---
  27. drivers/mtd/spi-nor/spi-nor.c | 4 ++++
  28. 1 file changed, 4 insertions(+)
  29. --- a/drivers/mtd/spi-nor/Makefile
  30. +++ b/drivers/mtd/spi-nor/Makefile
  31. @@ -17,6 +17,7 @@ spi-nor-objs += sst.o
  32. spi-nor-objs += winbond.o
  33. spi-nor-objs += xilinx.o
  34. spi-nor-objs += xmc.o
  35. +spi-nor-objs += xtx.o
  36. obj-$(CONFIG_MTD_SPI_NOR) += spi-nor.o
  37. obj-$(CONFIG_MTD_SPI_NOR) += controllers/
  38. --- /dev/null
  39. +++ b/drivers/mtd/spi-nor/xtx.c
  40. @@ -0,0 +1,15 @@
  41. +// SPDX-License-Identifier: GPL-2.0
  42. +#include <linux/mtd/spi-nor.h>
  43. +
  44. +#include "core.h"
  45. +
  46. +static const struct flash_info xtx_parts[] = {
  47. + /* XTX Technology (Shenzhen) Limited */
  48. + { "xt25f128b", INFO(0x0B4018, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
  49. +};
  50. +
  51. +const struct spi_nor_manufacturer spi_nor_xtx = {
  52. + .name = "xtx",
  53. + .parts = xtx_parts,
  54. + .nparts = ARRAY_SIZE(xtx_parts),
  55. +};
  56. --- a/drivers/mtd/spi-nor/core.c
  57. +++ b/drivers/mtd/spi-nor/core.c
  58. @@ -2037,6 +2037,7 @@ static const struct spi_nor_manufacturer
  59. &spi_nor_winbond,
  60. &spi_nor_xilinx,
  61. &spi_nor_xmc,
  62. + &spi_nor_xtx,
  63. };
  64. static const struct flash_info *
  65. --- a/drivers/mtd/spi-nor/core.h
  66. +++ b/drivers/mtd/spi-nor/core.h
  67. @@ -398,6 +398,7 @@ extern const struct spi_nor_manufacturer
  68. extern const struct spi_nor_manufacturer spi_nor_winbond;
  69. extern const struct spi_nor_manufacturer spi_nor_xilinx;
  70. extern const struct spi_nor_manufacturer spi_nor_xmc;
  71. +extern const struct spi_nor_manufacturer spi_nor_xtx;
  72. int spi_nor_write_enable(struct spi_nor *nor);
  73. int spi_nor_write_disable(struct spi_nor *nor);