@@ -127,6 +127,38 @@ static int micron_st_nor_set_octal_dtr(struct spi_nor *nor, bool enable)
127127 micron_st_nor_octal_dtr_dis (nor );
128128}
129129
130+ static int micron_st_nor_four_die_late_init (struct spi_nor * nor )
131+ {
132+ struct spi_nor_flash_parameter * params = nor -> params ;
133+
134+ params -> die_erase_opcode = SPINOR_OP_MT_DIE_ERASE ;
135+ params -> n_dice = 4 ;
136+
137+ /*
138+ * Unfortunately the die erase opcode does not have a 4-byte opcode
139+ * correspondent for these flashes. The SFDP 4BAIT table fails to
140+ * consider the die erase too. We're forced to enter in the 4 byte
141+ * address mode in order to benefit of the die erase.
142+ */
143+ return spi_nor_set_4byte_addr_mode (nor , true);
144+ }
145+
146+ static int micron_st_nor_two_die_late_init (struct spi_nor * nor )
147+ {
148+ struct spi_nor_flash_parameter * params = nor -> params ;
149+
150+ params -> die_erase_opcode = SPINOR_OP_MT_DIE_ERASE ;
151+ params -> n_dice = 2 ;
152+
153+ /*
154+ * Unfortunately the die erase opcode does not have a 4-byte opcode
155+ * correspondent for these flashes. The SFDP 4BAIT table fails to
156+ * consider the die erase too. We're forced to enter in the 4 byte
157+ * address mode in order to benefit of the die erase.
158+ */
159+ return spi_nor_set_4byte_addr_mode (nor , true);
160+ }
161+
130162static void mt35xu512aba_default_init (struct spi_nor * nor )
131163{
132164 nor -> params -> set_octal_dtr = micron_st_nor_set_octal_dtr ;
@@ -193,48 +225,16 @@ static const struct spi_nor_fixups mt25qu512a_fixups = {
193225 .post_bfpt = mt25qu512a_post_bfpt_fixup ,
194226};
195227
196- static int st_nor_four_die_late_init (struct spi_nor * nor )
197- {
198- struct spi_nor_flash_parameter * params = nor -> params ;
199-
200- params -> die_erase_opcode = SPINOR_OP_MT_DIE_ERASE ;
201- params -> n_dice = 4 ;
202-
203- /*
204- * Unfortunately the die erase opcode does not have a 4-byte opcode
205- * correspondent for these flashes. The SFDP 4BAIT table fails to
206- * consider the die erase too. We're forced to enter in the 4 byte
207- * address mode in order to benefit of the die erase.
208- */
209- return spi_nor_set_4byte_addr_mode (nor , true);
210- }
211-
212- static int st_nor_two_die_late_init (struct spi_nor * nor )
213- {
214- struct spi_nor_flash_parameter * params = nor -> params ;
215-
216- params -> die_erase_opcode = SPINOR_OP_MT_DIE_ERASE ;
217- params -> n_dice = 2 ;
218-
219- /*
220- * Unfortunately the die erase opcode does not have a 4-byte opcode
221- * correspondent for these flashes. The SFDP 4BAIT table fails to
222- * consider the die erase too. We're forced to enter in the 4 byte
223- * address mode in order to benefit of the die erase.
224- */
225- return spi_nor_set_4byte_addr_mode (nor , true);
226- }
227-
228228static const struct spi_nor_fixups n25q00_fixups = {
229- .late_init = st_nor_four_die_late_init ,
229+ .late_init = micron_st_nor_four_die_late_init ,
230230};
231231
232232static const struct spi_nor_fixups mt25q01_fixups = {
233- .late_init = st_nor_two_die_late_init ,
233+ .late_init = micron_st_nor_two_die_late_init ,
234234};
235235
236236static const struct spi_nor_fixups mt25q02_fixups = {
237- .late_init = st_nor_four_die_late_init ,
237+ .late_init = micron_st_nor_four_die_late_init ,
238238};
239239
240240static const struct flash_info st_nor_parts [] = {
0 commit comments