Skip to contentSkip to conversation

mtd: spi-nor: Add GigaDevice GD25LQ16 support

PATCH In review Marek Vasut 2 participants 4 messages Jun 11 – Jun 24 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: spi-nor: Add GigaDevice GD25LQ16 support

From: Alexander Koch <[email protected]>

Add IDs for GigaDevice GD25LQ16 SPI NOR.

---
Cc: Alexander Koch <[email protected]>
Cc: David Lechner <[email protected]>
Cc: Flaviu Nistor <[email protected]>
Cc: Miquel Raynal <[email protected]>
Cc: Takahiro Kuwano <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: Tudor Ambarus <[email protected]>
Cc: Vignesh R <[email protected]>
Cc: [email protected]

---
 drivers/mtd/spi/spi-nor-ids.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/mtd/spi/spi-nor-ids.c +5 -0
index c0fa98424aa..d3a24b51daf 100644
@@ -117,6 +117,11 @@ const struct flash_info spi_nor_ids[] = {
 			SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
 			SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
 	},
+	{
+		INFO("gd25lq16", 0xc86015, 0, 64 * 1024, 32,
+			SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
+			SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
+	},
 	{
 		INFO("gd25q32", 0xc84016, 0, 64 * 1024,  64,
 			SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
Signature · 1 line
2.53.0
#1 lore raw

Hi Marek,

Quoted 26 lines

From: Alexander Koch <[email protected]>

Add IDs for GigaDevice GD25LQ16 SPI NOR.

---
Cc: Alexander Koch <[email protected]>
Cc: David Lechner <[email protected]>
Cc: Flaviu Nistor <[email protected]>
Cc: Miquel Raynal <[email protected]>
Cc: Takahiro Kuwano <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: Tudor Ambarus <[email protected]>
Cc: Vignesh R <[email protected]>
Cc: [email protected]

---
 drivers/mtd/spi/spi-nor-ids.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/mtd/spi/spi-nor-ids.c +0 -0
index c0fa98424aa..d3a24b51daf 100644

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

Quoted 7 lines
drivers/mtd/spi/spi-nor-ids.c +4 -0
@@ -117,6 +117,11 @@ const struct flash_info spi_nor_ids[] = {
                        SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
                        SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
        },
+       {
+               INFO("gd25lq16", 0xc86015, 0, 64 * 1024, 32,
+                       SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
+                       SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)

I could find a datasheet of GD25LQ16E that mentions the same ID (C8 60 15).
https://www.mouser.com/datasheet/2/870/gd25lq16e_datasheet_v1_2_20210108-2399660.pdf?srsltid=AfmBOopEr50lYWZuINw4geNljXqWZxHqvrYc-_HyJi7ISbOc_9RRaiC1

This chip has 4 BP bits (BP3..BP0) + TB (BP4).
The u-boot driver doesn't support 4-bit BP yet so locking feature shouldn't work as expected.

Quoted 6 lines
drivers/mtd/spi/spi-nor-ids.c +1 -1
+       },
        {
                INFO("gd25q32", 0xc84016, 0, 64 * 1024,  64,
                        SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
--

2.53.0

#2 lore raw

On 6/12/26 11:51 AM, [email protected] wrote:

Hello Kuwano-san,

+CC GigaDevice

Quoted 16 lines

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

Quoted 12 lines
drivers/mtd/spi/spi-nor-ids.c +4 -0
index c0fa98424aa..d3a24b51daf 100644
@@ -117,6 +117,11 @@ const struct flash_info spi_nor_ids[] = {
                         SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
                         SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
         },
+       {
+               INFO("gd25lq16", 0xc86015, 0, 64 * 1024, 32,
+                       SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
+                       SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)

I could find a datasheet of GD25LQ16E that mentions the same ID (C8 60 15).
https://www.mouser.com/datasheet/2/870/gd25lq16e_datasheet_v1_2_20210108-2399660.pdf?srsltid=AfmBOopEr50lYWZuINw4geNljXqWZxHqvrYc-_HyJi7ISbOc_9RRaiC1

Quoted 3 lines

This chip has 4 BP bits (BP3..BP0) + TB (BP4).
The u-boot driver doesn't support 4-bit BP yet so locking feature shouldn't work as expected.

That is a good point.

I had a brief look at it, and it looks like it would be possible to pick a couple of kernel patches to support the various SR topologies, I created a test branch [1] with those patches. Do you think this is a workable approach ?

[1] https://source.denx.de/u-boot/custodians/u-boot-usb/-/commits/spi-nor-4bit-sr

Signature · 2 lines
Best regards,
Marek Vasut
#3 lore raw

Hello Marek,

Quoted 28 lines · On 6/12/26 11:51 AM, [email protected] wrote:

Hello Kuwano-san,

+CC GigaDevice

Quoted 7 lines
Quoted 7 lines
drivers/mtd/spi/spi-nor-ids.c +0 -0
index c0fa98424aa..d3a24b51daf 100644
@@ -117,6 +117,11 @@ const struct flash_info spi_nor_ids[] = {
                         SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
                         SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
Quoted 8 lines

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

Quoted 5 lines
drivers/mtd/spi/spi-nor-ids.c +4 -0
         },
+       {
+               INFO("gd25lq16", 0xc86015, 0, 64 * 1024, 32,
+                       SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
+                       SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)

I could find a datasheet of GD25LQ16E that mentions the same ID (C8 60 15).
https://www.mouser.com/datasheet/2/870/gd25lq16e_datasheet_v1_2_20210108-

2399660.pdf?srsltid=AfmBOopEr50lYWZuINw4geNljXqWZxHqvrYc-_HyJi7ISbOc_9RRaiC1

Quoted 4 lines

This chip has 4 BP bits (BP3..BP0) + TB (BP4).
The u-boot driver doesn't support 4-bit BP yet so locking feature shouldn't work as expected.

Quoted 7 lines

That is a good point.

I had a brief look at it, and it looks like it would be possible to pick a couple of kernel patches to support the various SR topologies, I created a test branch [1] with those patches. Do you think this is a workable approach ?

Yes, I think it's definitely workable. Good to know we already have a set of working patches. At the same time, we should split the protection logics from core like Linux (i.e., mtd/spi-nor/swp.c). Is this also something you can assist with?

In a series [2], I split ID tables and SFDP, but not for protection.

Quoted 6 lines

[1]
https://source.denx.de/u-boot/custodians/u-boot-usb/-/commits/spi-nor-4bit-sr

--
Best regards,
Marek Vasut

Thanks!
Takahiro

[2]
https://lore.kernel.org/u-boot/20260612-split-id-table-into-vendor-files-v1-0-dfaaa82cc6f0@infineon.com/