Skip to contentSkip to conversation

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

PATCH In review Md Sadre Alam 4 participants 6 messages Feb 9, 2021 – Jul 18, 2023

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

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

Add support for gd25lb256e. This device tested on IPQ5018 platform with dd from/to the flash for read/write respectly, and mtd erase for erasing the flash.

---
 drivers/mtd/spi-nor/gigadevice.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/mtd/spi-nor/gigadevice.c +3 -0
index 447d84b..8f1e7ec 100644
@@ -50,6 +50,9 @@ static const struct flash_info gigadevice_parts[] = {
 			   SPI_NOR_4B_OPCODES | SPI_NOR_HAS_LOCK |
 			   SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6)
 		.fixups = &gd25q256_fixups },
+	{ "gd25lb256e", INFO(0xc86719, 0, 64 * 1024, 512,
+			  SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
+			  SPI_NOR_4B_OPCODES) },
 };
 
 const struct spi_nor_manufacturer spi_nor_gigadevice = {
Signature · 6 lines
2.7.4


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#1 lore raw
Quoted 14 lines · Md Sadre Alam

Add support for gd25lb256e. This device tested on IPQ5018 platform with dd from/to the flash for read/write respectly, and mtd erase for erasing the flash.

---
 drivers/mtd/spi-nor/gigadevice.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/mtd/spi-nor/gigadevice.c +0 -0
index 447d84b..8f1e7ec 100644

drivers/mtd/spi-nor/gigadevice.c static const struct flash_info gigadevice_parts[] = { · line 58

Quoted 9 lines
drivers/mtd/spi-nor/gigadevice.c +3 -0
@@ -50,6 +50,9 @@ static const struct flash_info gigadevice_parts[] = {
 			   SPI_NOR_4B_OPCODES | SPI_NOR_HAS_LOCK |
 			   SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6)
 		.fixups = &gd25q256_fixups },
+	{ "gd25lb256e", INFO(0xc86719, 0, 64 * 1024, 512,
+			  SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
+			  SPI_NOR_4B_OPCODES) },
 };
 
 const struct spi_nor_manufacturer spi_nor_gigadevice = {

ping! Is there any additional info needed for this ?

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

#2 lore raw

Hi,

Quoted 26 lines · On 2/16/21 5:10 PM, [email protected] wrote:

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Quoted 23 lines · Md Sadre Alam

Add support for gd25lb256e. This device tested on IPQ5018 platform with dd from/to the flash for read/write respectly, and mtd erase for erasing the flash.

---
 drivers/mtd/spi-nor/gigadevice.c | 3 +++

 1 file changed, 3 insertions(+)
drivers/mtd/spi-nor/gigadevice.c +0 -0
index 447d84b..8f1e7ec 100644
@@ -50,6 +50,9 @@ static const struct flash_info gigadevice_parts[] = {

                         SPI_NOR_4B_OPCODES | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6) .fixups = &gd25q256_fixups },
+     { "gd25lb256e", INFO(0xc86719, 0, 64 * 1024, 512,
+                       SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | +                       SPI_NOR_4B_OPCODES) },
 };

Quoted 3 lines
Quoted 1 line

 const struct spi_nor_manufacturer spi_nor_gigadevice = {

ping! Is there any additional info needed for this ?

No other info needed, just time to review it. Please stop sending free pings, every patch will be reviewed.

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

#3 lore raw
In reply to Md Sadre Alam
Quoted 4 lines · Md Sadre Alam

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Add support for gd25lb256e. This device tested on IPQ5018 platform with dd from/to the flash for read/write respectly,

typo: respectly

Quoted 12 lines

and mtd erase for erasing the flash.

---
 drivers/mtd/spi-nor/gigadevice.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/mtd/spi-nor/gigadevice.c +0 -0
index 447d84b..8f1e7ec 100644

drivers/mtd/spi-nor/gigadevice.c static const struct flash_info gigadevice_parts[] = { · line 55

Quoted 6 lines
drivers/mtd/spi-nor/gigadevice.c +3 -0
@@ -50,6 +50,9 @@ static const struct flash_info gigadevice_parts[] = {
                           SPI_NOR_4B_OPCODES | SPI_NOR_HAS_LOCK |
                           SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6)
                .fixups = &gd25q256_fixups },
+       { "gd25lb256e", INFO(0xc86719, 0, 64 * 1024, 512,
+                         SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
+                         SPI_NOR_4B_OPCODES) },

The flash doesn't have support for 0x3b command, you can't add the SPI_NOR_DUAL_READ flag.

I see that the flash name contains info about the generation of the flash. Is the generation differentiated by a different device ID? If not, we can strip the "e" from the flash name.

Looks like the flash has support for BP0-3 protection. You can try to add the flash locking flags and test the support with mtd-utils, if you're interested in this kind of support.

Cheers,
ta

Quoted 6 lines
drivers/mtd/spi-nor/gigadevice.c +0 -1
 };
 
 const struct spi_nor_manufacturer spi_nor_gigadevice = {
--

2.7.4

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

#4 lore raw

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

In reply to Md Sadre Alam
---
 drivers/mtd/spi-nor/gigadevice.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mtd/spi-nor/gigadevice.c +4 -0
index d57ddaf1525b..d56c1876549f 100644
@@ -62,6 +62,10 @@ static const struct flash_info gigadevice_nor_parts[] = {
 		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
 		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
 			      SPI_NOR_QUAD_READ) },
+	{ "gd25lb256", INFO(0xc86719, 0, 64 * 1024, 512)
+		PARSE_SFDP
+		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6)
+		FIXUP_FLAGS(SPI_NOR_4B_OPCODES) },
 	{ "gd25q256", INFO(0xc84019, 0, 64 * 1024, 512)
 		PARSE_SFDP
 		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6)
Signature · 1 line
2.34.1
#5 lore raw

Re: [PATCH v2] mtd: spi-nor: gigadevice: Add support for gd25lb256

Hi!

On 13.06.2023 07:53, Hao Yao wrote:

You need some commit message here describing your changes. Please read
https://www.kernel.org/doc/html/latest/process/submitting-patches.html
before submitting v3.

We require contributors that submit flash additions or updates to dump the SFDP tables and do some sanity checks. Here's an example on how to do it:
https://lore.kernel.org/linux-mtd/[email protected]/

Quoted 10 lines
---
 drivers/mtd/spi-nor/gigadevice.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mtd/spi-nor/gigadevice.c +0 -0
index d57ddaf1525b..d56c1876549f 100644

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

Quoted 4 lines
drivers/mtd/spi-nor/gigadevice.c +1 -0
@@ -62,6 +62,10 @@ static const struct flash_info gigadevice_nor_parts[] = {
 		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
 		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
 			      SPI_NOR_QUAD_READ) },
+	{ "gd25lb256", INFO(0xc86719, 0, 64 * 1024, 512)

INFO(0xc86719, 0, 0, 0) please, those params can be retrieved at SFDP parsing time.

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

Quoted 3 lines
drivers/mtd/spi-nor/gigadevice.c +3 -0
+		PARSE_SFDP
+		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6)
+		FIXUP_FLAGS(SPI_NOR_4B_OPCODES) },

Is the SPI_NOR_4B_OPCODES really needed, isn't the support determined at SFDP parsing time?

Quoted 3 lines
drivers/mtd/spi-nor/gigadevice.c +0 -0
 	{ "gd25q256", INFO(0xc84019, 0, 64 * 1024, 512)
 		PARSE_SFDP
 		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6)