Skip to contentSkip to conversation

mtd: spinand: add support for Dosilicon DS35Q1GA/DS35M1GA

PATCH Applied Ahmed Naseef 2 participants 3 messages Dec 9, 2025 – Jan 19

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mtd: spinand: add support for Dosilicon DS35Q1GA/DS35M1GA

Add support for Dosilicon DS35Q1GA (3.3V) and DS35M1GA (1.8V) SPI NAND.

These are 1Gbit (128MB) devices with:
- 2048 byte pages + 64 byte OOB
- 64 pages per block, 1024 blocks
- On-die 4-bit ECC per 512 byte sector

The 64-byte OOB area is divided into 4 segments of 16 bytes, with each segment containing 8 bytes of user data (M2+M1) and 8 bytes of ECC parity (R1). This provides 30 bytes of usable OOB space after reserving 2 bytes for the bad block marker.

Tested on Genexis Platinum 4410 (EcoNet EN751221) by writing known patterns to OOB and verifying ECC parity placement in R1 regions.

Datasheet:
https://www.dosilicon.com/resources/SPI%20NAND/DS35X1GAXXX_rev08.pdf

---
Changes in v2:
- Rebased on rc1 (updated SPINAND_OP_VARIANTS macros)
- Fixed OOB layout based on hardware testing:
- ECC regions: bytes 8-15, 24-31, 40-47, 56-63 (32 bytes total)
- Free regions: bytes 2-7, 16-23, 32-39, 48-55 (30 bytes total)
- Updated commit message

---
 drivers/mtd/nand/spi/Makefile    |  4 +-
 drivers/mtd/nand/spi/core.c      |  1 +
 drivers/mtd/nand/spi/dosilicon.c | 91 ++++++++++++++++++++++++++++++++
 include/linux/mtd/spinand.h      |  1 +
 4 files changed, 95 insertions(+), 2 deletions(-)
 create mode 100644 drivers/mtd/nand/spi/dosilicon.c
drivers/mtd/nand/spi/Makefile +2 -2
index 6d3d203df..a47bd22cd 100644
@@ -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
drivers/mtd/nand/spi/core.c +1 -0
index d20728657..0346916b0 100644
@@ -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,
drivers/mtd/nand/spi/dosilicon.c new file +91 -0

91 lines not on this page · raw message

include/linux/mtd/spinand.h +1 -0
index ce76f5c63..c50a43b44 100644
@@ -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;
Signature · 1 line
2.34.1
maintainer
#1 lore raw

Hello Ahmed,

Quoted 15 lines · Ahmed Naseef

Add support for Dosilicon DS35Q1GA (3.3V) and DS35M1GA (1.8V) SPI NAND.

These are 1Gbit (128MB) devices with:
- 2048 byte pages + 64 byte OOB
- 64 pages per block, 1024 blocks
- On-die 4-bit ECC per 512 byte sector

The 64-byte OOB area is divided into 4 segments of 16 bytes, with each segment containing 8 bytes of user data (M2+M1) and 8 bytes of ECC parity (R1). This provides 30 bytes of usable OOB space after reserving 2 bytes for the bad block marker.

Tested on Genexis Platinum 4410 (EcoNet EN751221) by writing known patterns to OOB and verifying ECC parity placement in R1 regions.

Quoted 7 lines

Datasheet:
https://www.dosilicon.com/resources/SPI%20NAND/DS35X1GAXXX_rev08.pdf

---
Changes in v2:
- Rebased on rc1 (updated SPINAND_OP_VARIANTS macros)

Thanks for this v2. It overall looks good to me but we are in the middle of the merge window, so when I was saying "at -rc1" I meant "the next one" which will be tagged next Sunday. It is probably fine as-is though, so I'll try to apply the patch and will tell you if there are any conflicts.

Thanks,
Miquèl

maintainer Applied
#2 lore raw
In reply to Ahmed Naseef
Quoted 8 lines · Ahmed Naseef

Add support for Dosilicon DS35Q1GA (3.3V) and DS35M1GA (1.8V) SPI NAND.

These are 1Gbit (128MB) devices with:
- 2048 byte pages + 64 byte OOB
- 64 pages per block, 1024 blocks
- On-die 4-bit ECC per 512 byte sector

[...]

Applied to nand/next, thanks!

[1/1] mtd: spinand: add support for Dosilicon DS35Q1GA/DS35M1GA
(no commit info)

Patche(s) should be available on mtd/linux.git and will be part of the next PR (provided that no robot complains by then).

Kind regards,
Miquèl