drivers/mtd/nand/spi/Makefile | 4 +- drivers/mtd/nand/spi/core.c | 1 + drivers/mtd/nand/spi/dosilicon.c | 77 ++++++++++++++++++++++++++++++++ include/linux/mtd/spinand.h | 1 + 4 files changed, 81 insertions(+), 2 deletions(-) create mode 100644 drivers/mtd/nand/spi/dosilicon.c
Add support for Dosilicon DS35Q1GA and DS35M1GA SPI NAND.
Datasheet:
https://www.dosilicon.com/resources/SPI%20NAND/DS35X1GAXXX_rev08.pdf
Tested on Genexis Platinum 4410 (EcoNet EN751221).
Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
---
drivers/mtd/nand/spi/Makefile | 4 +-
drivers/mtd/nand/spi/core.c | 1 +
drivers/mtd/nand/spi/dosilicon.c | 77 ++++++++++++++++++++++++++++++++
include/linux/mtd/spinand.h | 1 +
4 files changed, 81 insertions(+), 2 deletions(-)
create mode 100644 drivers/mtd/nand/spi/dosilicon.c
diff --git a/drivers/mtd/nand/spi/Makefile b/drivers/mtd/nand/spi/Makefile
index 6d3d203df..a47bd22cd 100644
--- a/drivers/mtd/nand/spi/Makefile
+++ b/drivers/mtd/nand/spi/Makefile
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0
spinand-objs := core.o otp.o
-spinand-objs += alliancememory.o ato.o esmt.o fmsh.o foresee.o gigadevice.o macronix.o
-spinand-objs += micron.o paragon.o skyhigh.o toshiba.o winbond.o xtx.o
+spinand-objs += alliancememory.o ato.o dosilicon.o esmt.o fmsh.o foresee.o gigadevice.o
+spinand-objs += macronix.o micron.o paragon.o skyhigh.o toshiba.o winbond.o xtx.o
obj-$(CONFIG_MTD_SPI_NAND) += spinand.o
diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index d20728657..0346916b0 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -1227,6 +1227,7 @@ static const struct nand_ops spinand_ops = {
static const struct spinand_manufacturer *spinand_manufacturers[] = {
&alliancememory_spinand_manufacturer,
&ato_spinand_manufacturer,
+ &dosilicon_spinand_manufacturer,
&esmt_8c_spinand_manufacturer,
&esmt_c8_spinand_manufacturer,
&fmsh_spinand_manufacturer,
diff --git a/drivers/mtd/nand/spi/dosilicon.c b/drivers/mtd/nand/spi/dosilicon.c
new file mode 100644
index 000000000..95ec27a1a
--- /dev/null
+++ b/drivers/mtd/nand/spi/dosilicon.c
@@ -0,0 +1,77 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Author: Ahmed Naseef <naseefkm@gmail.com>
+ */
+
+#include <linux/device.h>
+#include <linux/kernel.h>
+#include <linux/mtd/spinand.h>
+
+#define SPINAND_MFR_DOSILICON 0xE5
+
+static SPINAND_OP_VARIANTS(read_cache_variants,
+ SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_X2_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(false, 0, NULL, 0),
+ SPINAND_PROG_LOAD(false, 0, NULL, 0));
+
+static int ds35xx_ooblayout_ecc(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *region)
+{
+ return -ERANGE;
+}
+
+static int ds35xx_ooblayout_free(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *region)
+{
+ if (section)
+ return -ERANGE;
+ region->offset = 2;
+ region->length = 62;
+ return 0;
+}
+
+static const struct mtd_ooblayout_ops ds35xx_ooblayout = {
+ .ecc = ds35xx_ooblayout_ecc,
+ .free = ds35xx_ooblayout_free,
+};
+
+static const struct spinand_info dosilicon_spinand_table[] = {
+ SPINAND_INFO("DS35Q1GA",
+ 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(&ds35xx_ooblayout, NULL)),
+ SPINAND_INFO("DS35M1GA",
+ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x21),
+ 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(&ds35xx_ooblayout, NULL)),
+};
+
+static const struct spinand_manufacturer_ops dosilicon_spinand_manuf_ops = {
+};
+
+const struct spinand_manufacturer dosilicon_spinand_manufacturer = {
+ .id = SPINAND_MFR_DOSILICON,
+ .name = "Dosilicon",
+ .chips = dosilicon_spinand_table,
+ .nchips = ARRAY_SIZE(dosilicon_spinand_table),
+ .ops = &dosilicon_spinand_manuf_ops,
+};
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index ce76f5c63..c50a43b44 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -354,6 +354,7 @@ struct spinand_manufacturer {
/* SPI NAND manufacturers */
extern const struct spinand_manufacturer alliancememory_spinand_manufacturer;
extern const struct spinand_manufacturer ato_spinand_manufacturer;
+extern const struct spinand_manufacturer dosilicon_spinand_manufacturer;
extern const struct spinand_manufacturer esmt_8c_spinand_manufacturer;
extern const struct spinand_manufacturer esmt_c8_spinand_manufacturer;
extern const struct spinand_manufacturer fmsh_spinand_manufacturer;
--
2.34.1
Hi Ahmed,
kernel test robot noticed the following build errors:
[auto build test ERROR on mtd/nand/next]
[also build test ERROR on linus/master next-20251208]
[cannot apply to v6.18]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Ahmed-Naseef/mtd-spinand-add-support-for-Dosilicon-DS35Q1GA-DS35M1GA/20251207-232019
base: https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next
patch link: https://lore.kernel.org/r/20251207150923.86328-1-naseefkm%40gmail.com
patch subject: [PATCH] mtd: spinand: add support for Dosilicon DS35Q1GA/DS35M1GA
config: nios2-allmodconfig (https://download.01.org/0day-ci/archive/20251209/202512090327.X5PXotX9-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 11.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251209/202512090327.X5PXotX9-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512090327.X5PXotX9-lkp@intel.com/
All error/warnings (new ones prefixed by >>):
In file included from drivers/mtd/nand/spi/dosilicon.c:8:
drivers/mtd/nand/spi/dosilicon.c:13:17: error: implicit declaration of function 'SPINAND_PAGE_READ_FROM_CACHE_X4_OP'; did you mean 'SPINAND_PAGE_READ_FROM_CACHE_1S_1D_4D_OP'? [-Werror=implicit-function-declaration]
13 | SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:389:48: note: in definition of macro 'SPINAND_OP_VARIANTS'
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^~~~~~~~~~~
drivers/mtd/nand/spi/dosilicon.c:14:17: error: implicit declaration of function 'SPINAND_PAGE_READ_FROM_CACHE_X2_OP'; did you mean 'SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP'? [-Werror=implicit-function-declaration]
14 | SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:389:48: note: in definition of macro 'SPINAND_OP_VARIANTS'
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^~~~~~~~~~~
drivers/mtd/nand/spi/dosilicon.c:15:17: error: implicit declaration of function 'SPINAND_PAGE_READ_FROM_CACHE_OP'; did you mean 'SPINAND_PAGE_READ_FROM_CACHE_1S_1D_4D_OP'? [-Werror=implicit-function-declaration]
15 | SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:389:48: note: in definition of macro 'SPINAND_OP_VARIANTS'
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^~~~~~~~~~~
>> include/linux/mtd/spinand.h:389:24: warning: missing braces around initializer [-Wmissing-braces]
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^
drivers/mtd/nand/spi/dosilicon.c:12:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
12 | static SPINAND_OP_VARIANTS(read_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
>> include/linux/mtd/spinand.h:389:46: error: initializer element is not constant
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^
drivers/mtd/nand/spi/dosilicon.c:12:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
12 | static SPINAND_OP_VARIANTS(read_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:389:46: note: (near initialization for 'read_cache_variants')
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^
drivers/mtd/nand/spi/dosilicon.c:12:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
12 | static SPINAND_OP_VARIANTS(read_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:390:32: warning: missing braces around initializer [-Wmissing-braces]
390 | .nops = sizeof((struct spi_mem_op[]){ __VA_ARGS__ }) / \
| ^
drivers/mtd/nand/spi/dosilicon.c:12:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
12 | static SPINAND_OP_VARIANTS(read_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:390:53: error: initializer element is not constant
390 | .nops = sizeof((struct spi_mem_op[]){ __VA_ARGS__ }) / \
| ^
drivers/mtd/nand/spi/dosilicon.c:12:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
12 | static SPINAND_OP_VARIANTS(read_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:390:53: note: (near initialization for 'read_cache_variants')
390 | .nops = sizeof((struct spi_mem_op[]){ __VA_ARGS__ }) / \
| ^
drivers/mtd/nand/spi/dosilicon.c:12:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
12 | static SPINAND_OP_VARIANTS(read_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:388:49: warning: missing braces around initializer [-Wmissing-braces]
388 | const struct spinand_op_variants name = { \
| ^
drivers/mtd/nand/spi/dosilicon.c:12:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
12 | static SPINAND_OP_VARIANTS(read_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
drivers/mtd/nand/spi/dosilicon.c:19:17: error: implicit declaration of function 'SPINAND_PROG_LOAD_X4'; did you mean 'SPINAND_CMD_PROG_LOAD_X4'? [-Werror=implicit-function-declaration]
19 | SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
| ^~~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:389:48: note: in definition of macro 'SPINAND_OP_VARIANTS'
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^~~~~~~~~~~
drivers/mtd/nand/spi/dosilicon.c:20:17: error: implicit declaration of function 'SPINAND_PROG_LOAD' [-Werror=implicit-function-declaration]
20 | SPINAND_PROG_LOAD(true, 0, NULL, 0));
| ^~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:389:48: note: in definition of macro 'SPINAND_OP_VARIANTS'
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^~~~~~~~~~~
>> include/linux/mtd/spinand.h:389:24: warning: missing braces around initializer [-Wmissing-braces]
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^
drivers/mtd/nand/spi/dosilicon.c:18:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
18 | static SPINAND_OP_VARIANTS(write_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
>> include/linux/mtd/spinand.h:389:46: error: initializer element is not constant
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^
drivers/mtd/nand/spi/dosilicon.c:18:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
18 | static SPINAND_OP_VARIANTS(write_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:389:46: note: (near initialization for 'write_cache_variants')
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^
drivers/mtd/nand/spi/dosilicon.c:18:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
18 | static SPINAND_OP_VARIANTS(write_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:390:32: warning: missing braces around initializer [-Wmissing-braces]
390 | .nops = sizeof((struct spi_mem_op[]){ __VA_ARGS__ }) / \
| ^
drivers/mtd/nand/spi/dosilicon.c:18:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
18 | static SPINAND_OP_VARIANTS(write_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:390:53: error: initializer element is not constant
390 | .nops = sizeof((struct spi_mem_op[]){ __VA_ARGS__ }) / \
| ^
drivers/mtd/nand/spi/dosilicon.c:18:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
18 | static SPINAND_OP_VARIANTS(write_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:390:53: note: (near initialization for 'write_cache_variants')
390 | .nops = sizeof((struct spi_mem_op[]){ __VA_ARGS__ }) / \
| ^
drivers/mtd/nand/spi/dosilicon.c:18:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
18 | static SPINAND_OP_VARIANTS(write_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:388:49: warning: missing braces around initializer [-Wmissing-braces]
388 | const struct spinand_op_variants name = { \
| ^
drivers/mtd/nand/spi/dosilicon.c:18:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
18 | static SPINAND_OP_VARIANTS(write_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
>> include/linux/mtd/spinand.h:389:24: warning: missing braces around initializer [-Wmissing-braces]
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^
drivers/mtd/nand/spi/dosilicon.c:22:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
22 | static SPINAND_OP_VARIANTS(update_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
>> include/linux/mtd/spinand.h:389:46: error: initializer element is not constant
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^
drivers/mtd/nand/spi/dosilicon.c:22:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
22 | static SPINAND_OP_VARIANTS(update_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:389:46: note: (near initialization for 'update_cache_variants')
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^
drivers/mtd/nand/spi/dosilicon.c:22:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
22 | static SPINAND_OP_VARIANTS(update_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:390:32: warning: missing braces around initializer [-Wmissing-braces]
390 | .nops = sizeof((struct spi_mem_op[]){ __VA_ARGS__ }) / \
| ^
drivers/mtd/nand/spi/dosilicon.c:22:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
22 | static SPINAND_OP_VARIANTS(update_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:390:53: error: initializer element is not constant
390 | .nops = sizeof((struct spi_mem_op[]){ __VA_ARGS__ }) / \
| ^
drivers/mtd/nand/spi/dosilicon.c:22:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
22 | static SPINAND_OP_VARIANTS(update_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:390:53: note: (near initialization for 'update_cache_variants')
390 | .nops = sizeof((struct spi_mem_op[]){ __VA_ARGS__ }) / \
| ^
drivers/mtd/nand/spi/dosilicon.c:22:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
22 | static SPINAND_OP_VARIANTS(update_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:388:49: warning: missing braces around initializer [-Wmissing-braces]
388 | const struct spinand_op_variants name = { \
| ^
drivers/mtd/nand/spi/dosilicon.c:22:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
22 | static SPINAND_OP_VARIANTS(update_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
--
In file included from dosilicon.c:8:
dosilicon.c:13:17: error: implicit declaration of function 'SPINAND_PAGE_READ_FROM_CACHE_X4_OP'; did you mean 'SPINAND_PAGE_READ_FROM_CACHE_1S_1D_4D_OP'? [-Werror=implicit-function-declaration]
13 | SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:389:48: note: in definition of macro 'SPINAND_OP_VARIANTS'
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^~~~~~~~~~~
dosilicon.c:14:17: error: implicit declaration of function 'SPINAND_PAGE_READ_FROM_CACHE_X2_OP'; did you mean 'SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP'? [-Werror=implicit-function-declaration]
14 | SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:389:48: note: in definition of macro 'SPINAND_OP_VARIANTS'
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^~~~~~~~~~~
dosilicon.c:15:17: error: implicit declaration of function 'SPINAND_PAGE_READ_FROM_CACHE_OP'; did you mean 'SPINAND_PAGE_READ_FROM_CACHE_1S_1D_4D_OP'? [-Werror=implicit-function-declaration]
15 | SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:389:48: note: in definition of macro 'SPINAND_OP_VARIANTS'
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^~~~~~~~~~~
>> include/linux/mtd/spinand.h:389:24: warning: missing braces around initializer [-Wmissing-braces]
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^
dosilicon.c:12:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
12 | static SPINAND_OP_VARIANTS(read_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
>> include/linux/mtd/spinand.h:389:46: error: initializer element is not constant
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^
dosilicon.c:12:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
12 | static SPINAND_OP_VARIANTS(read_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:389:46: note: (near initialization for 'read_cache_variants')
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^
dosilicon.c:12:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
12 | static SPINAND_OP_VARIANTS(read_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:390:32: warning: missing braces around initializer [-Wmissing-braces]
390 | .nops = sizeof((struct spi_mem_op[]){ __VA_ARGS__ }) / \
| ^
dosilicon.c:12:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
12 | static SPINAND_OP_VARIANTS(read_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:390:53: error: initializer element is not constant
390 | .nops = sizeof((struct spi_mem_op[]){ __VA_ARGS__ }) / \
| ^
dosilicon.c:12:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
12 | static SPINAND_OP_VARIANTS(read_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:390:53: note: (near initialization for 'read_cache_variants')
390 | .nops = sizeof((struct spi_mem_op[]){ __VA_ARGS__ }) / \
| ^
dosilicon.c:12:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
12 | static SPINAND_OP_VARIANTS(read_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:388:49: warning: missing braces around initializer [-Wmissing-braces]
388 | const struct spinand_op_variants name = { \
| ^
dosilicon.c:12:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
12 | static SPINAND_OP_VARIANTS(read_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
dosilicon.c:19:17: error: implicit declaration of function 'SPINAND_PROG_LOAD_X4'; did you mean 'SPINAND_CMD_PROG_LOAD_X4'? [-Werror=implicit-function-declaration]
19 | SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
| ^~~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:389:48: note: in definition of macro 'SPINAND_OP_VARIANTS'
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^~~~~~~~~~~
dosilicon.c:20:17: error: implicit declaration of function 'SPINAND_PROG_LOAD' [-Werror=implicit-function-declaration]
20 | SPINAND_PROG_LOAD(true, 0, NULL, 0));
| ^~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:389:48: note: in definition of macro 'SPINAND_OP_VARIANTS'
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^~~~~~~~~~~
>> include/linux/mtd/spinand.h:389:24: warning: missing braces around initializer [-Wmissing-braces]
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^
dosilicon.c:18:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
18 | static SPINAND_OP_VARIANTS(write_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
>> include/linux/mtd/spinand.h:389:46: error: initializer element is not constant
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^
dosilicon.c:18:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
18 | static SPINAND_OP_VARIANTS(write_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:389:46: note: (near initialization for 'write_cache_variants')
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^
dosilicon.c:18:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
18 | static SPINAND_OP_VARIANTS(write_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:390:32: warning: missing braces around initializer [-Wmissing-braces]
390 | .nops = sizeof((struct spi_mem_op[]){ __VA_ARGS__ }) / \
| ^
dosilicon.c:18:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
18 | static SPINAND_OP_VARIANTS(write_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:390:53: error: initializer element is not constant
390 | .nops = sizeof((struct spi_mem_op[]){ __VA_ARGS__ }) / \
| ^
dosilicon.c:18:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
18 | static SPINAND_OP_VARIANTS(write_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:390:53: note: (near initialization for 'write_cache_variants')
390 | .nops = sizeof((struct spi_mem_op[]){ __VA_ARGS__ }) / \
| ^
dosilicon.c:18:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
18 | static SPINAND_OP_VARIANTS(write_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:388:49: warning: missing braces around initializer [-Wmissing-braces]
388 | const struct spinand_op_variants name = { \
| ^
dosilicon.c:18:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
18 | static SPINAND_OP_VARIANTS(write_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
>> include/linux/mtd/spinand.h:389:24: warning: missing braces around initializer [-Wmissing-braces]
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^
dosilicon.c:22:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
22 | static SPINAND_OP_VARIANTS(update_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
>> include/linux/mtd/spinand.h:389:46: error: initializer element is not constant
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^
dosilicon.c:22:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
22 | static SPINAND_OP_VARIANTS(update_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:389:46: note: (near initialization for 'update_cache_variants')
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^
dosilicon.c:22:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
22 | static SPINAND_OP_VARIANTS(update_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:390:32: warning: missing braces around initializer [-Wmissing-braces]
390 | .nops = sizeof((struct spi_mem_op[]){ __VA_ARGS__ }) / \
| ^
dosilicon.c:22:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
22 | static SPINAND_OP_VARIANTS(update_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:390:53: error: initializer element is not constant
390 | .nops = sizeof((struct spi_mem_op[]){ __VA_ARGS__ }) / \
| ^
dosilicon.c:22:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
22 | static SPINAND_OP_VARIANTS(update_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:390:53: note: (near initialization for 'update_cache_variants')
390 | .nops = sizeof((struct spi_mem_op[]){ __VA_ARGS__ }) / \
| ^
dosilicon.c:22:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
22 | static SPINAND_OP_VARIANTS(update_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:388:49: warning: missing braces around initializer [-Wmissing-braces]
388 | const struct spinand_op_variants name = { \
| ^
dosilicon.c:22:8: note: in expansion of macro 'SPINAND_OP_VARIANTS'
22 | static SPINAND_OP_VARIANTS(update_cache_variants,
| ^~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +389 include/linux/mtd/spinand.h
7529df4652482c Peter Pan 2018-06-22 386
7529df4652482c Peter Pan 2018-06-22 387 #define SPINAND_OP_VARIANTS(name, ...) \
7529df4652482c Peter Pan 2018-06-22 388 const struct spinand_op_variants name = { \
7529df4652482c Peter Pan 2018-06-22 @389 .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
7529df4652482c Peter Pan 2018-06-22 390 .nops = sizeof((struct spi_mem_op[]){ __VA_ARGS__ }) / \
7529df4652482c Peter Pan 2018-06-22 391 sizeof(struct spi_mem_op), \
7529df4652482c Peter Pan 2018-06-22 392 }
7529df4652482c Peter Pan 2018-06-22 393
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Hi Ahmed,
kernel test robot noticed the following build errors:
[auto build test ERROR on mtd/nand/next]
[also build test ERROR on linus/master next-20251208]
[cannot apply to v6.18]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Ahmed-Naseef/mtd-spinand-add-support-for-Dosilicon-DS35Q1GA-DS35M1GA/20251207-232019
base: https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next
patch link: https://lore.kernel.org/r/20251207150923.86328-1-naseefkm%40gmail.com
patch subject: [PATCH] mtd: spinand: add support for Dosilicon DS35Q1GA/DS35M1GA
config: um-allmodconfig (https://download.01.org/0day-ci/archive/20251208/202512082140.yQUnjGPP-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251208/202512082140.yQUnjGPP-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512082140.yQUnjGPP-lkp@intel.com/
All error/warnings (new ones prefixed by >>):
In file included from drivers/mtd/nand/spi/dosilicon.c:8:
In file included from include/linux/mtd/spinand.h:16:
In file included from include/linux/spi/spi.h:17:
In file included from include/linux/scatterlist.h:9:
In file included from arch/um/include/asm/io.h:24:
include/asm-generic/io.h:1209:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
1209 | return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
| ~~~~~~~~~~ ^
>> drivers/mtd/nand/spi/dosilicon.c:13:3: error: call to undeclared function 'SPINAND_PAGE_READ_FROM_CACHE_X4_OP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
13 | SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
| ^
>> drivers/mtd/nand/spi/dosilicon.c:14:3: error: call to undeclared function 'SPINAND_PAGE_READ_FROM_CACHE_X2_OP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
14 | SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
| ^
>> drivers/mtd/nand/spi/dosilicon.c:15:3: error: call to undeclared function 'SPINAND_PAGE_READ_FROM_CACHE_OP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
15 | SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
| ^
>> drivers/mtd/nand/spi/dosilicon.c:13:3: warning: suggest braces around initialization of subobject [-Wmissing-braces]
12 | static SPINAND_OP_VARIANTS(read_cache_variants,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13 | SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| {
14 | SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 | SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16 | SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:389:34: note: expanded from macro 'SPINAND_OP_VARIANTS'
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^~~~~~~~~~~
>> drivers/mtd/nand/spi/dosilicon.c:13:3: warning: suggest braces around initialization of subobject [-Wmissing-braces]
12 | static SPINAND_OP_VARIANTS(read_cache_variants,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13 | SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| {
14 | SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 | SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16 | SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:389:34: note: expanded from macro 'SPINAND_OP_VARIANTS'
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^~~~~~~~~~~
>> drivers/mtd/nand/spi/dosilicon.c:13:3: error: initializer element is not a compile-time constant
12 | static SPINAND_OP_VARIANTS(read_cache_variants,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13 | SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14 | SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 | SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16 | SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:389:34: note: expanded from macro 'SPINAND_OP_VARIANTS'
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^~~~~~~~~~~
>> drivers/mtd/nand/spi/dosilicon.c:13:3: warning: suggest braces around initialization of subobject [-Wmissing-braces]
12 | static SPINAND_OP_VARIANTS(read_cache_variants,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13 | SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| {
14 | SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 | SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16 | SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:390:41: note: expanded from macro 'SPINAND_OP_VARIANTS'
390 | .nops = sizeof((struct spi_mem_op[]){ __VA_ARGS__ }) / \
| ^~~~~~~~~~~
>> drivers/mtd/nand/spi/dosilicon.c:13:3: warning: suggest braces around initialization of subobject [-Wmissing-braces]
12 | static SPINAND_OP_VARIANTS(read_cache_variants,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13 | SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| {
14 | SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 | SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16 | SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:390:41: note: expanded from macro 'SPINAND_OP_VARIANTS'
390 | .nops = sizeof((struct spi_mem_op[]){ __VA_ARGS__ }) / \
| ^~~~~~~~~~~
>> drivers/mtd/nand/spi/dosilicon.c:13:3: error: initializer element is not a compile-time constant
12 | static SPINAND_OP_VARIANTS(read_cache_variants,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13 | SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14 | SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 | SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16 | SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:390:41: note: expanded from macro 'SPINAND_OP_VARIANTS'
390 | .nops = sizeof((struct spi_mem_op[]){ __VA_ARGS__ }) / \
| ^~~~~~~~~~~
>> drivers/mtd/nand/spi/dosilicon.c:19:3: error: call to undeclared function 'SPINAND_PROG_LOAD_X4'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
19 | SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
| ^
>> drivers/mtd/nand/spi/dosilicon.c:20:3: error: call to undeclared function 'SPINAND_PROG_LOAD'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
20 | SPINAND_PROG_LOAD(true, 0, NULL, 0));
| ^
drivers/mtd/nand/spi/dosilicon.c:19:3: warning: suggest braces around initialization of subobject [-Wmissing-braces]
18 | static SPINAND_OP_VARIANTS(write_cache_variants,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19 | SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| {
20 | SPINAND_PROG_LOAD(true, 0, NULL, 0));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:389:34: note: expanded from macro 'SPINAND_OP_VARIANTS'
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^~~~~~~~~~~
drivers/mtd/nand/spi/dosilicon.c:19:3: warning: suggest braces around initialization of subobject [-Wmissing-braces]
18 | static SPINAND_OP_VARIANTS(write_cache_variants,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19 | SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| {
20 | SPINAND_PROG_LOAD(true, 0, NULL, 0));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:389:34: note: expanded from macro 'SPINAND_OP_VARIANTS'
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^~~~~~~~~~~
drivers/mtd/nand/spi/dosilicon.c:19:3: error: initializer element is not a compile-time constant
18 | static SPINAND_OP_VARIANTS(write_cache_variants,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19 | SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 | SPINAND_PROG_LOAD(true, 0, NULL, 0));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:389:34: note: expanded from macro 'SPINAND_OP_VARIANTS'
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^~~~~~~~~~~
drivers/mtd/nand/spi/dosilicon.c:19:3: warning: suggest braces around initialization of subobject [-Wmissing-braces]
18 | static SPINAND_OP_VARIANTS(write_cache_variants,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19 | SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| {
20 | SPINAND_PROG_LOAD(true, 0, NULL, 0));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:390:41: note: expanded from macro 'SPINAND_OP_VARIANTS'
390 | .nops = sizeof((struct spi_mem_op[]){ __VA_ARGS__ }) / \
| ^~~~~~~~~~~
drivers/mtd/nand/spi/dosilicon.c:19:3: warning: suggest braces around initialization of subobject [-Wmissing-braces]
18 | static SPINAND_OP_VARIANTS(write_cache_variants,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19 | SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| {
20 | SPINAND_PROG_LOAD(true, 0, NULL, 0));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:390:41: note: expanded from macro 'SPINAND_OP_VARIANTS'
390 | .nops = sizeof((struct spi_mem_op[]){ __VA_ARGS__ }) / \
| ^~~~~~~~~~~
drivers/mtd/nand/spi/dosilicon.c:19:3: error: initializer element is not a compile-time constant
18 | static SPINAND_OP_VARIANTS(write_cache_variants,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19 | SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 | SPINAND_PROG_LOAD(true, 0, NULL, 0));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:390:41: note: expanded from macro 'SPINAND_OP_VARIANTS'
390 | .nops = sizeof((struct spi_mem_op[]){ __VA_ARGS__ }) / \
| ^~~~~~~~~~~
drivers/mtd/nand/spi/dosilicon.c:23:3: warning: suggest braces around initialization of subobject [-Wmissing-braces]
22 | static SPINAND_OP_VARIANTS(update_cache_variants,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23 | SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| {
24 | SPINAND_PROG_LOAD(false, 0, NULL, 0));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:389:34: note: expanded from macro 'SPINAND_OP_VARIANTS'
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^~~~~~~~~~~
drivers/mtd/nand/spi/dosilicon.c:23:3: warning: suggest braces around initialization of subobject [-Wmissing-braces]
22 | static SPINAND_OP_VARIANTS(update_cache_variants,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23 | SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| {
24 | SPINAND_PROG_LOAD(false, 0, NULL, 0));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:389:34: note: expanded from macro 'SPINAND_OP_VARIANTS'
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^~~~~~~~~~~
drivers/mtd/nand/spi/dosilicon.c:23:3: error: initializer element is not a compile-time constant
22 | static SPINAND_OP_VARIANTS(update_cache_variants,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23 | SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24 | SPINAND_PROG_LOAD(false, 0, NULL, 0));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mtd/spinand.h:389:34: note: expanded from macro 'SPINAND_OP_VARIANTS'
389 | .ops = (struct spi_mem_op[]) { __VA_ARGS__ }, \
| ^~~~~~~~~~~
drivers/mtd/nand/spi/dosilicon.c:23:3: warning: suggest braces around initialization of subobject [-Wmissing-braces]
22 | static SPINAND_OP_VARIANTS(update_cache_variants,
vim +/SPINAND_PAGE_READ_FROM_CACHE_X4_OP +13 drivers/mtd/nand/spi/dosilicon.c
> 8 #include <linux/mtd/spinand.h>
9
10 #define SPINAND_MFR_DOSILICON 0xE5
11
12 static SPINAND_OP_VARIANTS(read_cache_variants,
> 13 SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
> 14 SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
> 15 SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
16 SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0));
17
18 static SPINAND_OP_VARIANTS(write_cache_variants,
> 19 SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
> 20 SPINAND_PROG_LOAD(true, 0, NULL, 0));
21
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Hi Ahmed, thanks for this contribution.
> +static SPINAND_OP_VARIANTS(read_cache_variants,
> + SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
> + SPINAND_PAGE_READ_FROM_CACHE_X2_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));
These macros have been renamed, please rebase at -rc1.
> +
> +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(false, 0, NULL, 0),
> + SPINAND_PROG_LOAD(false, 0, NULL, 0));
> +
> +static int ds35xx_ooblayout_ecc(struct mtd_info *mtd, int section,
> + struct mtd_oob_region *region)
> +{
> + return -ERANGE;
> +}
This is strange, there is usually some spare area used for storing the
ECC. Are you sure none of the bytes in the spare area are being smashed
when you write them?
> +static int ds35xx_ooblayout_free(struct mtd_info *mtd, int section,
> + struct mtd_oob_region *region)
> +{
> + if (section)
> + return -ERANGE;
> + region->offset = 2;
> + region->length = 62;
> + return 0;
> +}
> +
LGTM otherwise.
Thanks,
Miquèl
Hi Miquèl, Thank you for the review. You were right about the OOB layout - it was incorrect. > These macros have been renamed, please rebase at -rc1. Done, updated in v2. > This is strange, there is usually some spare area used for storing the > ECC. Are you sure none of the bytes in the spare area are being smashed > when you write them? You were correct - the original OOB layout was wrong. I initially misread the datasheet's "hidden spare area" phrase and assumed ECC parity was stored internally by the chip. I've now done hardware testing which proves otherwise. Test procedure (on Genexis Platinum 4410) 1. Erased a block and wrote 0xAA to all 62 OOB bytes (2-63) 2. Read back the page with ECC enabled Result: 00000800 ff ff aa aa aa aa aa aa e5 58 4e 86 77 75 0e f0 00000810 aa aa aa aa aa aa aa aa e5 58 4e 86 77 75 0e f0 ... The R1 regions (bytes 8-15, 24-31, 40-47, 56-63) were overwritten with ECC parity data, while M2+M1 regions preserved the 0xAA pattern. Corrected OOB layout (per datasheet Table 3.7): - 64 bytes total, 4 segments of 16 bytes each - Each segment: bytes 0-7 user data (M2+M1), bytes 8-15 ECC parity (R1) - Free: 30 bytes total (6+8+8+8, accounting for 2-byte BBM) - ECC: 32 bytes total (8 bytes × 4 segments) v2 includes the corrected OOB layout with proper ECC and free region callbacks. Thanks, Ahmed Naseef
© 2016 - 2025 Red Hat, Inc.