[PATCH] mtd: spi-nor: Add Dosilicon DS25M/Q series support

Ssunk
2026-02-08T04:29:10Z

Add support for dosilicon ds25m4cb, ds25m4dn, ds25q4cb, ds25q4dn

Datasheets:
ds25m4cb:
https://www.dosilicon.com/resources/SPI%20NOR/DS25M4CB-XXXXX_Rev04.pdf
ds25m4dn:
https://www.dosilicon.com/resources/SPI%20NOR/DS25M4DN-XXXXX_Rev03.pdf
ds25q4cb:
https://www.dosilicon.com/resources/SPI%20NOR/DS25Q4CB-XXXXX_Rev03.pdf
ds25q4dn:
https://www.dosilicon.com/resources/SPI%20NOR/DS25Q4DN-XXXXX_Rev01.pdf

Signed-off-by: Ssunk <ssunkkan@gmail.com>
---
drivers/mtd/spi/Kconfig | 5 +++++
drivers/mtd/spi/spi-nor-ids.c | 11 +++++++++++
2 files changed, 16 insertions(+)

diff --git a/drivers/mtd/spi/Kconfig b/drivers/mtd/spi/Kconfig
index a13c7fc60e6..6d0d070ff9b 100644
--- a/drivers/mtd/spi/Kconfig
+++ b/drivers/mtd/spi/Kconfig
@@ -157,6 +157,11 @@ config SPI_FLASH_ATMEL
help
Add support for various Atmel SPI flash chips (AT45xxx and AT25xxx)

+config SPI_FLASH_DOSILICON
+ bool "Dosilicon SPI flash support"
+ help
+ Add support for various Dosilicon SPI flash chips (DS25xxx)
+
config SPI_FLASH_EON
bool "EON SPI flash support"
help
diff --git a/drivers/mtd/spi/spi-nor-ids.c b/drivers/mtd/spi/spi-nor-ids.c
index b6a07fa9063..4cd5f2991b0 100644
--- a/drivers/mtd/spi/spi-nor-ids.c
+++ b/drivers/mtd/spi/spi-nor-ids.c
@@ -77,6 +77,17 @@ const struct flash_info spi_nor_ids[] = {
{ INFO("at25sl321", 0x1f4216, 0, 64 * 1024, 64, SECT_4K) },
{ INFO("at26df081a", 0x1f4501, 0, 64 * 1024, 16, SECT_4K) },
#endif
+#ifdef CONFIG_SPI_FLASH_DOSILICON
+ /* Dosilicon Co., Ltd */
+ { INFO("ds25m4cb", 0xe5401a, 0, 64 * 1024, 1024,
+ SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+ { INFO("ds25m4dn", 0xe5401b, 0, 64 * 1024, 2048,
+ SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+ { INFO("ds25q4cb", 0xe5301a, 0, 64 * 1024, 1024,
+ SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+ { INFO("ds25q4dn", 0xe5301b, 0, 64 * 1024, 2048,
+ SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+#endif
#ifdef CONFIG_SPI_FLASH_EON /* EON */
/* EON -- en25xxx */
{ INFO("en25q80b", 0x1c3014, 0, 64 * 1024, 16, SECT_4K) },
--
2.41.0.windows.1