Skip to contentSkip to conversation

spi-nor: spi-nor-ids: Fix 4 Byte addressing for n25q*

PATCH New Vignesh Raghavendra 2 participants 8 messages Oct 11, 2019 – Oct 23, 2019 Memory technology devices (MTD)

lore
Share & tools
lore

Vignesh Raghavendra

author maintainer
#0 lore raw

v3 cover spi-nor: spi-nor-ids: Fix 4 Byte addressing for n25q*

n25q variants do not support stateless 4 byte addressing opcodes by default, therefore first patch disables this flag for those parts. Second patch adds entries for mt25q variants which are similar to n25q but supports stateless 4 byte opcodes. Third patch adds USE_FSR flag for mt25q* and n25q* variants where missing

Changes since v2:
Add USE_FSR flags to all flash variants where missing Collect T-bys and R-bys
Reword commit msgs as necessary

Changes since v1:
Rename newer variants as mt25*
Add a patch to enable flag register parsing for mt25qu512a

Vignesh Raghavendra (3):
spi-nor: spi-nor-ids: Disable SPI_NOR_4B_OPCODES for n25q512* and

    n25q256*

spi-nor: spi-nor-ids: Add entries for mt25q variants
spi-nor: spi-nor-ids: Add USE_FSR flag for mt25q* and n25q* entry

 drivers/mtd/spi/spi-nor-ids.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
Signature · 1 line
2.23.0
author maintainer
#1 lore raw

PATCH v3 1/3 spi-nor: spi-nor-ids: Disable SPI_NOR_4B_OPCODES for n25q512* and n25q256*

Per datasheets of n25q256* and n25q512* not all variants of n25q256* and n25q512* support 4 Byte stateless addressing opcodes. Therefore drop SPI_NOR_4B_OPCODES flag from these entries

---
 drivers/mtd/spi/spi-nor-ids.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/mtd/spi/spi-nor-ids.c +4 -4
