Skip to contentSkip to conversation

mtd: spi-nor: gigadevice: Add support for gd25lr256e

PATCH Superseded Mika Westerberg 2 participants 7 messages Sep 22, 2022 – Sep 27, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: spi-nor: gigadevice: Add support for gd25lr256e

Add support for this 32MB serial flash.

---
 drivers/mtd/spi-nor/gigadevice.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mtd/spi-nor/gigadevice.c +4 -0
index 119b38e6fc2a..7a7f5cb67a9e 100644
@@ -57,6 +57,10 @@ static const struct flash_info gigadevice_nor_parts[] = {
 		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6)
 		FIXUP_FLAGS(SPI_NOR_4B_OPCODES)
 		.fixups = &gd25q256_fixups },
+	{ "gd25lr256e", INFO(0xc86719, 0, 64 * 1024, 512)
+		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
+		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
+			      SPI_NOR_QUAD_READ) },
 };
 
 const struct spi_nor_manufacturer spi_nor_gigadevice = {
Signature · 6 lines
2.35.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#1 lore raw

Am 2022-09-22 15:56, schrieb Mika Westerberg:

Quoted 12 lines

Add support for this 32MB serial flash.

---
 drivers/mtd/spi-nor/gigadevice.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mtd/spi-nor/gigadevice.c +0 -0
index 119b38e6fc2a..7a7f5cb67a9e 100644

drivers/mtd/spi-nor/gigadevice.c static const struct flash_info · line 61

Quoted 5 lines
drivers/mtd/spi-nor/gigadevice.c +1 -0
@@ -57,6 +57,10 @@ static const struct flash_info 
 gigadevice_nor_parts[] = {
 		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6)
 		FIXUP_FLAGS(SPI_NOR_4B_OPCODES)
 		.fixups = &gd25q256_fixups },
+	{ "gd25lr256e", INFO(0xc86719, 0, 64 * 1024, 512)

There doesn't seem to be a public datasheet. Does this flash support SFDP?

In that case, please just use

	{ "gd25lr256e", INFO(0xc86719, 0, 0, 0),
		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
		PARSE_SFDP
	}

-michael

Quoted 6 lines
drivers/mtd/spi-nor/gigadevice.c +3 -0
+		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
+		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
+			      SPI_NOR_QUAD_READ) },
 };
 

const struct spi_nor_manufacturer spi_nor_gigadevice = {

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#2 lore raw
Quoted 22 lines · Michael Walle

Am 2022-09-22 15:56, schrieb Mika Westerberg:

Quoted 13 lines

Add support for this 32MB serial flash.

---
 drivers/mtd/spi-nor/gigadevice.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mtd/spi-nor/gigadevice.c +0 -0
index 119b38e6fc2a..7a7f5cb67a9e 100644

drivers/mtd/spi-nor/gigadevice.c static const struct flash_info gigadevice_nor_parts[] · line 61

Quoted 5 lines
drivers/mtd/spi-nor/gigadevice.c +1 -0
@@ -57,6 +57,10 @@ static const struct flash_info gigadevice_nor_parts[]
 = {
 		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6)
 		FIXUP_FLAGS(SPI_NOR_4B_OPCODES)
 		.fixups = &gd25q256_fixups },
+	{ "gd25lr256e", INFO(0xc86719, 0, 64 * 1024, 512)

There doesn't seem to be a public datasheet. Does this flash support SFDP?

Quoted 6 lines

In that case, please just use

	{ "gd25lr256e", INFO(0xc86719, 0, 0, 0),
		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
		PARSE_SFDP
	}

Sure, let me check this one works and update the patch accordinglly.

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#3 lore raw

Hi,

Quoted 23 lines · Mika Westerberg
Quoted 22 lines · Michael Walle

Am 2022-09-22 15:56, schrieb Mika Westerberg:

Quoted 13 lines

Add support for this 32MB serial flash.

---
 drivers/mtd/spi-nor/gigadevice.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mtd/spi-nor/gigadevice.c +0 -0
index 119b38e6fc2a..7a7f5cb67a9e 100644

drivers/mtd/spi-nor/gigadevice.c static const struct flash_info gigadevice_nor_parts[] · line 61

Quoted 5 lines
drivers/mtd/spi-nor/gigadevice.c +1 -0
@@ -57,6 +57,10 @@ static const struct flash_info gigadevice_nor_parts[]
 = {
 		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6)
 		FIXUP_FLAGS(SPI_NOR_4B_OPCODES)
 		.fixups = &gd25q256_fixups },
+	{ "gd25lr256e", INFO(0xc86719, 0, 64 * 1024, 512)

There doesn't seem to be a public datasheet. Does this flash support SFDP?

Quoted 8 lines
Quoted 6 lines

In that case, please just use

	{ "gd25lr256e", INFO(0xc86719, 0, 0, 0),
		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
		PARSE_SFDP
	}

Sure, let me check this one works and update the patch accordinglly.

Tried this now (I did not find the datasheet either anymore) but I get:

spi-nor spi0.0: BFPT parsing failed. Please consider using SPI_NOR_SKIP_SFDP when declaring the flash

So I suspect SFDP is not supported by this chip?

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#4 lore raw

Hi,

Am 2022-09-22 17:11, schrieb Mika Westerberg:

Quoted 31 lines · Mika Westerberg
Quoted 30 lines · Michael Walle
Quoted 28 lines

Am 2022-09-22 15:56, schrieb Mika Westerberg:

Quoted 13 lines

Add support for this 32MB serial flash.

---
 drivers/mtd/spi-nor/gigadevice.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mtd/spi-nor/gigadevice.c +0 -0
index 119b38e6fc2a..7a7f5cb67a9e 100644

drivers/mtd/spi-nor/gigadevice.c static const struct flash_info gigadevice_nor_parts[] · line 61

Quoted 5 lines
drivers/mtd/spi-nor/gigadevice.c +1 -0
@@ -57,6 +57,10 @@ static const struct flash_info gigadevice_nor_parts[]
 = {
 		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6)
 		FIXUP_FLAGS(SPI_NOR_4B_OPCODES)
 		.fixups = &gd25q256_fixups },
