diff mbox series

[v3,6/6] mtd: spi-nor: manuf-id-collisions: Add support for xm25qh64c

Message ID 20211106113657.172690-7-tudor.ambarus@microchip.com
State Changes Requested
Delegated to: Ambarus Tudor
Headers show
Series mtd: spi-nor: Handle ID collisions | expand

Commit Message

Tudor Ambarus Nov. 6, 2021, 11:36 a.m. UTC
Do not apply without:

# xxd -p /path/to/sfdp
# sha1sum /path/to/sfdp
# cat /path/to/jedec_id
# cat /path/to/partname
# cat /path/to/manufacturer 

Flash ignores the manufacturer continuation codes and is likely to
collide with other manufacturers flashes.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 drivers/mtd/spi-nor/manuf-id-collisions.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff mbox series

Patch

diff --git a/drivers/mtd/spi-nor/manuf-id-collisions.c b/drivers/mtd/spi-nor/manuf-id-collisions.c
index 7827cfc584df..0d0989dd25be 100644
--- a/drivers/mtd/spi-nor/manuf-id-collisions.c
+++ b/drivers/mtd/spi-nor/manuf-id-collisions.c
@@ -17,6 +17,15 @@  static const struct spi_nor_fixups boya_fixups = {
 	.late_init = boya_late_init,
 };
 
+static void xmc_late_init(struct spi_nor *nor)
+{
+	nor->manufacturer_name = "xmc";
+}
+
+static const struct spi_nor_fixups xmc_fixups = {
+	.late_init = xmc_late_init,
+};
+
 static void xtx_late_init(struct spi_nor *nor)
 {
 	nor->manufacturer_name = "xtx";
@@ -33,6 +42,10 @@  static const struct flash_info id_collision_parts[] = {
 			     SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
 		.fixups = &boya_fixups },
 
+	/* XMC (Wuhan Xinxin Semiconductor Manufacturing Corp.) */
+	{ "xm25qh64c", INFO(0x204017, 0, 64 * 1024, 128, SPI_NOR_PARSE_SFDP)
+		.fixups = &xmc_fixups },
+
 	/* XTX (XTX Technology Limited) */
 	{ "xt25f128b", INFO(0x0b4018, 0, 64 * 1024, 256, SPI_NOR_PARSE_SFDP)
 		.fixups = &xtx_fixups },