Skip to contentSkip to conversation

mtd: spi-nor: Add support for XMC XM25QH256C / XM25QU256C / XM25QH512C / XM25QU512C site: https://www.xmcwh.com/site/product#

PATCH In review Luke He 4 participants 5 messages Mar 13, 2023

Subsystems (2)
lore
Share & tools
lore

Luke He

author
#0 lore raw

PATCH 1/1 mtd: spi-nor: Add support for XMC XM25QH256C / XM25QU256C / XM25QH512C / XM25QU512C site: https://www.xmcwh.com/site/product#

---
 drivers/mtd/spi-nor/xmc.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/mtd/spi-nor/xmc.c +12 -0
index 051411e86339..6db01b80237f 100644
@@ -16,6 +16,18 @@ static const struct flash_info xmc_nor_parts[] = {
 	{ "XM25QH128A", INFO(0x207018, 0, 64 * 1024, 256)
 		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
 			      SPI_NOR_QUAD_READ) },
+	{ "XM25QH256C", INFO(0x204019, 0, 64 * 1024, 512)
+		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
+			      SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+	{ "XM25QU256C", INFO(0x204119, 0, 64 * 1024, 512)
+		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
+			     SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+	{ "XM25QH512C", INFO(0x204020, 0, 64 * 1024, 1024)
+		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
+			     SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+	{ "XM25QU512C", INFO(0x204120, 0, 64 * 1024, 1024)
+		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
+			     SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }
 };
 
 const struct spi_nor_manufacturer spi_nor_xmc = {
Signature · 1 line
2.17.1
#1 lore raw

Hi,

please have a look at Documentation/process/submitting-patches.rst how to properly format patches. But also see below.

Am 2023-03-13 11:01, schrieb Luke He:

Quoted 15 lines
---
 drivers/mtd/spi-nor/xmc.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/mtd/spi-nor/xmc.c +2 -0
index 051411e86339..6db01b80237f 100644
@@ -16,6 +16,18 @@ static const struct flash_info xmc_nor_parts[] = {
 	{ "XM25QH128A", INFO(0x207018, 0, 64 * 1024, 256)
 		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
 			      SPI_NOR_QUAD_READ) },
+	{ "XM25QH256C", INFO(0x204019, 0, 64 * 1024, 512)
+		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |

drivers/mtd/spi-nor/xmc.c static const struct flash_info xmc_nor_parts[] = { · line 30

Quoted 10 lines
drivers/mtd/spi-nor/xmc.c +10 -0
+			      SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+	{ "XM25QU256C", INFO(0x204119, 0, 64 * 1024, 512)
+		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
+			     SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+	{ "XM25QH512C", INFO(0x204020, 0, 64 * 1024, 1024)
+		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
+			     SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+	{ "XM25QU512C", INFO(0x204120, 0, 64 * 1024, 1024)
+		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
+			     SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }

I've just looked at XM25QH256C [1], but I suspect all of these flashes supports SFDP, therefore you shouldn't use the NO_SFDP_FLAGS. Then, without any additional flags, there is no need for an entry at all, because it should be coverered by the "generic spi-nor" driver [2].

-michael

[1] https://www.xmcwh.com/uploads/198/XM25QH256C_Ver1.8.pdf
[2] https://elixir.bootlin.com/linux/v6.3-rc2/source/drivers/mtd/spi-nor/core.c#L1637

maintainer
#2 lore raw

Hi Michael,

[email protected] wrote on Mon, 13 Mar 2023 11:08:15 +0100:

Quoted 26 lines

Hi,

please have a look at Documentation/process/submitting-patches.rst how to properly format patches. But also see below.

Am 2023-03-13 11:01, schrieb Luke He:

Quoted 20 lines
---
 drivers/mtd/spi-nor/xmc.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/mtd/spi-nor/xmc.c +7 -0
index 051411e86339..6db01b80237f 100644
@@ -16,6 +16,18 @@ static const struct flash_info xmc_nor_parts[] = {
 	{ "XM25QH128A", INFO(0x207018, 0, 64 * 1024, 256)
 		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
 			      SPI_NOR_QUAD_READ) },
+	{ "XM25QH256C", INFO(0x204019, 0, 64 * 1024, 512)
+		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
+			      SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+	{ "XM25QU256C", INFO(0x204119, 0, 64 * 1024, 512)
+		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
+			     SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+	{ "XM25QH512C", INFO(0x204020, 0, 64 * 1024, 1024)
Quoted 8 lines

drivers/mtd/spi-nor/xmc.c static const struct flash_info xmc_nor_parts[] = { · line 30

Quoted 5 lines
drivers/mtd/spi-nor/xmc.c +5 -0
+		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
+			     SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+	{ "XM25QU512C", INFO(0x204120, 0, 64 * 1024, 1024)
+		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
+			     SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }  

I've just looked at XM25QH256C [1], but I suspect all of these flashes supports SFDP, therefore you shouldn't use the NO_SFDP_FLAGS.

I didn't check, do we have a kdoc or something like that which explains what flags to use and when?

Quoted 8 lines

Then, without any additional flags, there is no need for an entry at all, because it should be coverered by the "generic spi-nor" driver [2].

-michael

[1] https://www.xmcwh.com/uploads/198/XM25QH256C_Ver1.8.pdf
[2] https://elixir.bootlin.com/linux/v6.3-rc2/source/drivers/mtd/spi-nor/core.c#L1637

Thanks,
Miquèl

#3 lore raw

Am 2023-03-13 11:33, schrieb Miquel Raynal:

Quoted 39 lines

Hi Michael,

[email protected] wrote on Mon, 13 Mar 2023 11:08:15 +0100:

Quoted 26 lines

Hi,

please have a look at Documentation/process/submitting-patches.rst how to properly format patches. But also see below.

Am 2023-03-13 11:01, schrieb Luke He:

Quoted 20 lines
---
 drivers/mtd/spi-nor/xmc.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/mtd/spi-nor/xmc.c +7 -0
index 051411e86339..6db01b80237f 100644
@@ -16,6 +16,18 @@ static const struct flash_info xmc_nor_parts[] = {
 	{ "XM25QH128A", INFO(0x207018, 0, 64 * 1024, 256)
 		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
 			      SPI_NOR_QUAD_READ) },
+	{ "XM25QH256C", INFO(0x204019, 0, 64 * 1024, 512)
+		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
+			      SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+	{ "XM25QU256C", INFO(0x204119, 0, 64 * 1024, 512)
+		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
+			     SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+	{ "XM25QH512C", INFO(0x204020, 0, 64 * 1024, 1024)
Quoted 8 lines

drivers/mtd/spi-nor/xmc.c static const struct flash_info xmc_nor_parts[] = { · line 30

Quoted 5 lines
drivers/mtd/spi-nor/xmc.c +5 -0
+		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
+			     SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+	{ "XM25QU512C", INFO(0x204120, 0, 64 * 1024, 1024)
+		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
+			     SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }

I've just looked at XM25QH256C [1], but I suspect all of these flashes supports SFDP, therefore you shouldn't use the NO_SFDP_FLAGS.

Quoted 2 lines

I didn't check, do we have a kdoc or something like that which explains what flags to use and when?

https://elixir.bootlin.com/linux/v6.3-rc2/source/drivers/mtd/spi-nor/core.h#L429

What's missing is still some overview document when and how to add a new entry to our database. /me looks in Tudors direction :)

-michael

#4 lore raw
Quoted 40 lines · Michael Walle

Am 2023-03-13 11:33, schrieb Miquel Raynal:

Quoted 39 lines

Hi Michael,

[email protected] wrote on Mon, 13 Mar 2023 11:08:15 +0100:

Quoted 34 lines

Hi,

please have a look at Documentation/process/submitting-patches.rst how to properly format patches. But also see below.

Am 2023-03-13 11:01, schrieb Luke He:

Quoted 17 lines

---
  drivers/mtd/spi-nor/xmc.c | 12 ++++++++++++

  1 file changed, 12 insertions(+)
drivers/mtd/spi-nor/xmc.c +0 -0
index 051411e86339..6db01b80237f 100644
@@ -16,6 +16,18 @@ static const struct flash_info xmc_nor_parts[] = {
       { "XM25QH128A", INFO(0x207018, 0, 64 * 1024, 256)

          NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
+    { "XM25QH256C", INFO(0x204019, 0, 64 * 1024, 512) +        NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | +                  SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }, +    { "XM25QU256C", INFO(0x204119, 0, 64 * 1024, 512)

Quoted 8 lines

+        NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | +                 SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }, +    { "XM25QH512C", INFO(0x204020, 0, 64 * 1024, 1024) +        NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | +                 SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }, +    { "XM25QU512C", INFO(0x204120, 0, 64 * 1024, 1024) +        NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | +                 SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }

I've just looked at XM25QH256C [1], but I suspect all of these flashes supports SFDP, therefore you shouldn't use the NO_SFDP_FLAGS.

Quoted 8 lines
Quoted 2 lines

I didn't check, do we have a kdoc or something like that which explains what flags to use and when?

https://elixir.bootlin.com/linux/v6.3-rc2/source/drivers/mtd/spi-nor/core.h#L429

What's missing is still some overview document when and how to add a new entry to our database. /me looks in Tudors direction :)

Right, the code comments should help. I've been planning to do the documentation, even started it few months ago, but I'm still behind with some patch reviews, including Miquel's, so the documentation has to wait. I'm doing this in my spare time, so I'll stop giving estimates.

Cheers,
ta