generic: 6.1: manually refresh pending patches
[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,7 +17,8 @@ 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 obj-$(CONFIG_MTD_SPI_NOR) += controllers/
43 --- /dev/null
44 +++ b/drivers/mtd/spi-nor/xtx.c
45 @@ -0,0 +1,17 @@
46 +// SPDX-License-Identifier: GPL-2.0
47 +#include <linux/mtd/spi-nor.h>
48 +
49 +#include "core.h"
50 +
51 +static const struct flash_info xtx_parts[] = {
52 + /* XTX Technology (Shenzhen) Limited */
53 + { "xt25f128b", INFO(0x0B4018, 0, 64 * 1024, 256)
54 + NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
55 + SPI_NOR_QUAD_READ) },
56 +};
57 +
58 +const struct spi_nor_manufacturer spi_nor_xtx = {
59 + .name = "xtx",
60 + .parts = xtx_parts,
61 + .nparts = ARRAY_SIZE(xtx_parts),
62 +};
63 --- a/drivers/mtd/spi-nor/core.c
64 +++ b/drivers/mtd/spi-nor/core.c
65 @@ -1859,6 +1859,7 @@ static const struct spi_nor_manufacturer
66 &spi_nor_winbond,
67 &spi_nor_xilinx,
68 &spi_nor_xmc,
69 + &spi_nor_xtx,
70 };
71
72 static const struct flash_info *
73 --- a/drivers/mtd/spi-nor/core.h
74 +++ b/drivers/mtd/spi-nor/core.h
75 @@ -489,6 +489,7 @@ extern const struct spi_nor_manufacturer
76 extern const struct spi_nor_manufacturer spi_nor_winbond;
77 extern const struct spi_nor_manufacturer spi_nor_xilinx;
78 extern const struct spi_nor_manufacturer spi_nor_xmc;
79 +extern const struct spi_nor_manufacturer spi_nor_xtx;
80
81 extern const struct attribute_group *spi_nor_sysfs_groups[];
82