+	{ "gd25lr256e", INFO(0xc86719, 0, 64 * 1024, 512)

There doesn't seem to be a public datasheet. Does this flash support SFDP?

In that case, please just use

	{ "gd25lr256e", INFO(0xc86719, 0, 0, 0),
		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
		PARSE_SFDP
	}
Quoted 8 lines
Quoted 1 line

Sure, let me check this one works and update the patch accordinglly.

Tried this now (I did not find the datasheet either anymore) but I get:

spi-nor spi0.0: BFPT parsing failed. Please consider using
SPI_NOR_SKIP_SFDP when declaring the flash

So I suspect SFDP is not supported by this chip?

According to https://www.gigadevice.com/flash-memory/gd25lr256e/
it has SFDP. Could you debug what is going wrong here?

-michael

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#5 lore raw
Quoted 38 lines · Michael Walle

Hi,

Am 2022-09-22 17:11, schrieb Mika Westerberg:

Quoted 35 lines · Mika Westerberg
Quoted 23 lines · Michael Walle
Quoted 22 lines

Am 2022-09-22 15:56, schrieb Mika Westerberg:

Quoted 13 lines

Add support for this 32MB serial flash.

---
 drivers/mtd/spi-nor/gigadevice.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mtd/spi-nor/gigadevice.c +0 -0
index 119b38e6fc2a..7a7f5cb67a9e 100644

drivers/mtd/spi-nor/gigadevice.c static const struct flash_info gigadevice_nor_parts[] · line 61

Quoted 5 lines
drivers/mtd/spi-nor/gigadevice.c +1 -0
@@ -57,6 +57,10 @@ static const struct flash_info gigadevice_nor_parts[]
 = {
 		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6)
 		FIXUP_FLAGS(SPI_NOR_4B_OPCODES)
 		.fixups = &gd25q256_fixups },
+	{ "gd25lr256e", INFO(0xc86719, 0, 64 * 1024, 512)

There doesn't seem to be a public datasheet. Does this flash support SFDP?

Quoted 8 lines
Quoted 6 lines

In that case, please just use

	{ "gd25lr256e", INFO(0xc86719, 0, 0, 0),
		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
		PARSE_SFDP
	}

Sure, let me check this one works and update the patch accordinglly.

Tried this now (I did not find the datasheet either anymore) but I get:

Quoted 7 lines
Quoted 4 lines

spi-nor spi0.0: BFPT parsing failed. Please consider using
SPI_NOR_SKIP_SFDP when declaring the flash

So I suspect SFDP is not supported by this chip?

According to https://www.gigadevice.com/flash-memory/gd25lr256e/
it has SFDP. Could you debug what is going wrong here?

Sure, I'll see if I can figure out why it fails.

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#6 lore raw

Hi,

Quoted 42 lines · Mika Westerberg
Quoted 41 lines · Michael Walle

Hi,

Am 2022-09-22 17:11, schrieb Mika Westerberg:

Quoted 38 lines · Mika Westerberg
Quoted 23 lines · Michael Walle
Quoted 22 lines

Am 2022-09-22 15:56, schrieb Mika Westerberg:

Quoted 13 lines

Add support for this 32MB serial flash.

---
 drivers/mtd/spi-nor/gigadevice.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mtd/spi-nor/gigadevice.c +0 -0
index 119b38e6fc2a..7a7f5cb67a9e 100644

drivers/mtd/spi-nor/gigadevice.c static const struct flash_info gigadevice_nor_parts[] · line 61

Quoted 5 lines
drivers/mtd/spi-nor/gigadevice.c +1 -0
@@ -57,6 +57,10 @@ static const struct flash_info gigadevice_nor_parts[]
 = {
 		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6)
 		FIXUP_FLAGS(SPI_NOR_4B_OPCODES)
 		.fixups = &gd25q256_fixups },
+	{ "gd25lr256e", INFO(0xc86719, 0, 64 * 1024, 512)

There doesn't seem to be a public datasheet. Does this flash support SFDP?

Quoted 8 lines
Quoted 6 lines

In that case, please just use

	{ "gd25lr256e", INFO(0xc86719, 0, 0, 0),
		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
		PARSE_SFDP
	}

Sure, let me check this one works and update the patch accordinglly.

Tried this now (I did not find the datasheet either anymore) but I get:

spi-nor spi0.0: BFPT parsing failed. Please consider using
SPI_NOR_SKIP_SFDP when declaring the flash

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

So I suspect SFDP is not supported by this chip?

According to https://www.gigadevice.com/flash-memory/gd25lr256e/
it has SFDP. Could you debug what is going wrong here?

Sure, I'll see if I can figure out why it fails.

Okay debugged now. It turns out that yes this chip supports SFDP just fine. It is the Intel SPI driver that did not so that's the reason for the failure here.

I will submit v2 of this patch after v6.1-rc1 is released and also send out the patch series adding SFDP support to the Intel SPI driver.

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/