aboutsummaryrefslogtreecommitdiff
path: root/drivers/mtd/spi-nor
diff options
context:
space:
mode:
authorGravatar Michael Walle <mwalle@kernel.org> 2023-09-08 12:16:49 +0200
committerGravatar Tudor Ambarus <tudor.ambarus@linaro.org> 2023-09-19 18:59:21 +0300
commita16ae25022d97eb49ac103084c0c6270b5f91d96 (patch)
tree100f20d99eea939fdcec8a87ed9ba4a423d62f20 /drivers/mtd/spi-nor
parentmtd: spi-nor: xmc: convert flash_info to new format (diff)
downloadlinux-a16ae25022d97eb49ac103084c0c6270b5f91d96.tar.gz
linux-a16ae25022d97eb49ac103084c0c6270b5f91d96.tar.bz2
linux-a16ae25022d97eb49ac103084c0c6270b5f91d96.zip
mtd: spi-nor: atmel: sort flash_info database
The flash ID is the new primary key into our database. Sort the entry by it. Keep the most specific ones first, because there might be ID collisions between shorter and longer ones. Signed-off-by: Michael Walle <mwalle@kernel.org> Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-31-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Diffstat (limited to 'drivers/mtd/spi-nor')
-rw-r--r--drivers/mtd/spi-nor/atmel.c82
1 files changed, 41 insertions, 41 deletions
diff --git a/drivers/mtd/spi-nor/atmel.c b/drivers/mtd/spi-nor/atmel.c
index ccc985c48ae3..18e904962d0e 100644
--- a/drivers/mtd/spi-nor/atmel.c
+++ b/drivers/mtd/spi-nor/atmel.c
@@ -164,20 +164,20 @@ static const struct spi_nor_fixups atmel_nor_global_protection_fixups = {
static const struct flash_info atmel_nor_parts[] = {
{
- .id = SNOR_ID(0x1f, 0x66, 0x01),
- .name = "at25fs010",
- .sector_size = SZ_32K,
- .size = SZ_128K,
- .flags = SPI_NOR_HAS_LOCK,
+ .id = SNOR_ID(0x1f, 0x04, 0x00),
+ .name = "at26f004",
+ .size = SZ_512K,
.no_sfdp_flags = SECT_4K,
- .fixups = &at25fs_nor_fixups
}, {
- .id = SNOR_ID(0x1f, 0x66, 0x04),
- .name = "at25fs040",
- .size = SZ_512K,
- .flags = SPI_NOR_HAS_LOCK,
+ .id = SNOR_ID(0x1f, 0x25, 0x00),
+ .name = "at45db081d",
+ .size = SZ_1M,
.no_sfdp_flags = SECT_4K,
- .fixups = &at25fs_nor_fixups
+ }, {
+ .id = SNOR_ID(0x1f, 0x42, 0x16),
+ .name = "at25sl321",
+ .size = SZ_4M,
+ .no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
}, {
.id = SNOR_ID(0x1f, 0x44, 0x01),
.name = "at25df041a",
@@ -186,62 +186,62 @@ static const struct flash_info atmel_nor_parts[] = {
.no_sfdp_flags = SECT_4K,
.fixups = &atmel_nor_global_protection_fixups,
}, {
- .id = SNOR_ID(0x1f, 0x47, 0x00),
- .name = "at25df321",
- .size = SZ_4M,
+ .id = SNOR_ID(0x1f, 0x45, 0x01),
+ .name = "at26df081a",
+ .size = SZ_1M,
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE,
.no_sfdp_flags = SECT_4K,
.fixups = &atmel_nor_global_protection_fixups
}, {
- .id = SNOR_ID(0x1f, 0x47, 0x01),
- .name = "at25df321a",
- .size = SZ_4M,
+ .id = SNOR_ID(0x1f, 0x46, 0x01),
+ .name = "at26df161a",
+ .size = SZ_2M,
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE,
.no_sfdp_flags = SECT_4K,
.fixups = &atmel_nor_global_protection_fixups
}, {
- .id = SNOR_ID(0x1f, 0x48, 0x00),
- .name = "at25df641",
- .size = SZ_8M,
+ .id = SNOR_ID(0x1f, 0x47, 0x00),
+ .name = "at25df321",
+ .size = SZ_4M,
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE,
.no_sfdp_flags = SECT_4K,
.fixups = &atmel_nor_global_protection_fixups
}, {
- .id = SNOR_ID(0x1f, 0x42, 0x16),
- .name = "at25sl321",
+ .id = SNOR_ID(0x1f, 0x47, 0x00),
+ .name = "at26df321",
.size = SZ_4M,
- .no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
- }, {
- .id = SNOR_ID(0x1f, 0x04, 0x00),
- .name = "at26f004",
- .size = SZ_512K,
- .no_sfdp_flags = SECT_4K,
- }, {
- .id = SNOR_ID(0x1f, 0x45, 0x01),
- .name = "at26df081a",
- .size = SZ_1M,
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE,
.no_sfdp_flags = SECT_4K,
.fixups = &atmel_nor_global_protection_fixups
}, {
- .id = SNOR_ID(0x1f, 0x46, 0x01),
- .name = "at26df161a",
- .size = SZ_2M,
+ .id = SNOR_ID(0x1f, 0x47, 0x01),
+ .name = "at25df321a",
+ .size = SZ_4M,
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE,
.no_sfdp_flags = SECT_4K,
.fixups = &atmel_nor_global_protection_fixups
}, {
- .id = SNOR_ID(0x1f, 0x47, 0x00),
- .name = "at26df321",
- .size = SZ_4M,
+ .id = SNOR_ID(0x1f, 0x48, 0x00),
+ .name = "at25df641",
+ .size = SZ_8M,
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE,
.no_sfdp_flags = SECT_4K,
.fixups = &atmel_nor_global_protection_fixups
}, {
- .id = SNOR_ID(0x1f, 0x25, 0x00),
- .name = "at45db081d",
- .size = SZ_1M,
+ .id = SNOR_ID(0x1f, 0x66, 0x01),
+ .name = "at25fs010",
+ .sector_size = SZ_32K,
+ .size = SZ_128K,
+ .flags = SPI_NOR_HAS_LOCK,
+ .no_sfdp_flags = SECT_4K,
+ .fixups = &at25fs_nor_fixups
+ }, {
+ .id = SNOR_ID(0x1f, 0x66, 0x04),
+ .name = "at25fs040",
+ .size = SZ_512K,
+ .flags = SPI_NOR_HAS_LOCK,
.no_sfdp_flags = SECT_4K,
+ .fixups = &at25fs_nor_fixups
},
};