kernel: bump 6.1 to 6.1.53
[openwrt/staging/stintel.git] / target / linux / generic / pending-6.1 / 479-mtd-spi-nor-add-xtx-xt25f128b.patch
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 <daniel@makrotopia.org>
6 X-Patchwork-Id: 1234465
7 Date: Thu, 6 Feb 2020 19:19:41 +0200
8 From: Daniel Golle <daniel@makrotopia.org>
9 To: linux-mtd@lists.infradead.org
10 Subject: [PATCH v2] mtd: spi-nor: Add support for xt25f128b chip
11 Message-ID: <20200206171941.GA2398@makrotopia.org>
12 MIME-Version: 1.0
13 Content-Disposition: inline
14 List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-mtd>,
15 <mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>
16 Cc: Eitan Cohen <eitan@neot-semadar.com>, Piotr Dymacz <pepe2k@gmail.com>,
17 Tudor Ambarus <tudor.ambarus@microchip.com>
18 Sender: "linux-mtd" <linux-mtd-bounces@lists.infradead.org>
19 Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org
20
21 Add XT25F128B made by XTX Technology (Shenzhen) Limited.
22 This chip supports dual and quad read and uniform 4K-byte erase.
23 Verified on Teltonika RUT955 which comes with XT25F128B in recent
24 versions of the device.
25
26 Signed-off-by: Daniel Golle <daniel@makrotopia.org>
27 Signed-off-by: Felix Fietkau <nbd@nbd.name>
28 ---
29 drivers/mtd/spi-nor/spi-nor.c | 4 ++++
30 1 file changed, 4 insertions(+)
31
32 --- a/drivers/mtd/spi-nor/Makefile
33 +++ b/drivers/mtd/spi-nor/Makefile
34 @@ -17,6 +17,7 @@ spi-nor-objs += sst.o
35 spi-nor-objs += winbond.o
36 spi-nor-objs += xilinx.o
37 spi-nor-objs += xmc.o
38 +spi-nor-objs += xtx.o
39 spi-nor-$(CONFIG_DEBUG_FS) += debugfs.o
40 obj-$(CONFIG_MTD_SPI_NOR) += spi-nor.o
41
42 --- /dev/null
43 +++ b/drivers/mtd/spi-nor/xtx.c
44 @@ -0,0 +1,17 @@
45 +// SPDX-License-Identifier: GPL-2.0
46 +#include <linux/mtd/spi-nor.h>
47 +
48 +#include "core.h"
49 +
50 +static const struct flash_info xtx_parts[] = {
51 + /* XTX Technology (Shenzhen) Limited */
52 + { "xt25f128b", INFO(0x0B4018, 0, 64 * 1024, 256)
53 + NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
54 + SPI_NOR_QUAD_READ) },
55 +};
56 +
57 +const struct spi_nor_manufacturer spi_nor_xtx = {
58 + .name = "xtx",
59 + .parts = xtx_parts,
60 + .nparts = ARRAY_SIZE(xtx_parts),
61 +};
62 --- a/drivers/mtd/spi-nor/core.c
63 +++ b/drivers/mtd/spi-nor/core.c
64 @@ -1636,6 +1636,7 @@ static const struct spi_nor_manufacturer
65 &spi_nor_winbond,
66 &spi_nor_xilinx,
67 &spi_nor_xmc,
68 + &spi_nor_xtx,
69 };
70
71 static const struct flash_info *spi_nor_match_id(struct spi_nor *nor,
72 --- a/drivers/mtd/spi-nor/core.h
73 +++ b/drivers/mtd/spi-nor/core.h
74 @@ -633,6 +633,7 @@ extern const struct spi_nor_manufacturer
75 extern const struct spi_nor_manufacturer spi_nor_winbond;
76 extern const struct spi_nor_manufacturer spi_nor_xilinx;
77 extern const struct spi_nor_manufacturer spi_nor_xmc;
78 +extern const struct spi_nor_manufacturer spi_nor_xtx;
79
80 extern const struct attribute_group *spi_nor_sysfs_groups[];
81