Skip to content

Commit f9acd7f

Browse files
Pratyush Yadavambarus
authored andcommitted
mtd: spi-nor: sfdp: default to addr_width of 3 for configurable widths
JESD216D.01 says that when the address width can be 3 or 4, it defaults to 3 and enters 4-byte mode when given the appropriate command. So, when we see a configurable width, default to 3 and let flash that default to 4 change it in a post-bfpt fixup. This fixes SMPT parsing for flashes with configurable address width. If the SMPT descriptor advertises variable address width, we use nor->addr_width as the address width. But since it was not set to any value from the SFDP table, the read command uses an address width of 0, resulting in an incorrect read being issued. Signed-off-by: Pratyush Yadav <[email protected]> Signed-off-by: Tudor Ambarus <[email protected]>
1 parent 8a2644d commit f9acd7f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/mtd/spi-nor/sfdp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,7 @@ static int spi_nor_parse_bfpt(struct spi_nor *nor,
460460
/* Number of address bytes. */
461461
switch (bfpt.dwords[BFPT_DWORD(1)] & BFPT_DWORD1_ADDRESS_BYTES_MASK) {
462462
case BFPT_DWORD1_ADDRESS_BYTES_3_ONLY:
463+
case BFPT_DWORD1_ADDRESS_BYTES_3_OR_4:
463464
nor->addr_width = 3;
464465
break;
465466

0 commit comments

Comments
 (0)