Skip to contentSkip to conversation

mtd: spi-nor: ids: Add support for Puyasemi flash chips

PATCH Superseded Ssunk 2 participants 3 messages Jan 30 – Feb 4 Memory technology devices (MTD)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Ssunk

author
#0 lore raw

PATCH 1/1 mtd: spi-nor: ids: Add support for Puyasemi flash chips

This patch adds JEDEC IDs for Puyasemi PY25F512HB, PY25F01GHB, PY25F512LC, and PY25F01GLC flash parts.

site: https://www.puyasemi.com

---
 drivers/mtd/spi/Kconfig       |  6 ++++++
 drivers/mtd/spi/spi-nor-ids.c | 11 +++++++++++
 2 files changed, 17 insertions(+)
drivers/mtd/spi/Kconfig +6 -0
index a9617c6c58..c223862a46 100644
@@ -217,6 +217,12 @@ config SPI_FLASH_XTX
 	  Add support for various XTX (XTX Technology Limited)
 	  SPI flash chips (XT25xxx).
 
+config SPI_FLASH_PUYASEMI
+	bool "PUYASEMI SPI flash support"
+	help
+	  Add support for various PUYASEMI (Puya Semiconductor (Shanghai) Co., Ltd.)
+	  SPI flash chips (py25xxx)
+
 endif
 
 config SPI_FLASH_USE_4K_SECTORS