index cdb620205866..28a47b2f4428 100644
@@ -161,12 +161,12 @@ const struct flash_info spi_nor_ids[] = {
 	{ INFO("n25q064a",    0x20bb17, 0, 64 * 1024,  128, SECT_4K | SPI_NOR_QUAD_READ) },
 	{ INFO("n25q128a11",  0x20bb18, 0, 64 * 1024,  256, SECT_4K | SPI_NOR_QUAD_READ) },
 	{ INFO("n25q128a13",  0x20ba18, 0, 64 * 1024,  256, SECT_4K | SPI_NOR_QUAD_READ) },
-	{ INFO("n25q256a",    0x20ba19, 0, 64 * 1024,  512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
-	{ INFO("n25q256ax1",  0x20bb19, 0, 64 * 1024,  512, SECT_4K | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+	{ INFO("n25q256a",    0x20ba19, 0, 64 * 1024,  512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
+	{ INFO("n25q256ax1",  0x20bb19, 0, 64 * 1024,  512, SECT_4K | SPI_NOR_QUAD_READ) },
 	{ INFO6("mt25qu512a",  0x20bb20, 0x104400, 64 * 1024, 1024,
 		 SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
-	{ INFO("n25q512a",    0x20bb20, 0, 64 * 1024, 1024, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
-	{ INFO("n25q512ax3",  0x20ba20, 0, 64 * 1024, 1024, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+	{ INFO("n25q512a",    0x20bb20, 0, 64 * 1024, 1024, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ) },
+	{ INFO("n25q512ax3",  0x20ba20, 0, 64 * 1024, 1024, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ) },
 	{ INFO("n25q00",      0x20ba21, 0, 64 * 1024, 2048, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ | NO_CHIP_ERASE) },
 	{ INFO("n25q00a",     0x20bb21, 0, 64 * 1024, 2048, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ | NO_CHIP_ERASE) },
 	{ INFO("mt25qu02g",   0x20bb22, 0, 64 * 1024, 4096, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ | NO_CHIP_ERASE) },
Signature · 1 line
2.23.0
author maintainer
#2 lore raw

PATCH v3 2/3 spi-nor: spi-nor-ids: Add entries for mt25q variants

In reply to Vignesh Raghavendra

mt25q* flashes support stateless 4 byte addressing opcodes. Add entries for the same. These flashes have bit 6 set in 5th byte of READ ID response when compared to n25q* variants.

---
 drivers/mtd/spi/spi-nor-ids.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/mtd/spi/spi-nor-ids.c +3 -0
index 28a47b2f4428..28ffe9de0d72 100644
@@ -161,11 +161,14 @@ const struct flash_info spi_nor_ids[] = {
 	{ INFO("n25q064a",    0x20bb17, 0, 64 * 1024,  128, SECT_4K | SPI_NOR_QUAD_READ) },
 	{ INFO("n25q128a11",  0x20bb18, 0, 64 * 1024,  256, SECT_4K | SPI_NOR_QUAD_READ) },
 	{ INFO("n25q128a13",  0x20ba18, 0, 64 * 1024,  256, SECT_4K | SPI_NOR_QUAD_READ) },
+	{ INFO6("mt25ql256a",    0x20ba19, 0x104400, 64 * 1024,  512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
 	{ INFO("n25q256a",    0x20ba19, 0, 64 * 1024,  512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
+	{ INFO6("mt25qu256a",  0x20bb19, 0x104400, 64 * 1024,  512, SECT_4K | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
 	{ INFO("n25q256ax1",  0x20bb19, 0, 64 * 1024,  512, SECT_4K | SPI_NOR_QUAD_READ) },
 	{ INFO6("mt25qu512a",  0x20bb20, 0x104400, 64 * 1024, 1024,
 		 SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
 	{ INFO("n25q512a",    0x20bb20, 0, 64 * 1024, 1024, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ) },
+	{ INFO6("mt25ql512a",  0x20ba20, 0x104400, 64 * 1024, 1024, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
 	{ INFO("n25q512ax3",  0x20ba20, 0, 64 * 1024, 1024, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ) },
 	{ INFO("n25q00",      0x20ba21, 0, 64 * 1024, 2048, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ | NO_CHIP_ERASE) },
 	{ INFO("n25q00a",     0x20bb21, 0, 64 * 1024, 2048, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ | NO_CHIP_ERASE) },
Signature · 1 line
2.23.0
author maintainer
#3 lore raw

PATCH v3 3/3 spi-nor: spi-nor-ids: Add USE_FSR flag for mt25q* and n25q* entry

In reply to Vignesh Raghavendra

n25q* and mt25q* (both 256Mb and 512Mb) flashes support Flag status register that indicates various errors that may be encountered during erase/write operations. Therefore add USE_FSR flag wherever missing.

---
 drivers/mtd/spi/spi-nor-ids.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/mtd/spi/spi-nor-ids.c +6 -5
index 28ffe9de0d72..370739670cd4 100644
@@ -161,12 +161,13 @@ const struct flash_info spi_nor_ids[] = {
 	{ INFO("n25q064a",    0x20bb17, 0, 64 * 1024,  128, SECT_4K | SPI_NOR_QUAD_READ) },
 	{ INFO("n25q128a11",  0x20bb18, 0, 64 * 1024,  256, SECT_4K | SPI_NOR_QUAD_READ) },
 	{ INFO("n25q128a13",  0x20ba18, 0, 64 * 1024,  256, SECT_4K | SPI_NOR_QUAD_READ) },
-	{ INFO6("mt25ql256a",    0x20ba19, 0x104400, 64 * 1024,  512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
-	{ INFO("n25q256a",    0x20ba19, 0, 64 * 1024,  512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
-	{ INFO6("mt25qu256a",  0x20bb19, 0x104400, 64 * 1024,  512, SECT_4K | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
-	{ INFO("n25q256ax1",  0x20bb19, 0, 64 * 1024,  512, SECT_4K | SPI_NOR_QUAD_READ) },
+	{ INFO6("mt25ql256a",    0x20ba19, 0x104400, 64 * 1024,  512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES | USE_FSR) },
+	{ INFO("n25q256a",    0x20ba19, 0, 64 * 1024,  512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_FSR) },
+	{ INFO6("mt25qu256a",  0x20bb19, 0x104400, 64 * 1024,  512, SECT_4K | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES | USE_FSR) },
+	{ INFO("n25q256ax1",  0x20bb19, 0, 64 * 1024,  512, SECT_4K | SPI_NOR_QUAD_READ | USE_FSR) },
 	{ INFO6("mt25qu512a",  0x20bb20, 0x104400, 64 * 1024, 1024,
-		 SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+		 SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES |
+		 USE_FSR) },
 	{ INFO("n25q512a",    0x20bb20, 0, 64 * 1024, 1024, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ) },
 	{ INFO6("mt25ql512a",  0x20ba20, 0x104400, 64 * 1024, 1024, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
 	{ INFO("n25q512ax3",  0x20ba20, 0, 64 * 1024, 1024, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ) },
Signature · 1 line
2.23.0
#4 lore raw

PATCH v3 3/3 spi-nor: spi-nor-ids: Add USE_FSR flag for mt25q* and n25q* entry

Hi Vignesh,

Quoted 4 lines · Vignesh Raghavendra

n25q* and mt25q* (both 256Mb and 512Mb) flashes support Flag status register that indicates various errors that may be encountered during erase/write operations. Therefore add USE_FSR flag wherever missing.

Does 256Mb require FSR? I remember Micron die is created after 512Mb where it creates die between two 256Mb on 512Mb flash. Indeed die switching would require FSR.

author maintainer
#5 lore raw

PATCH v3 3/3 spi-nor: spi-nor-ids: Add USE_FSR flag for mt25q* and n25q* entry

Hi Jagan,

Quoted 4 lines · Jagan Teki

Hi Vignesh,

Quoted 1 line · Vignesh Raghavendra
Quoted 8 lines
Quoted 3 lines

n25q* and mt25q* (both 256Mb and 512Mb) flashes support Flag status register that indicates various errors that may be encountered during erase/write operations. Therefore add USE_FSR flag wherever missing.

Does 256Mb require FSR? I remember Micron die is created after 512Mb where it creates die between two 256Mb on 512Mb flash. Indeed die switching would require FSR.

Flag Status Register(FSR) is not for switching die but for looking up and printing out reason for write/erase failure. And yes 256Mb part does support FSR. See datasheet at:
https://www.micron.com/-/media/client/global/documents/products/data-sheet/nor-flash/serial-nor/n25q/n25q_256mb_1_8v.pdf
Table 17: Flag Status Register Bit Definition

https://www.mouser.com/datasheet/2/671/MT25Q_QLJS_U_256_ABA_0-1387271.pdf
Table 5: Flag Status Register

Signature · 2 lines
Regards
Vignesh
#6 lore raw

PATCH v3 3/3 spi-nor: spi-nor-ids: Add USE_FSR flag for mt25q* and n25q* entry

Quoted 17 lines · Vignesh Raghavendra

Hi Jagan,

Quoted 4 lines · Jagan Teki

Hi Vignesh,

Quoted 1 line · Vignesh Raghavendra
Quoted 8 lines
Quoted 3 lines

n25q* and mt25q* (both 256Mb and 512Mb) flashes support Flag status register that indicates various errors that may be encountered during erase/write operations. Therefore add USE_FSR flag wherever missing.

Does 256Mb require FSR? I remember Micron die is created after 512Mb where it creates die between two 256Mb on 512Mb flash. Indeed die switching would require FSR.

Quoted 8 lines

Flag Status Register(FSR) is not for switching die but for looking up and printing out reason for write/erase failure. And yes 256Mb part does support FSR. See datasheet at:
https://www.micron.com/-/media/client/global/documents/products/data-sheet/nor-flash/serial-nor/n25q/n25q_256mb_1_8v.pdf
Table 17: Flag Status Register Bit Definition

https://www.mouser.com/datasheet/2/671/MT25Q_QLJS_U_256_ABA_0-1387271.pdf
Table 5: Flag Status Register

Yes, I have seen these. I remember it wasn't require FSR when I did a test on zynq qspi last time. may be it can't consistent between all IP's

#7 lore raw

v3 cover spi-nor: spi-nor-ids: Fix 4 Byte addressing for n25q*

In reply to Vignesh Raghavendra
Quoted 16 lines · Vignesh Raghavendra

n25q variants do not support stateless 4 byte addressing opcodes by default, therefore first patch disables this flag for those parts. Second patch adds entries for mt25q variants which are similar to n25q but supports stateless 4 byte opcodes. Third patch adds USE_FSR flag for mt25q* and n25q* variants where missing

Changes since v2:
Add USE_FSR flags to all flash variants where missing Collect T-bys and R-bys
Reword commit msgs as necessary

Changes since v1:
Rename newer variants as mt25*
Add a patch to enable flag register parsing for mt25qu512a

Quoted 5 lines

Vignesh Raghavendra (3):
spi-nor: spi-nor-ids: Disable SPI_NOR_4B_OPCODES for n25q512* and

    n25q256*

spi-nor: spi-nor-ids: Add entries for mt25q variants
spi-nor: spi-nor-ids: Add USE_FSR flag for mt25q* and n25q* entry

Applied to u-boot-spi/master