Skip to contentSkip to conversation

Add support for more XMC series

PATCH In review SSunk 2 participants 7 messages Aug 12, 2023 – Aug 31, 2023 Memory technology devices (MTD)

lore
Share & tools
lore

SSunk

author
#0 lore raw

PATCH 1/1 Add support for more XMC series

Add XMC XM25QH256C/XM25QU256C/XM25QH512C/XM25QU512C
site: https://www.xmcwh.com/site/product

---
 configs/evb-ast2600_defconfig | 1 +
 drivers/mtd/spi/spi-nor-ids.c | 4 ++++
 2 files changed, 5 insertions(+)
configs/evb-ast2600_defconfig +1 -0
index 9244654c82..f06c0e1fe1 100644
@@ -100,6 +100,7 @@ CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_SPI_FLASH_XMC=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHY_REALTEK=y
 CONFIG_PHY_NCSI=y
drivers/mtd/spi/spi-nor-ids.c +4 -0
index 4587215984..80d7678293 100644
@@ -531,6 +531,10 @@ const struct flash_info spi_nor_ids[] = {
 	{ INFO("XM25QH64A", 0x207017, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
 	{ INFO("XM25QH64C", 0x204017, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
 	{ INFO("XM25QH128A", 0x207018, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
+	{ INFO("XM25QH256C", 0x204019, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+	{ INFO("XM25QU256C", 0x204119, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+	{ INFO("XM25QH512C", 0x204020, 0, 64 * 1024, 1024, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+	{ INFO("XM25QU512C", 0x204120, 0, 64 * 1024, 1024, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
 #endif
 #ifdef CONFIG_SPI_FLASH_XTX
 	/* XTX Technology Limited */
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · SSunk

Add XMC XM25QH256C/XM25QU256C/XM25QH512C/XM25QU512C
site: https://www.xmcwh.com/site/product

---
 configs/evb-ast2600_defconfig | 1 +
 drivers/mtd/spi/spi-nor-ids.c | 4 ++++
 2 files changed, 5 insertions(+)

I think this is v2 so it should have that as well as a change list. You can use 'patman' to help with this.

Regards,
Simon

Quoted 31 lines
configs/evb-ast2600_defconfig +1 -0
index 9244654c82..f06c0e1fe1 100644
@@ -100,6 +100,7 @@ CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_SPI_FLASH_XMC=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHY_REALTEK=y
 CONFIG_PHY_NCSI=y
drivers/mtd/spi/spi-nor-ids.c +4 -1
index 4587215984..80d7678293 100644
@@ -531,6 +531,10 @@ const struct flash_info spi_nor_ids[] = {
        { INFO("XM25QH64A", 0x207017, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
        { INFO("XM25QH64C", 0x204017, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
        { INFO("XM25QH128A", 0x207018, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
+       { INFO("XM25QH256C", 0x204019, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+       { INFO("XM25QU256C", 0x204119, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+       { INFO("XM25QH512C", 0x204020, 0, 64 * 1024, 1024, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+       { INFO("XM25QU512C", 0x204120, 0, 64 * 1024, 1024, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
 #endif
 #ifdef CONFIG_SPI_FLASH_XTX
        /* XTX Technology Limited */
--

2.34.1

author
#2 lore raw

Hi Simon,
I'm not quite sure what you mean by v2, if it's the previous email, it only removes the XM25QH128C part of the commit message compared to the previous one.

Thanks,
SSunk

Quoted 62 lines · Simon Glass <[email protected]> 于2023年8月13日周日 21:36写道:
Quoted 9 lines · SSunk

Add XMC XM25QH256C/XM25QU256C/XM25QH512C/XM25QU512C
site: https://www.xmcwh.com/site/product

---
 configs/evb-ast2600_defconfig | 1 +
 drivers/mtd/spi/spi-nor-ids.c | 4 ++++
 2 files changed, 5 insertions(+)

I think this is v2 so it should have that as well as a change list. You can use 'patman' to help with this.

Regards,
Simon

Review

Quoted 2 lines
(quoted diff) +0 -0

b/configs/evb-ast2600_defconfig

Review

Quoted 12 lines

index 9244654c82..f06c0e1fe1 100644

configs/evb-ast2600_defconfig +1 -0
@@ -100,6 +100,7 @@ CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_SPI_FLASH_XMC=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHY_REALTEK=y
 CONFIG_PHY_NCSI=y
(quoted diff) +0 -0

b/drivers/mtd/spi/spi-nor-ids.c

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

Quoted 5 lines

index 4587215984..80d7678293 100644

drivers/mtd/spi/spi-nor-ids.c +0 -0
@@ -531,6 +531,10 @@ const struct flash_info spi_nor_ids[] = {
        { INFO("XM25QH64A", 0x207017, 0, 64 * 1024, 128, SECT_4K |

SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },

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

Quoted 1 line
drivers/mtd/spi/spi-nor-ids.c +0 -0
        { INFO("XM25QH64C", 0x204017, 0, 64 * 1024, 128, SECT_4K |

SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },

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

Quoted 1 line
drivers/mtd/spi/spi-nor-ids.c +0 -0
        { INFO("XM25QH128A", 0x207018, 0, 64 * 1024, 256, SECT_4K |

SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },

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

Quoted 1 line
drivers/mtd/spi/spi-nor-ids.c +1 -0
+       { INFO("XM25QH256C", 0x204019, 0, 64 * 1024, 512, SECT_4K |

SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },

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

Quoted 1 line
drivers/mtd/spi/spi-nor-ids.c +1 -0
+       { INFO("XM25QU256C", 0x204119, 0, 64 * 1024, 512, SECT_4K |

SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },

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

Quoted 1 line
drivers/mtd/spi/spi-nor-ids.c +1 -0
+       { INFO("XM25QH512C", 0x204020, 0, 64 * 1024, 1024, SECT_4K |

SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },

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

Quoted 1 line
drivers/mtd/spi/spi-nor-ids.c +1 -0
+       { INFO("XM25QU512C", 0x204120, 0, 64 * 1024, 1024, SECT_4K |

SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },

Quoted 6 lines
drivers/mtd/spi/spi-nor-ids.c +0 -1
 #endif
 #ifdef CONFIG_SPI_FLASH_XTX
        /* XTX Technology Limited */
--

2.34.1

#3 lore raw

Hi,

Quoted 4 lines · Clus Tom

Hi Simon,
I'm not quite sure what you mean by v2, if it's the previous email, it only removes the XM25QH128C part of the commit message compared to the previous one.

Right, so it is v2.

Your emails seem to have generated 3 patches:

https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

The version number helps the maintainer figure out which one to apply.

Regards,
Simon

- Simon

Quoted 57 lines

Thanks,
SSunk

Quoted 53 lines · Simon Glass <[email protected]> 于2023年8月13日周日 21:36写道:
Quoted 9 lines · SSunk

Add XMC XM25QH256C/XM25QU256C/XM25QH512C/XM25QU512C
site: https://www.xmcwh.com/site/product

---
 configs/evb-ast2600_defconfig | 1 +
 drivers/mtd/spi/spi-nor-ids.c | 4 ++++
 2 files changed, 5 insertions(+)

I think this is v2 so it should have that as well as a change list. You can use 'patman' to help with this.

Regards,
Simon

Quoted 31 lines
configs/evb-ast2600_defconfig +1 -0
index 9244654c82..f06c0e1fe1 100644
@@ -100,6 +100,7 @@ CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_SPI_FLASH_XMC=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHY_REALTEK=y
 CONFIG_PHY_NCSI=y
drivers/mtd/spi/spi-nor-ids.c +4 -1
index 4587215984..80d7678293 100644
@@ -531,6 +531,10 @@ const struct flash_info spi_nor_ids[] = {
        { INFO("XM25QH64A", 0x207017, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
        { INFO("XM25QH64C", 0x204017, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
        { INFO("XM25QH128A", 0x207018, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
+       { INFO("XM25QH256C", 0x204019, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+       { INFO("XM25QU256C", 0x204119, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+       { INFO("XM25QH512C", 0x204020, 0, 64 * 1024, 1024, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
+       { INFO("XM25QU512C", 0x204120, 0, 64 * 1024, 1024, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
 #endif
 #ifdef CONFIG_SPI_FLASH_XTX
        /* XTX Technology Limited */
--

2.34.1

author
#4 lore raw

Hi Simon,
I just want to apply:
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]

Thanks,
SSunk

Quoted 100 lines · Simon Glass <[email protected]> 于2023年8月15日周二 06:43写道:

Hi,

Quoted 3 lines · Clus Tom

Hi Simon,
I'm not quite sure what you mean by v2, if it's the previous email, it

only removes the XM25QH128C part of the commit message compared to the previous one.

Quoted 1 line

Right, so it is v2.

Your emails seem to have generated 3 patches:

https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

The version number helps the maintainer figure out which one to apply.

Regards,
Simon

- Simon

Quoted 21 lines

Thanks,
SSunk

Quoted 17 lines · Simon Glass <[email protected]> 于2023年8月13日周日 21:36写道:
Quoted 9 lines · SSunk

Add XMC XM25QH256C/XM25QU256C/XM25QH512C/XM25QU512C
site: https://www.xmcwh.com/site/product

---
 configs/evb-ast2600_defconfig | 1 +
 drivers/mtd/spi/spi-nor-ids.c | 4 ++++
 2 files changed, 5 insertions(+)

I think this is v2 so it should have that as well as a change list. You can use 'patman' to help with this.

Quoted 7 lines
Quoted 7 lines

Regards,
Simon

Review

Quoted 2 lines
(quoted diff) +0 -0

b/configs/evb-ast2600_defconfig

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

index 9244654c82..f06c0e1fe1 100644

configs/evb-ast2600_defconfig +0 -0
@@ -100,6 +100,7 @@ CONFIG_SPI_FLASH_SPANSION=y
Quoted 8 lines
Quoted 8 lines

Review

Quoted 8 lines
configs/evb-ast2600_defconfig +1 -0
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_SPI_FLASH_XMC=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHY_REALTEK=y
 CONFIG_PHY_NCSI=y
(quoted diff) +0 -0

b/drivers/mtd/spi/spi-nor-ids.c

Quoted 5 lines
Quoted 5 lines

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

Quoted 5 lines

index 4587215984..80d7678293 100644

drivers/mtd/spi/spi-nor-ids.c +0 -0
@@ -531,6 +531,10 @@ const struct flash_info spi_nor_ids[] = {
        { INFO("XM25QH64A", 0x207017, 0, 64 * 1024, 128, SECT_4K |

SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },

Quoted 1 line
Quoted 1 line

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

Quoted 1 line
drivers/mtd/spi/spi-nor-ids.c +0 -0
        { INFO("XM25QH64C", 0x204017, 0, 64 * 1024, 128, SECT_4K |

SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },

Quoted 1 line
Quoted 1 line

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

Quoted 1 line
drivers/mtd/spi/spi-nor-ids.c +0 -0
        { INFO("XM25QH128A", 0x207018, 0, 64 * 1024, 256, SECT_4K |

SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },

Quoted 1 line
Quoted 1 line

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

Quoted 1 line
drivers/mtd/spi/spi-nor-ids.c +1 -0
+       { INFO("XM25QH256C", 0x204019, 0, 64 * 1024, 512, SECT_4K |

SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },

Quoted 1 line
Quoted 1 line

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

Quoted 1 line
drivers/mtd/spi/spi-nor-ids.c +1 -0
+       { INFO("XM25QU256C", 0x204119, 0, 64 * 1024, 512, SECT_4K |

SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },

Quoted 1 line
Quoted 1 line

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

Quoted 1 line
drivers/mtd/spi/spi-nor-ids.c +1 -0
+       { INFO("XM25QH512C", 0x204020, 0, 64 * 1024, 1024, SECT_4K |

SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },

Quoted 1 line
Quoted 1 line

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

Quoted 1 line
drivers/mtd/spi/spi-nor-ids.c +1 -0
+       { INFO("XM25QU512C", 0x204120, 0, 64 * 1024, 1024, SECT_4K |

SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
drivers/mtd/spi/spi-nor-ids.c +0 -1
 #endif
 #ifdef CONFIG_SPI_FLASH_XTX
        /* XTX Technology Limited */
--

2.34.1

author
#5 lore raw
Quoted 48 lines

Hi Michael,
Since this is the first time I've submitted code to the Linux community, please forgive me for some of the missteps that I've made. I uploaded the incorrect patch file.
In a previous e-mail you said:
XMC parts seem to have SFDP tables and they should work out of the box
without any patches with the generic spi nor driver [1]. Therefore,
you don't need any entry at all.

I think it is related to the PARSE_SFDP flag.
The XMC flash part supports SFDP, so i don’t need to add NO_SFDP_FLAGS() macro. drivers/mtd/spi-nor/xmc.c | 17 +++++++++++++----

1 file changed, 13 insertions(+), 4 deletions(-)
drivers/mtd/spi-nor/xmc.c +13 -4
index 051411e86339..e78bf11792d9 100644
@@ -11,11 +11,20 @@
 static const struct flash_info xmc_nor_parts[] = {
 	/* XMC (Wuhan Xinxin Semiconductor Manufacturing Corp.) */
 	{ "XM25QH64A", INFO(0x207017, 0, 64 * 1024, 128)
-		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
-			      SPI_NOR_QUAD_READ) },
+		PARSE_SFDP },
 	{ "XM25QH128A", INFO(0x207018, 0, 64 * 1024, 256)
-		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
-			      SPI_NOR_QUAD_READ) },
+		PARSE_SFDP },
+	{ "XM25QH128C", INFO(0x204018, 0, 64 * 1024, 256)
+		PARSE_SFDP },
+	{ "XM25QH256C", INFO(0x204019, 0, 64 * 1024, 512)
+		PARSE_SFDP },
+	{ "XM25QU256C", INFO(0x204119, 0, 64 * 1024, 512)
+		PARSE_SFDP },
+	{ "XM25QH512C", INFO(0x204020, 0, 64 * 1024, 1024)
+		PARSE_SFDP },
+	{ "XM25QU512C", INFO(0x204120, 0, 64 * 1024, 1024)
+		PARSE_SFDP },
+
 };
 
 const struct spi_nor_manufacturer spi_nor_xmc = {
Quoted 6 lines

Correct. If the flash is working with PARSE_SFDP, it has SFDP and all the information of the flash_info table is pulled from the SFDP tables, except for the part name. Therefore, you don't need any entry at all. The flash should just work out of the box. Are you using the latest kernel?

Quoted 1 line
Quoted 1 line

-michael

--
Hi Michael,

According to you, does this piece of my code still need to be modified?

Thanks,
Ssunk

author
#6 lore raw
In reply to Clus Tom
Quoted 4 lines

Hi Simon,
I just want to apply:
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]

Quoted 38 lines

Thanks,
SSunk

Quoted 33 lines · Simon Glass <[email protected]> 于2023年8月15日周二 06:43写道:

Hi,

Quoted 3 lines · Clus Tom

Hi Simon,
I'm not quite sure what you mean by v2, if it's the previous email, it

only removes the XM25QH128C part of the commit message compared to the previous one.

Quoted 1 line

Right, so it is v2.

Your emails seem to have generated 3 patches:

https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

The version number helps the maintainer figure out which one to apply.

Regards,
Simon

- Simon

--
Hi Simon,

When will this patch be merged into the master branch?

Thanks,
SSunk