drivers/mtd/spi/spi-nor-ids.c +11 -0
index 4b7b358eac..2e479ab8a1 100644
@@ -624,6 +624,17 @@ const struct flash_info spi_nor_ids[] = {
 	       SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
 	{ INFO("xt25w01g", 0x0b651B, 0, 64 * 1024, 2048,
 	       SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+#endif
+#ifdef CONFIG_SPI_FLASH_PUYASEMI
+	/* Puya Semiconductor (Shanghai) Co., Ltd */
+	{ INFO("py25f512hb", 0x85231a, 0, 64 * 1024, 1024,
+	       SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+	{ INFO("py25f01ghb", 0x85231b, 0, 64 * 1024, 2048,
+	       SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+	{ INFO("py25f512lc", 0x85631a, 0, 64 * 1024, 1024,
+	       SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+	{ INFO("py25f01glc", 0x85631b, 0, 64 * 1024, 2048,
+	       SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
 #endif
 	{ },
 };
Signature · 1 line
2.34.1
#1 lore raw
Quoted 4 lines · Ssunk

This patch adds JEDEC IDs for Puyasemi PY25F512HB, PY25F01GHB, PY25F512LC, and PY25F01GLC flash parts.

site: https://www.puyasemi.com

A link to the datasheets and a reference to the "Table ID Definitions" would be helpful in cross-checking the correctness of the IDs.

Quoted 2 lines

The patch doesn't apply cleanly, please rebase on master or next (as appropriate) for the next revision.

Quoted 10 lines
---
 drivers/mtd/spi/Kconfig       |  6 ++++++
 drivers/mtd/spi/spi-nor-ids.c | 11 +++++++++++
 2 files changed, 17 insertions(+)
drivers/mtd/spi/Kconfig +0 -0
index a9617c6c58..c223862a46 100644

drivers/mtd/spi/Kconfig config SPI_FLASH_XTX · line 225

Quoted 9 lines
drivers/mtd/spi/Kconfig +6 -0
@@ -217,6 +217,12 @@ config SPI_FLASH_XTX
 	  Add support for various XTX (XTX Technology Limited)
 	  SPI flash chips (XT25xxx).
 
+config SPI_FLASH_PUYASEMI
+	bool "PUYASEMI SPI flash support"
+	help
+	  Add support for various PUYASEMI (Puya Semiconductor (Shanghai) Co., Ltd.)
+	  SPI flash chips (py25xxx)
+

Can't this be included as part of the existing CONFIG_SPI_FLASH_PUYA which was added by the commit 5c73c05f20be ("mtd: spi-nor-ids: Add Puya Semiconductor chips description")?

Nit: Would be nice to see new configs being added in alphabetical order in the Kconfig, though the order is not strictly followed currently :(

Quoted 25 lines
drivers/mtd/spi/Kconfig +0 -0
 endif
 
 config SPI_FLASH_USE_4K_SECTORS
drivers/mtd/spi/spi-nor-ids.c +11 -0
index 4b7b358eac..2e479ab8a1 100644
@@ -624,6 +624,17 @@ const struct flash_info spi_nor_ids[] = {
 	       SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
 	{ INFO("xt25w01g", 0x0b651B, 0, 64 * 1024, 2048,
 	       SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+#endif
+#ifdef CONFIG_SPI_FLASH_PUYASEMI
+	/* Puya Semiconductor (Shanghai) Co., Ltd */
+	{ INFO("py25f512hb", 0x85231a, 0, 64 * 1024, 1024,
+	       SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+	{ INFO("py25f01ghb", 0x85231b, 0, 64 * 1024, 2048,
+	       SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+	{ INFO("py25f512lc", 0x85631a, 0, 64 * 1024, 1024,
+	       SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+	{ INFO("py25f01glc", 0x85631b, 0, 64 * 1024, 2048,
+	       SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
 #endif
 	{ },
 };
author
#2 lore raw

Hi Anshul,
Thanks for the review. I have sent v2 with the requested changes (using existing config and adding datasheet links).

Best regards,
Ssunk

Quoted 77 lines · Anshul Dalal <[email protected]> 于2026年2月2日周一 13:42写道:
Quoted 4 lines · Ssunk

This patch adds JEDEC IDs for Puyasemi PY25F512HB, PY25F01GHB, PY25F512LC, and PY25F01GLC flash parts.

site: https://www.puyasemi.com

A link to the datasheets and a reference to the "Table ID Definitions" would be helpful in cross-checking the correctness of the IDs.

Quoted 2 lines

The patch doesn't apply cleanly, please rebase on master or next (as appropriate) for the next revision.

Quoted 10 lines
---
 drivers/mtd/spi/Kconfig       |  6 ++++++
 drivers/mtd/spi/spi-nor-ids.c | 11 +++++++++++
 2 files changed, 17 insertions(+)
drivers/mtd/spi/Kconfig +0 -0
index a9617c6c58..c223862a46 100644

drivers/mtd/spi/Kconfig config SPI_FLASH_XTX · line 223

Quoted 7 lines
drivers/mtd/spi/Kconfig +4 -0
@@ -217,6 +217,12 @@ config SPI_FLASH_XTX
        Add support for various XTX (XTX Technology Limited)
        SPI flash chips (XT25xxx).
 
+config SPI_FLASH_PUYASEMI
+     bool "PUYASEMI SPI flash support"
+     help
+       Add support for various PUYASEMI (Puya Semiconductor (Shanghai)

Co., Ltd.)

drivers/mtd/spi/Kconfig config SPI_FLASH_XTX · line 225

Quoted 2 lines
drivers/mtd/spi/Kconfig +2 -0
+       SPI flash chips (py25xxx)
+

Can't this be included as part of the existing CONFIG_SPI_FLASH_PUYA which was added by the commit 5c73c05f20be ("mtd: spi-nor-ids: Add Puya Semiconductor chips description")?

Nit: Would be nice to see new configs being added in alphabetical order in the Kconfig, though the order is not strictly followed currently :(

Review

Quoted 4 lines
drivers/mtd/spi/Kconfig +0 -0
 endif
 
 config SPI_FLASH_USE_4K_SECTORS
(quoted diff) +0 -0

b/drivers/mtd/spi/spi-nor-ids.c

drivers/mtd/spi/spi-nor-ids.c const struct flash_info spi_nor_ids[] = { · line 624

Quoted 5 lines

index 4b7b358eac..2e479ab8a1 100644

drivers/mtd/spi/spi-nor-ids.c +0 -0
@@ -624,6 +624,17 @@ const struct flash_info spi_nor_ids[] = {
             SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |

SPI_NOR_4B_OPCODES) },

drivers/mtd/spi/spi-nor-ids.c const struct flash_info spi_nor_ids[] = { · line 626

Quoted 2 lines
drivers/mtd/spi/spi-nor-ids.c +0 -0
      { INFO("xt25w01g", 0x0b651B, 0, 64 * 1024, 2048,
             SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |

SPI_NOR_4B_OPCODES) },

drivers/mtd/spi/spi-nor-ids.c const struct flash_info spi_nor_ids[] = {

Quoted 5 lines
drivers/mtd/spi/spi-nor-ids.c +5 -0
+#endif
+#ifdef CONFIG_SPI_FLASH_PUYASEMI
+     /* Puya Semiconductor (Shanghai) Co., Ltd */
+     { INFO("py25f512hb", 0x85231a, 0, 64 * 1024, 1024,
+            SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |

SPI_NOR_4B_OPCODES) },

drivers/mtd/spi/spi-nor-ids.c const struct flash_info spi_nor_ids[] = { · line 633

Quoted 2 lines
drivers/mtd/spi/spi-nor-ids.c +2 -0
+     { INFO("py25f01ghb", 0x85231b, 0, 64 * 1024, 2048,
+            SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |

SPI_NOR_4B_OPCODES) },

drivers/mtd/spi/spi-nor-ids.c const struct flash_info spi_nor_ids[] = { · line 635

Quoted 2 lines
drivers/mtd/spi/spi-nor-ids.c +2 -0
+     { INFO("py25f512lc", 0x85631a, 0, 64 * 1024, 1024,
+            SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |

SPI_NOR_4B_OPCODES) },

drivers/mtd/spi/spi-nor-ids.c const struct flash_info spi_nor_ids[] = { · line 637

Quoted 2 lines
drivers/mtd/spi/spi-nor-ids.c +2 -0
+     { INFO("py25f01glc", 0x85631b, 0, 64 * 1024, 2048,
+            SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |

SPI_NOR_4B_OPCODES) },

Quoted 3 lines
drivers/mtd/spi/spi-nor-ids.c +0 -0
 #endif
      { },
 };