Skip to content

Commit 574bf7b

Browse files
kamaldasu-cryptobroonie
authored andcommitted
spi: bcm-qspi: fix SFDP BFPT read by usig mspi read
SFDP read shall use the mspi reads when using the bcm_qspi_exec_mem_op() call. This fixes SFDP parameter page read failures seen with parts that now use SFDP protocol to read the basic flash parameter table. Fixes: 5f195ee ("spi: bcm-qspi: Implement the spi_mem interface") Signed-off-by: Kamal Dasu <[email protected]> Tested-by: Florian Fainelli <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 8afe3c7 commit 574bf7b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/spi/spi-bcm-qspi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <linux/platform_device.h>
2020
#include <linux/slab.h>
2121
#include <linux/spi/spi.h>
22-
#include <linux/spi/spi-mem.h>
22+
#include <linux/mtd/spi-nor.h>
2323
#include <linux/sysfs.h>
2424
#include <linux/types.h>
2525
#include "spi-bcm-qspi.h"
@@ -1221,7 +1221,7 @@ static int bcm_qspi_exec_mem_op(struct spi_mem *mem,
12211221

12221222
/* non-aligned and very short transfers are handled by MSPI */
12231223
if (!IS_ALIGNED((uintptr_t)addr, 4) || !IS_ALIGNED((uintptr_t)buf, 4) ||
1224-
len < 4)
1224+
len < 4 || op->cmd.opcode == SPINOR_OP_RDSFDP)
12251225
mspi_read = true;
12261226

12271227
if (!has_bspi(qspi) || mspi_read)

0 commit comments

Comments
 (0)