Skip to content

Commit b740cb6

Browse files
ambarusvarshini-rajendran
authored andcommitted
mtd: spi-nor: sfdp: Get the 8D-8D-8D byte order from BFPT
Parse BFPT in order to retrieve the byte order in 8D-8D-8D mode. Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> [varshini.rajendran@microchip.com: Ported to 6.6.9 by fixing merge conflicts] Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
1 parent a344b6c commit b740cb6

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

drivers/mtd/spi-nor/sfdp.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,9 @@ static int spi_nor_parse_bfpt(struct spi_nor *nor,
650650
return -EOPNOTSUPP;
651651
}
652652

653+
if (bfpt.dwords[SFDP_DWORD(18)] & BFPT_DWORD18_BYTE_ORDER_SWAPPED)
654+
nor->flags |= SNOR_F_DTR_BSWAP16;
655+
653656
return spi_nor_post_bfpt_fixups(nor, bfpt_header, &bfpt);
654657
}
655658

drivers/mtd/spi-nor/sfdp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ struct sfdp_bfpt {
123123
#define BFPT_DWORD18_CMD_EXT_INV (0x1UL << 29) /* Invert */
124124
#define BFPT_DWORD18_CMD_EXT_RES (0x2UL << 29) /* Reserved */
125125
#define BFPT_DWORD18_CMD_EXT_16B (0x3UL << 29) /* 16-bit opcode */
126+
#define BFPT_DWORD18_BYTE_ORDER_SWAPPED BIT(31)
126127

127128
struct sfdp_parameter_header {
128129
u8 id_lsb;

0 commit comments

Comments
 (0)