mediatek: remove duplicated Fidelix SPI-NAND driver

Fixes: 25ade3560eb6 ("mediatek: import dosilicon/fmsh/gsto spi nand support")
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 19a75c41d4a7543226776d5667e34f7aaf0a8fa5)
This commit is contained in:
Tianling Shen
2025-06-22 20:53:13 +08:00
parent ece4ac1e52
commit def9f8ddfa
11 changed files with 27 additions and 150 deletions

View File

@@ -1125,7 +1125,7 @@ Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
MAX_BPF_LINK_TYPE,
};
@@ -1661,6 +1664,13 @@ union bpf_attr {
@@ -1662,6 +1665,13 @@ union bpf_attr {
__u32 flags;
__u32 pid;
} uprobe_multi;
@@ -1139,7 +1139,7 @@ Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
};
} link_create;
@@ -6584,6 +6594,10 @@ struct bpf_link_info {
@@ -6585,6 +6595,10 @@ struct bpf_link_info {
__u32 ifindex;
__u32 attach_type;
} tcx;
@@ -1216,7 +1216,7 @@ Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
return -EINVAL;
return 0;
default:
@@ -3967,7 +3972,11 @@ static int bpf_prog_attach(const union b
@@ -3968,7 +3973,11 @@ static int bpf_prog_attach(const union b
ret = cgroup_bpf_prog_attach(attr, ptype, prog);
break;
case BPF_PROG_TYPE_SCHED_CLS:
@@ -1229,7 +1229,7 @@ Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
break;
default:
ret = -EINVAL;
@@ -4028,7 +4037,11 @@ static int bpf_prog_detach(const union b
@@ -4029,7 +4038,11 @@ static int bpf_prog_detach(const union b
ret = cgroup_bpf_prog_detach(attr, ptype);
break;
case BPF_PROG_TYPE_SCHED_CLS:
@@ -1242,7 +1242,7 @@ Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
break;
default:
ret = -EINVAL;
@@ -4090,6 +4103,9 @@ static int bpf_prog_query(const union bp
@@ -4091,6 +4104,9 @@ static int bpf_prog_query(const union bp
case BPF_TCX_INGRESS:
case BPF_TCX_EGRESS:
return tcx_prog_query(attr, uattr);
@@ -1252,7 +1252,7 @@ Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
default:
return -EINVAL;
}
@@ -5071,7 +5087,11 @@ static int link_create(union bpf_attr *a
@@ -5072,7 +5088,11 @@ static int link_create(union bpf_attr *a
ret = bpf_xdp_link_attach(attr, prog);
break;
case BPF_PROG_TYPE_SCHED_CLS:
@@ -1284,7 +1284,7 @@ Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
MAX_BPF_LINK_TYPE,
};
@@ -1661,6 +1664,13 @@ union bpf_attr {
@@ -1662,6 +1665,13 @@ union bpf_attr {
__u32 flags;
__u32 pid;
} uprobe_multi;
@@ -1298,7 +1298,7 @@ Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
};
} link_create;
@@ -6587,6 +6597,10 @@ struct bpf_link_info {
@@ -6588,6 +6598,10 @@ struct bpf_link_info {
__u32 ifindex;
__u32 attach_type;
} tcx;

View File

@@ -41,7 +41,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -21989,6 +21989,7 @@ U-BOOT ENVIRONMENT VARIABLES
@@ -21998,6 +21998,7 @@ U-BOOT ENVIRONMENT VARIABLES
M: Rafał Miłecki <rafal@milecki.pl>
S: Maintained
F: Documentation/devicetree/bindings/nvmem/u-boot,env.yaml

View File

@@ -36,7 +36,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -22016,6 +22016,12 @@ F: Documentation/filesystems/ubifs-authe
@@ -22025,6 +22025,12 @@ F: Documentation/filesystems/ubifs-authe
F: Documentation/filesystems/ubifs.rst
F: fs/ubifs/

View File

@@ -19,7 +19,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -13357,7 +13357,9 @@ M: Daniel Golle <daniel@makrotopia.org>
@@ -13366,7 +13366,9 @@ M: Daniel Golle <daniel@makrotopia.org>
L: netdev@vger.kernel.org
S: Maintained
F: drivers/net/pcs/pcs-mtk-lynxi.c

View File

@@ -1,123 +0,0 @@
From 5f49a5c9b16330e0df8f639310e4715dcad71947 Mon Sep 17 00:00:00 2001
From: Davide Fioravanti <pantanastyle@gmail.com>
Date: Fri, 8 Jan 2021 15:35:24 +0100
Subject: [PATCH] mtd: spinand: Add support for the Fidelix FM35X1GA
Datasheet: http://www.hobos.com.cn/upload/datasheet/DS35X1GAXXX_100_rev00.pdf
Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
---
drivers/mtd/nand/spi/Makefile | 2 +-
drivers/mtd/nand/spi/core.c | 1 +
drivers/mtd/nand/spi/fidelix.c | 76 ++++++++++++++++++++++++++++++++++
include/linux/mtd/spinand.h | 1 +
4 files changed, 79 insertions(+), 1 deletion(-)
create mode 100644 drivers/mtd/nand/spi/fidelix.c
--- a/drivers/mtd/nand/spi/Makefile
+++ b/drivers/mtd/nand/spi/Makefile
@@ -1,4 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
-spinand-objs := core.o alliancememory.o ato.o esmt.o etron.o foresee.o gigadevice.o
+spinand-objs := core.o alliancememory.o ato.o esmt.o etron.o fidelix.o foresee.o gigadevice.o
spinand-objs += macronix.o micron.o paragon.o toshiba.o winbond.o xtx.o
obj-$(CONFIG_MTD_SPI_NAND) += spinand.o
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -942,6 +942,7 @@ static const struct spinand_manufacturer
&ato_spinand_manufacturer,
&esmt_c8_spinand_manufacturer,
&etron_spinand_manufacturer,
+ &fidelix_spinand_manufacturer,
&foresee_spinand_manufacturer,
&gigadevice_spinand_manufacturer,
&macronix_spinand_manufacturer,
--- /dev/null
+++ b/drivers/mtd/nand/spi/fidelix.c
@@ -0,0 +1,76 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2020 Davide Fioravanti <pantanastyle@gmail.com>
+ */
+
+#include <linux/device.h>
+#include <linux/kernel.h>
+#include <linux/mtd/spinand.h>
+
+#define SPINAND_MFR_FIDELIX 0xE5
+#define FIDELIX_ECCSR_MASK 0x0F
+
+static SPINAND_OP_VARIANTS(read_cache_variants,
+ SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0));
+
+static SPINAND_OP_VARIANTS(write_cache_variants,
+ SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
+ SPINAND_PROG_LOAD(true, 0, NULL, 0));
+
+static SPINAND_OP_VARIANTS(update_cache_variants,
+ SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
+ SPINAND_PROG_LOAD(true, 0, NULL, 0));
+
+static int fm35x1ga_ooblayout_ecc(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *region)
+{
+ if (section > 3)
+ return -ERANGE;
+
+ region->offset = (16 * section) + 8;
+ region->length = 8;
+
+ return 0;
+}
+
+static int fm35x1ga_ooblayout_free(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *region)
+{
+ if (section > 3)
+ return -ERANGE;
+
+ region->offset = (16 * section) + 2;
+ region->length = 6;
+
+ return 0;
+}
+
+static const struct mtd_ooblayout_ops fm35x1ga_ooblayout = {
+ .ecc = fm35x1ga_ooblayout_ecc,
+ .free = fm35x1ga_ooblayout_free,
+};
+
+static const struct spinand_info fidelix_spinand_table[] = {
+ SPINAND_INFO("FM35X1GA",
+ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x71),
+ NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
+ NAND_ECCREQ(4, 512),
+ SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+ &write_cache_variants,
+ &update_cache_variants),
+ SPINAND_HAS_QE_BIT,
+ SPINAND_ECCINFO(&fm35x1ga_ooblayout, NULL)),
+};
+
+static const struct spinand_manufacturer_ops fidelix_spinand_manuf_ops = {
+};
+
+const struct spinand_manufacturer fidelix_spinand_manufacturer = {
+ .id = SPINAND_MFR_FIDELIX,
+ .name = "Fidelix",
+ .chips = fidelix_spinand_table,
+ .nchips = ARRAY_SIZE(fidelix_spinand_table),
+ .ops = &fidelix_spinand_manuf_ops,
+};
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -264,6 +264,7 @@ extern const struct spinand_manufacturer
extern const struct spinand_manufacturer ato_spinand_manufacturer;
extern const struct spinand_manufacturer esmt_c8_spinand_manufacturer;
extern const struct spinand_manufacturer etron_spinand_manufacturer;
+extern const struct spinand_manufacturer fidelix_spinand_manufacturer;
extern const struct spinand_manufacturer foresee_spinand_manufacturer;
extern const struct spinand_manufacturer gigadevice_spinand_manufacturer;
extern const struct spinand_manufacturer macronix_spinand_manufacturer;

View File

@@ -19,7 +19,7 @@ Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
+++ b/drivers/mtd/nand/spi/Makefile
@@ -1,4 +1,5 @@
# SPDX-License-Identifier: GPL-2.0
spinand-objs := core.o alliancememory.o ato.o esmt.o etron.o fidelix.o foresee.o gigadevice.o
spinand-objs := core.o alliancememory.o ato.o esmt.o etron.o foresee.o gigadevice.o
+spinand-objs += dosilicon.o
spinand-objs += macronix.o micron.o paragon.o toshiba.o winbond.o xtx.o
obj-$(CONFIG_MTD_SPI_NAND) += spinand.o
@@ -32,7 +32,7 @@ Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
+ &dosilicon_spinand_manufacturer,
&esmt_c8_spinand_manufacturer,
&etron_spinand_manufacturer,
&fidelix_spinand_manufacturer,
&foresee_spinand_manufacturer,
--- /dev/null
+++ b/drivers/mtd/nand/spi/dosilicon.c
@@ -0,0 +1,281 @@
@@ -326,4 +326,4 @@ Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
+extern const struct spinand_manufacturer dosilicon_spinand_manufacturer;
extern const struct spinand_manufacturer esmt_c8_spinand_manufacturer;
extern const struct spinand_manufacturer etron_spinand_manufacturer;
extern const struct spinand_manufacturer fidelix_spinand_manufacturer;
extern const struct spinand_manufacturer foresee_spinand_manufacturer;

View File

@@ -19,17 +19,17 @@ Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
+++ b/drivers/mtd/nand/spi/Makefile
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0
spinand-objs := core.o alliancememory.o ato.o esmt.o etron.o fidelix.o foresee.o gigadevice.o
spinand-objs := core.o alliancememory.o ato.o esmt.o etron.o foresee.o gigadevice.o
-spinand-objs += dosilicon.o
+spinand-objs += dosilicon.o fmsh.o
spinand-objs += macronix.o micron.o paragon.o toshiba.o winbond.o xtx.o
obj-$(CONFIG_MTD_SPI_NAND) += spinand.o
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -944,6 +944,7 @@ static const struct spinand_manufacturer
@@ -943,6 +943,7 @@ static const struct spinand_manufacturer
&dosilicon_spinand_manufacturer,
&esmt_c8_spinand_manufacturer,
&etron_spinand_manufacturer,
&fidelix_spinand_manufacturer,
+ &fmsh_spinand_manufacturer,
&foresee_spinand_manufacturer,
&gigadevice_spinand_manufacturer,
@@ -277,10 +277,10 @@ Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
+};
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -266,6 +266,7 @@ extern const struct spinand_manufacturer
@@ -265,6 +265,7 @@ extern const struct spinand_manufacturer
extern const struct spinand_manufacturer dosilicon_spinand_manufacturer;
extern const struct spinand_manufacturer esmt_c8_spinand_manufacturer;
extern const struct spinand_manufacturer etron_spinand_manufacturer;
extern const struct spinand_manufacturer fidelix_spinand_manufacturer;
+extern const struct spinand_manufacturer fmsh_spinand_manufacturer;
extern const struct spinand_manufacturer foresee_spinand_manufacturer;
extern const struct spinand_manufacturer gigadevice_spinand_manufacturer;

View File

@@ -19,14 +19,14 @@ Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
+++ b/drivers/mtd/nand/spi/Makefile
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0
spinand-objs := core.o alliancememory.o ato.o esmt.o etron.o fidelix.o foresee.o gigadevice.o
spinand-objs := core.o alliancememory.o ato.o esmt.o etron.o foresee.o gigadevice.o
-spinand-objs += dosilicon.o fmsh.o
+spinand-objs += dosilicon.o fmsh.o gsto.o
spinand-objs += macronix.o micron.o paragon.o toshiba.o winbond.o xtx.o
obj-$(CONFIG_MTD_SPI_NAND) += spinand.o
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -947,6 +947,7 @@ static const struct spinand_manufacturer
@@ -946,6 +946,7 @@ static const struct spinand_manufacturer
&fmsh_spinand_manufacturer,
&foresee_spinand_manufacturer,
&gigadevice_spinand_manufacturer,
@@ -176,7 +176,7 @@ Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
+};
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -269,6 +269,7 @@ extern const struct spinand_manufacturer
@@ -268,6 +268,7 @@ extern const struct spinand_manufacturer
extern const struct spinand_manufacturer fmsh_spinand_manufacturer;
extern const struct spinand_manufacturer foresee_spinand_manufacturer;
extern const struct spinand_manufacturer gigadevice_spinand_manufacturer;

View File

@@ -11,7 +11,7 @@ Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -983,6 +983,56 @@ static int spinand_manufacturer_match(st
@@ -982,6 +982,56 @@ static int spinand_manufacturer_match(st
return -ENOTSUPP;
}
@@ -68,7 +68,7 @@ Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
static int spinand_id_detect(struct spinand_device *spinand)
{
u8 *id = spinand->id.data;
@@ -1233,6 +1283,10 @@ static int spinand_init(struct spinand_d
@@ -1232,6 +1282,10 @@ static int spinand_init(struct spinand_d
if (!spinand->scratchbuf)
return -ENOMEM;

View File

@@ -12,7 +12,7 @@ Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -1024,7 +1024,10 @@ int spinand_cal_read(void *priv, u32 *ad
@@ -1023,7 +1023,10 @@ int spinand_cal_read(void *priv, u32 *ad
if (ret)
return ret;

View File

@@ -29,7 +29,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -1444,6 +1444,7 @@ static int spinand_remove(struct spi_mem
@@ -1443,6 +1443,7 @@ static int spinand_remove(struct spi_mem
static const struct spi_device_id spinand_ids[] = {
{ .name = "spi-nand" },
@@ -37,7 +37,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(spi, spinand_ids);
@@ -1451,6 +1452,7 @@ MODULE_DEVICE_TABLE(spi, spinand_ids);
@@ -1450,6 +1451,7 @@ MODULE_DEVICE_TABLE(spi, spinand_ids);
#ifdef CONFIG_OF
static const struct of_device_id spinand_of_ids[] = {
{ .compatible = "spi-nand" },