Skip to content

Commit 1de4108

Browse files
mwalleambarus
authored andcommitted
mtd: spi-nor: sst: 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-38-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
1 parent 8770a6a commit 1de4108

1 file changed

Lines changed: 45 additions & 45 deletions

File tree

drivers/mtd/spi-nor/sst.c

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -62,38 +62,16 @@ static const struct spi_nor_fixups sst26vf_nor_fixups = {
6262

6363
static const struct flash_info sst_nor_parts[] = {
6464
{
65-
.id = SNOR_ID(0xbf, 0x25, 0x8d),
66-
.name = "sst25vf040b",
67-
.size = SZ_512K,
68-
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE,
69-
.no_sfdp_flags = SECT_4K,
70-
.mfr_flags = SST_WRITE,
71-
}, {
72-
.id = SNOR_ID(0xbf, 0x25, 0x8e),
73-
.name = "sst25vf080b",
74-
.size = SZ_1M,
75-
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE,
76-
.no_sfdp_flags = SECT_4K,
77-
.mfr_flags = SST_WRITE,
78-
}, {
79-
.id = SNOR_ID(0xbf, 0x25, 0x41),
80-
.name = "sst25vf016b",
81-
.size = SZ_2M,
82-
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE,
83-
.no_sfdp_flags = SECT_4K,
84-
.mfr_flags = SST_WRITE,
85-
}, {
86-
.id = SNOR_ID(0xbf, 0x25, 0x4a),
87-
.name = "sst25vf032b",
88-
.size = SZ_4M,
89-
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE,
65+
.id = SNOR_ID(0x62, 0x16, 0x12),
66+
.name = "sst25wf020a",
67+
.size = SZ_256K,
68+
.flags = SPI_NOR_HAS_LOCK,
9069
.no_sfdp_flags = SECT_4K,
91-
.mfr_flags = SST_WRITE,
9270
}, {
93-
.id = SNOR_ID(0xbf, 0x25, 0x4b),
94-
.name = "sst25vf064c",
95-
.size = SZ_8M,
96-
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_4BIT_BP | SPI_NOR_SWP_IS_VOLATILE,
71+
.id = SNOR_ID(0x62, 0x16, 0x13),
72+
.name = "sst25wf040b",
73+
.size = SZ_512K,
74+
.flags = SPI_NOR_HAS_LOCK,
9775
.no_sfdp_flags = SECT_4K,
9876
}, {
9977
.id = SNOR_ID(0xbf, 0x25, 0x01),
@@ -116,18 +94,6 @@ static const struct flash_info sst_nor_parts[] = {
11694
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE,
11795
.no_sfdp_flags = SECT_4K,
11896
.mfr_flags = SST_WRITE,
119-
}, {
120-
.id = SNOR_ID(0x62, 0x16, 0x12),
121-
.name = "sst25wf020a",
122-
.size = SZ_256K,
123-
.flags = SPI_NOR_HAS_LOCK,
124-
.no_sfdp_flags = SECT_4K,
125-
}, {
126-
.id = SNOR_ID(0x62, 0x16, 0x13),
127-
.name = "sst25wf040b",
128-
.size = SZ_512K,
129-
.flags = SPI_NOR_HAS_LOCK,
130-
.no_sfdp_flags = SECT_4K,
13197
}, {
13298
.id = SNOR_ID(0xbf, 0x25, 0x04),
13399
.name = "sst25wf040",
@@ -143,10 +109,39 @@ static const struct flash_info sst_nor_parts[] = {
143109
.no_sfdp_flags = SECT_4K,
144110
.mfr_flags = SST_WRITE,
145111
}, {
146-
.id = SNOR_ID(0xbf, 0x26, 0x51),
147-
.name = "sst26wf016b",
112+
.id = SNOR_ID(0xbf, 0x25, 0x41),
113+
.name = "sst25vf016b",
148114
.size = SZ_2M,
149-
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
115+
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE,
116+
.no_sfdp_flags = SECT_4K,
117+
.mfr_flags = SST_WRITE,
118+
}, {
119+
.id = SNOR_ID(0xbf, 0x25, 0x4a),
120+
.name = "sst25vf032b",
121+
.size = SZ_4M,
122+
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE,
123+
.no_sfdp_flags = SECT_4K,
124+
.mfr_flags = SST_WRITE,
125+
}, {
126+
.id = SNOR_ID(0xbf, 0x25, 0x4b),
127+
.name = "sst25vf064c",
128+
.size = SZ_8M,
129+
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_4BIT_BP | SPI_NOR_SWP_IS_VOLATILE,
130+
.no_sfdp_flags = SECT_4K,
131+
}, {
132+
.id = SNOR_ID(0xbf, 0x25, 0x8d),
133+
.name = "sst25vf040b",
134+
.size = SZ_512K,
135+
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE,
136+
.no_sfdp_flags = SECT_4K,
137+
.mfr_flags = SST_WRITE,
138+
}, {
139+
.id = SNOR_ID(0xbf, 0x25, 0x8e),
140+
.name = "sst25vf080b",
141+
.size = SZ_1M,
142+
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE,
143+
.no_sfdp_flags = SECT_4K,
144+
.mfr_flags = SST_WRITE,
150145
}, {
151146
.id = SNOR_ID(0xbf, 0x26, 0x41),
152147
.name = "sst26vf016b",
@@ -164,6 +159,11 @@ static const struct flash_info sst_nor_parts[] = {
164159
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE,
165160
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
166161
.fixups = &sst26vf_nor_fixups,
162+
}, {
163+
.id = SNOR_ID(0xbf, 0x26, 0x51),
164+
.name = "sst26wf016b",
165+
.size = SZ_2M,
166+
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
167167
}
168168
};
169169

0 commit comments

Comments
 (0)