Skip to content

Commit 2c7d1b2

Browse files
KamalDasubroonie
authored andcommitted
spi: bcm-qspi: fix MSPI only access with bcm_qspi_exec_mem_op()
This fixes case where MSPI controller is used to access spi-nor flash and BSPI block is not present. Fixes: 5f195ee ("spi: bcm-qspi: Implement the spi_mem interface") Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Link: https://lore.kernel.org/r/20220328142442.7553-1-kdasu.kdev@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 97e4827 commit 2c7d1b2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/spi/spi-bcm-qspi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,7 @@ static int bcm_qspi_exec_mem_op(struct spi_mem *mem,
12051205
addr = op->addr.val;
12061206
len = op->data.nbytes;
12071207

1208-
if (bcm_qspi_bspi_ver_three(qspi) == true) {
1208+
if (has_bspi(qspi) && bcm_qspi_bspi_ver_three(qspi) == true) {
12091209
/*
12101210
* The address coming into this function is a raw flash offset.
12111211
* But for BSPI <= V3, we need to convert it to a remapped BSPI
@@ -1224,7 +1224,7 @@ static int bcm_qspi_exec_mem_op(struct spi_mem *mem,
12241224
len < 4)
12251225
mspi_read = true;
12261226

1227-
if (mspi_read)
1227+
if (!has_bspi(qspi) || mspi_read)
12281228
return bcm_qspi_mspi_exec_mem_op(spi, op);
12291229

12301230
ret = bcm_qspi_bspi_set_mode(qspi, op, 0);

0 commit comments

Comments
 (0)