From b05eba930ccd360f86416d512cae4b1089969e36 Mon Sep 17 00:00:00 2001 From: Heinrich Toews Date: Thu, 18 Dec 2025 18:55:50 +0100 Subject: [PATCH] mtd: spi-nor: add support for everspin mram flashes Signed-off-by: Heinrich Toews --- drivers/mtd/spi-nor/core.c | 1 + drivers/mtd/spi-nor/core.h | 1 + drivers/mtd/spi-nor/everspin.c | 28 ++++++++++++++++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 1b0c6770c14e..e5871e5ac428 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -2003,6 +2003,7 @@ static const struct spi_nor_manufacturer *manufacturers[] = { &spi_nor_eon, &spi_nor_esmt, &spi_nor_everspin, + &spi_mram_everspin, &spi_nor_fujitsu, &spi_nor_gigadevice, &spi_nor_intel, diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h index 9217379b9cfe..ddc2232bff16 100644 --- a/drivers/mtd/spi-nor/core.h +++ b/drivers/mtd/spi-nor/core.h @@ -635,6 +635,7 @@ extern const struct spi_nor_manufacturer spi_nor_catalyst; extern const struct spi_nor_manufacturer spi_nor_eon; extern const struct spi_nor_manufacturer spi_nor_esmt; extern const struct spi_nor_manufacturer spi_nor_everspin; +extern const struct spi_nor_manufacturer spi_mram_everspin; extern const struct spi_nor_manufacturer spi_nor_fujitsu; extern const struct spi_nor_manufacturer spi_nor_gigadevice; extern const struct spi_nor_manufacturer spi_nor_intel; diff --git a/drivers/mtd/spi-nor/everspin.c b/drivers/mtd/spi-nor/everspin.c index 84a07c2e0536..d18d23ee7c9e 100644 --- a/drivers/mtd/spi-nor/everspin.c +++ b/drivers/mtd/spi-nor/everspin.c @@ -16,8 +16,36 @@ static const struct flash_info everspin_nor_parts[] = { { "mr25h40", CAT25_INFO(512 * 1024, 1, 256, 3) }, }; +static const struct flash_info everspin_mram_parts[] = { + /* Everspin */ + { "em256lx", INFO(0x6bbb19, 0, 32 * 1024 * 1024, 1) + FLAGS(SPI_NOR_NO_ERASE) + }, + { "em128lx", INFO(0x6bbb18, 0, 16 * 1024 * 1024, 1) + FLAGS(SPI_NOR_NO_ERASE) + }, + { "em064lx", INFO(0x6bbb17, 0, 8 * 1024 * 1024, 1) + FLAGS(SPI_NOR_NO_ERASE) + }, + { "em032lx", INFO(0x6bbb16, 0, 4 * 1024 * 1024, 1) + FLAGS(SPI_NOR_NO_ERASE) + }, + { "em016lx", INFO(0x6bbb15, 0, 2 * 1024 * 1024, 1) + FLAGS(SPI_NOR_NO_ERASE) + }, + { "em008lx", INFO(0x6bbb14, 0, 1 * 1024 * 1024, 1) + FLAGS(SPI_NOR_NO_ERASE) + }, +}; + const struct spi_nor_manufacturer spi_nor_everspin = { .name = "everspin", .parts = everspin_nor_parts, .nparts = ARRAY_SIZE(everspin_nor_parts), }; + +const struct spi_nor_manufacturer spi_mram_everspin = { + .name = "everspin_mram", + .parts = everspin_mram_parts, + .nparts = ARRAY_SIZE(everspin_mram_parts), +};