Skip to content

Commit a16ae25

Browse files
mwalleambarus
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Tudor Ambarus <[email protected]>
1 parent 9e02cb5 commit a16ae25

File tree

1 file changed

+41
-41
lines changed

1 file changed

+41
-41
lines changed

drivers/mtd/spi-nor/atmel.c

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -164,20 +164,20 @@ static const struct spi_nor_fixups atmel_nor_global_protection_fixups = {
164164

165165
static const struct flash_info atmel_nor_parts[] = {
166166
{
167-
.id = SNOR_ID(0x1f, 0x66, 0x01),
168-
.name = "at25fs010",
169-
.sector_size = SZ_32K,
170-
.size = SZ_128K,
171-
.flags = SPI_NOR_HAS_LOCK,
167+
.id = SNOR_ID(0x1f, 0x04, 0x00),
168+
.name = "at26f004",
169+
.size = SZ_512K,
172170
.no_sfdp_flags = SECT_4K,
173-
.fixups = &at25fs_nor_fixups
174171
}, {
175-
.id = SNOR_ID(0x1f, 0x66, 0x04),
176-
.name = "at25fs040",
177-
.size = SZ_512K,
178-
.flags = SPI_NOR_HAS_LOCK,
172+
.id = SNOR_ID(0x1f, 0x25, 0x00),
173+
.name = "at45db081d",
174+
.size = SZ_1M,
179175
.no_sfdp_flags = SECT_4K,
180-
.fixups = &at25fs_nor_fixups
176+
}, {
177+
.id = SNOR_ID(0x1f, 0x42, 0x16),
178+
.name = "at25sl321",
179+
.size = SZ_4M,
180+
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
181181
}, {
182182
.id = SNOR_ID(0x1f, 0x44, 0x01),
183183
.name = "at25df041a",
@@ -186,62 +186,62 @@ static const struct flash_info atmel_nor_parts[] = {
186186
.no_sfdp_flags = SECT_4K,
187187
.fixups = &atmel_nor_global_protection_fixups,
188188
}, {
189-
.id = SNOR_ID(0x1f, 0x47, 0x00),
190-
.name = "at25df321",
191-
.size = SZ_4M,
189+
.id = SNOR_ID(0x1f, 0x45, 0x01),
190+
.name = "at26df081a",
191+
.size = SZ_1M,
192192
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE,
193193
.no_sfdp_flags = SECT_4K,
194194
.fixups = &atmel_nor_global_protection_fixups
195195
}, {
196-
.id = SNOR_ID(0x1f, 0x47, 0x01),
197-
.name = "at25df321a",
198-
.size = SZ_4M,
196+
.id = SNOR_ID(0x1f, 0x46, 0x01),
197+
.name = "at26df161a",
198+
.size = SZ_2M,
199199
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE,
200200
.no_sfdp_flags = SECT_4K,
201201
.fixups = &atmel_nor_global_protection_fixups
202202
}, {
203-
.id = SNOR_ID(0x1f, 0x48, 0x00),
204-
.name = "at25df641",
205-
.size = SZ_8M,
203+
.id = SNOR_ID(0x1f, 0x47, 0x00),
204+
.name = "at25df321",
205+
.size = SZ_4M,
206206
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE,
207207
.no_sfdp_flags = SECT_4K,
208208
.fixups = &atmel_nor_global_protection_fixups
209209
}, {
210-
.id = SNOR_ID(0x1f, 0x42, 0x16),
211-
.name = "at25sl321",
210+
.id = SNOR_ID(0x1f, 0x47, 0x00),
211+
.name = "at26df321",
212212
.size = SZ_4M,
213-
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
214-
}, {
215-
.id = SNOR_ID(0x1f, 0x04, 0x00),
216-
.name = "at26f004",
217-
.size = SZ_512K,
218-
.no_sfdp_flags = SECT_4K,
219-
}, {
220-
.id = SNOR_ID(0x1f, 0x45, 0x01),
221-
.name = "at26df081a",
222-
.size = SZ_1M,
223213
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE,
224214
.no_sfdp_flags = SECT_4K,
225215
.fixups = &atmel_nor_global_protection_fixups
226216
}, {
227-
.id = SNOR_ID(0x1f, 0x46, 0x01),
228-
.name = "at26df161a",
229-
.size = SZ_2M,
217+
.id = SNOR_ID(0x1f, 0x47, 0x01),
218+
.name = "at25df321a",
219+
.size = SZ_4M,
230220
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE,
231221
.no_sfdp_flags = SECT_4K,
232222
.fixups = &atmel_nor_global_protection_fixups
233223
}, {
234-
.id = SNOR_ID(0x1f, 0x47, 0x00),
235-
.name = "at26df321",
236-
.size = SZ_4M,
224+
.id = SNOR_ID(0x1f, 0x48, 0x00),
225+
.name = "at25df641",
226+
.size = SZ_8M,
237227
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE,
238228
.no_sfdp_flags = SECT_4K,
239229
.fixups = &atmel_nor_global_protection_fixups
240230
}, {
241-
.id = SNOR_ID(0x1f, 0x25, 0x00),
242-
.name = "at45db081d",
243-
.size = SZ_1M,
231+
.id = SNOR_ID(0x1f, 0x66, 0x01),
232+
.name = "at25fs010",
233+
.sector_size = SZ_32K,
234+
.size = SZ_128K,
235+
.flags = SPI_NOR_HAS_LOCK,
236+
.no_sfdp_flags = SECT_4K,
237+
.fixups = &at25fs_nor_fixups
238+
}, {
239+
.id = SNOR_ID(0x1f, 0x66, 0x04),
240+
.name = "at25fs040",
241+
.size = SZ_512K,
242+
.flags = SPI_NOR_HAS_LOCK,
244243
.no_sfdp_flags = SECT_4K,
244+
.fixups = &at25fs_nor_fixups
245245
},
246246
};
247247

0 commit comments

Comments
 (0)