Skip to content

Commit c692ba6

Browse files
Fabio Estevamambarus
authored andcommitted
mtd: spi-nor: micron-st: Add support for mt25qu01g
Add support for the MT25QU01G 128MB Micron Serial NOR Flash Memory model. Link: https://www.micron.com/-/media/client/global/documents/products/data-sheet/nor-flash/serial-nor/mt25q/die-rev-b/mt25q_qlkt_u_01g_bbb_0.pdf Signed-off-by: Fabio Estevam <festevam@denx.de> [ta: introduce die erase] Link: https://lore.kernel.org/r/20231125123529.55686-6-tudor.ambarus@linaro.org Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
1 parent 06de125 commit c692ba6

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

drivers/mtd/spi-nor/micron-st.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,30 @@ static int st_nor_four_die_late_init(struct spi_nor *nor)
209209
return spi_nor_set_4byte_addr_mode(nor, true);
210210
}
211211

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+
212228
static struct spi_nor_fixups n25q00_fixups = {
213229
.late_init = st_nor_four_die_late_init,
214230
};
215231

232+
static struct spi_nor_fixups mt25q01_fixups = {
233+
.late_init = st_nor_two_die_late_init,
234+
};
235+
216236
static struct spi_nor_fixups mt25q02_fixups = {
217237
.late_init = st_nor_four_die_late_init,
218238
};
@@ -455,6 +475,11 @@ static const struct flash_info st_nor_parts[] = {
455475
SPI_NOR_BP3_SR_BIT6,
456476
.no_sfdp_flags = SECT_4K | SPI_NOR_QUAD_READ,
457477
.mfr_flags = USE_FSR,
478+
}, {
479+
.id = SNOR_ID(0x20, 0xbb, 0x21, 0x10, 0x44, 0x00),
480+
.name = "mt25qu01g",
481+
.mfr_flags = USE_FSR,
482+
.fixups = &mt25q01_fixups,
458483
}, {
459484
.id = SNOR_ID(0x20, 0xbb, 0x21),
460485
.name = "n25q00a",

0 commit comments

Comments
 (0)