Skip to content

Commit 6823a83

Browse files
Mamta Shuklaambarus
authored andcommitted
mtd: spi-nor: micron-st: use SFDP table for mt25qu512a
Parse SFDP table to get size and functions of mt25qu512a. BFPT wrongly advertises 16bit SR support and made the locking fail. Add a post BFPT fixup hook to clear the 16bit SR support. cat /sys/bus/spi/devices/spi-PRP0001:00/spi-nor/jedec_id 20bb20104400 cat /sys/bus/spi/devices/spi-PRP0001:00/spi-nor/manufacturer st cat /sys/bus/spi/devices/spi-PRP0001:00/spi-nor/partname mt25qu512a xxd -p /sys/bus/spi/devices/spi-PRP0001:00/spi-nor/sfdp 53464450060101ff00060110300000ff84000102800000ffffffffffffff ffffffffffffffffffffffffffffffffffffe520fbffffffff1f29eb276b 273b27bbffffffffffff27bbffff29eb0c2010d80f520000244a99008b8e 03e1ac0127387a757a75fbbdd55c4a0f82ff81bd3d36ffffffffffffffff ffffffffffffffffffe7ffff21dcffff md5sum /sys/bus/spi/devices/spi-PRP0001:00/spi-nor/sfdp 610efba1647e00ac6db18beb11e84c04 /sys/bus/spi/devices/spi-PRP0001:00/spi-nor/sfdp Signed-off-by: Mamta Shukla <[email protected]> Reviewed-by: Pratyush Yadav <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Tudor Ambarus <[email protected]>
1 parent a2a3e54 commit 6823a83

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,18 @@ static const struct flash_info micron_nor_parts[] = {
180180
},
181181
};
182182

183+
static int mt25qu512a_post_bfpt_fixup(struct spi_nor *nor,
184+
const struct sfdp_parameter_header *bfpt_header,
185+
const struct sfdp_bfpt *bfpt)
186+
{
187+
nor->flags &= ~SNOR_F_HAS_16BIT_SR;
188+
return 0;
189+
}
190+
191+
static struct spi_nor_fixups mt25qu512a_fixups = {
192+
.post_bfpt = mt25qu512a_post_bfpt_fixup,
193+
};
194+
183195
static const struct flash_info st_nor_parts[] = {
184196
{
185197
.name = "m25p05-nonjedec",
@@ -407,10 +419,8 @@ static const struct flash_info st_nor_parts[] = {
407419
.name = "mt25qu512a",
408420
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_4BIT_BP |
409421
SPI_NOR_BP3_SR_BIT6,
410-
.size = SZ_64M,
411-
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
412-
.fixup_flags = SPI_NOR_4B_OPCODES,
413422
.mfr_flags = USE_FSR,
423+
.fixups = &mt25qu512a_fixups,
414424
}, {
415425
.id = SNOR_ID(0x20, 0xbb, 0x20),
416426
.name = "n25q512a",

0 commit comments

Comments
 (0)