Skip to content

Commit b0eea63

Browse files
mwalleambarus
authored andcommitted
mtd: spi-nor: macronix: 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 947bb8f commit b0eea63

File tree

1 file changed

+65
-65
lines changed

1 file changed

+65
-65
lines changed

drivers/mtd/spi-nor/macronix.c

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -62,26 +62,44 @@ static const struct flash_info macronix_nor_parts[] = {
6262
.name = "mx25l3205d",
6363
.size = SZ_4M,
6464
.no_sfdp_flags = SECT_4K,
65-
}, {
66-
.id = SNOR_ID(0xc2, 0x9e, 0x16),
67-
.name = "mx25l3255e",
68-
.size = SZ_4M,
69-
.no_sfdp_flags = SECT_4K,
7065
}, {
7166
.id = SNOR_ID(0xc2, 0x20, 0x17),
7267
.name = "mx25l6405d",
7368
.size = SZ_8M,
7469
.no_sfdp_flags = SECT_4K,
70+
}, {
71+
.id = SNOR_ID(0xc2, 0x20, 0x18),
72+
.name = "mx25l12805d",
73+
.size = SZ_16M,
74+
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_4BIT_BP,
75+
.no_sfdp_flags = SECT_4K,
76+
}, {
77+
.id = SNOR_ID(0xc2, 0x20, 0x19),
78+
.name = "mx25l25635e",
79+
.size = SZ_32M,
80+
.no_sfdp_flags = SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
81+
.fixups = &mx25l25635_fixups
82+
}, {
83+
.id = SNOR_ID(0xc2, 0x20, 0x1a),
84+
.name = "mx66l51235f",
85+
.size = SZ_64M,
86+
.no_sfdp_flags = SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
87+
.fixup_flags = SPI_NOR_4B_OPCODES,
88+
}, {
89+
.id = SNOR_ID(0xc2, 0x20, 0x1b),
90+
.name = "mx66l1g45g",
91+
.size = SZ_128M,
92+
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
93+
}, {
94+
.id = SNOR_ID(0xc2, 0x23, 0x14),
95+
.name = "mx25v8035f",
96+
.size = SZ_1M,
97+
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
7598
}, {
7699
.id = SNOR_ID(0xc2, 0x25, 0x32),
77100
.name = "mx25u2033e",
78101
.size = SZ_256K,
79102
.no_sfdp_flags = SECT_4K,
80-
}, {
81-
.id = SNOR_ID(0xc2, 0x25, 0x36),
82-
.name = "mx25u3235f",
83-
.size = SZ_4M,
84-
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
85103
}, {
86104
.id = SNOR_ID(0xc2, 0x25, 0x33),
87105
.name = "mx25u4035",
@@ -92,97 +110,79 @@ static const struct flash_info macronix_nor_parts[] = {
92110
.name = "mx25u8035",
93111
.size = SZ_1M,
94112
.no_sfdp_flags = SECT_4K,
113+
}, {
114+
.id = SNOR_ID(0xc2, 0x25, 0x36),
115+
.name = "mx25u3235f",
116+
.size = SZ_4M,
117+
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
95118
}, {
96119
.id = SNOR_ID(0xc2, 0x25, 0x37),
97120
.name = "mx25u6435f",
98121
.size = SZ_8M,
99122
.no_sfdp_flags = SECT_4K,
100-
}, {
101-
.id = SNOR_ID(0xc2, 0x20, 0x18),
102-
.name = "mx25l12805d",
103-
.size = SZ_16M,
104-
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_4BIT_BP,
105-
.no_sfdp_flags = SECT_4K,
106-
}, {
107-
.id = SNOR_ID(0xc2, 0x26, 0x18),
108-
.name = "mx25l12855e",
109-
.size = SZ_16M,
110-
}, {
111-
.id = SNOR_ID(0xc2, 0x28, 0x15),
112-
.name = "mx25r1635f",
113-
.size = SZ_2M,
114-
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
115-
}, {
116-
.id = SNOR_ID(0xc2, 0x28, 0x16),
117-
.name = "mx25r3235f",
118-
.size = SZ_4M,
119-
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
120123
}, {
121124
.id = SNOR_ID(0xc2, 0x25, 0x38),
122125
.name = "mx25u12835f",
123126
.size = SZ_16M,
124127
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
125-
}, {
126-
.id = SNOR_ID(0xc2, 0x20, 0x19),
127-
.name = "mx25l25635e",
128-
.size = SZ_32M,
129-
.no_sfdp_flags = SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
130-
.fixups = &mx25l25635_fixups
131128
}, {
132129
.id = SNOR_ID(0xc2, 0x25, 0x39),
133130
.name = "mx25u25635f",
134131
.size = SZ_32M,
135132
.no_sfdp_flags = SECT_4K,
136-
FIXUP_FLAGS(SPI_NOR_4B_OPCODES)
133+
.fixup_flags = SPI_NOR_4B_OPCODES,
137134
}, {
138135
.id = SNOR_ID(0xc2, 0x25, 0x3a),
139136
.name = "mx25u51245g",
140137
.size = SZ_64M,
141138
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
142139
.fixup_flags = SPI_NOR_4B_OPCODES,
143-
}, {
144-
.id = SNOR_ID(0xc2, 0x81, 0x3a),
145-
.name = "mx25uw51245g",
146-
.n_banks = 4,
147-
.flags = SPI_NOR_RWW,
148-
}, {
149-
.id = SNOR_ID(0xc2, 0x23, 0x14),
150-
.name = "mx25v8035f",
151-
.size = SZ_1M,
152-
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
153-
}, {
154-
.id = SNOR_ID(0xc2, 0x26, 0x19),
155-
.name = "mx25l25655e",
156-
.size = SZ_32M,
157-
}, {
158-
.id = SNOR_ID(0xc2, 0x20, 0x1a),
159-
.name = "mx66l51235f",
160-
.size = SZ_64M,
161-
.no_sfdp_flags = SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
162-
.fixup_flags = SPI_NOR_4B_OPCODES,
163140
}, {
164141
.id = SNOR_ID(0xc2, 0x25, 0x3a),
165142
.name = "mx66u51235f",
166143
.size = SZ_64M,
167144
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
168145
.fixup_flags = SPI_NOR_4B_OPCODES,
169146
}, {
170-
.id = SNOR_ID(0xc2, 0x20, 0x1b),
171-
.name = "mx66l1g45g",
172-
.size = SZ_128M,
147+
.id = SNOR_ID(0xc2, 0x25, 0x3c),
148+
.name = "mx66u2g45g",
149+
.size = SZ_256M,
173150
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
151+
.fixup_flags = SPI_NOR_4B_OPCODES,
152+
}, {
153+
.id = SNOR_ID(0xc2, 0x26, 0x18),
154+
.name = "mx25l12855e",
155+
.size = SZ_16M,
156+
}, {
157+
.id = SNOR_ID(0xc2, 0x26, 0x19),
158+
.name = "mx25l25655e",
159+
.size = SZ_32M,
174160
}, {
175161
.id = SNOR_ID(0xc2, 0x26, 0x1b),
176162
.name = "mx66l1g55g",
177163
.size = SZ_128M,
178164
.no_sfdp_flags = SPI_NOR_QUAD_READ,
179165
}, {
180-
.id = SNOR_ID(0xc2, 0x25, 0x3c),
181-
.name = "mx66u2g45g",
182-
.size = SZ_256M,
166+
.id = SNOR_ID(0xc2, 0x28, 0x15),
167+
.name = "mx25r1635f",
168+
.size = SZ_2M,
183169
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
184-
.fixup_flags = SPI_NOR_4B_OPCODES,
185-
},
170+
}, {
171+
.id = SNOR_ID(0xc2, 0x28, 0x16),
172+
.name = "mx25r3235f",
173+
.size = SZ_4M,
174+
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
175+
}, {
176+
.id = SNOR_ID(0xc2, 0x81, 0x3a),
177+
.name = "mx25uw51245g",
178+
.n_banks = 4,
179+
.flags = SPI_NOR_RWW,
180+
}, {
181+
.id = SNOR_ID(0xc2, 0x9e, 0x16),
182+
.name = "mx25l3255e",
183+
.size = SZ_4M,
184+
.no_sfdp_flags = SECT_4K,
185+
}
186186
};
187187

188188
static void macronix_nor_default_init(struct spi_nor *nor)

0 commit comments

Comments
 (0)