diff options
| author | Mark Brown <[email protected]> | 2022-05-11 18:48:07 +0000 |
|---|---|---|
| committer | Mark Brown <[email protected]> | 2022-05-11 18:48:07 +0000 |
| commit | d5efbfc5210cc7ce8e413278da0dc4b7ccbe5bb7 (patch) | |
| tree | 723be8852798ef09e5e9b253fc9efbba75917fe2 /drivers/spi/spi-stm32-qspi.c | |
| parent | spi: cadence-quadspi: remove unnecessary (void *) casts (diff) | |
| parent | spi: stm32-qspi: Remove SR_BUSY bit check before sending command (diff) | |
| download | kernel-d5efbfc5210cc7ce8e413278da0dc4b7ccbe5bb7.tar.gz kernel-d5efbfc5210cc7ce8e413278da0dc4b7ccbe5bb7.zip | |
spi: stm32-qspi: flags management fixes
Merge series from [email protected] <[email protected]>
Patrice Chotard <[email protected]>:
From: Patrice Chotard <[email protected]>
This series update flags management in the following cases:
- In APM mode, don't take care of TCF and TEF flags
- Always check TCF flag in stm32_qspi_wait_cmd()
- Don't check BUSY flag when sending new command
Diffstat (limited to 'drivers/spi/spi-stm32-qspi.c')
| -rw-r--r-- | drivers/spi/spi-stm32-qspi.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/spi/spi-stm32-qspi.c b/drivers/spi/spi-stm32-qspi.c index bf47a1452001..c0239e405c39 100644 --- a/drivers/spi/spi-stm32-qspi.c +++ b/drivers/spi/spi-stm32-qspi.c @@ -305,10 +305,8 @@ static int stm32_qspi_wait_cmd(struct stm32_qspi *qspi, u32 cr, sr; int err = 0; - if (!op->data.nbytes) - goto wait_nobusy; - - if (readl_relaxed(qspi->io_base + QSPI_SR) & SR_TCF) + if ((readl_relaxed(qspi->io_base + QSPI_SR) & SR_TCF) || + qspi->fmode == CCR_FMODE_APM) goto out; reinit_completion(&qspi->data_completion); @@ -327,7 +325,6 @@ static int stm32_qspi_wait_cmd(struct stm32_qspi *qspi, out: /* clear flags */ writel_relaxed(FCR_CTCF | FCR_CTEF, qspi->io_base + QSPI_FCR); -wait_nobusy: if (!err) err = stm32_qspi_wait_nobusy(qspi); @@ -372,10 +369,6 @@ static int stm32_qspi_send(struct spi_mem *mem, const struct spi_mem_op *op) op->dummy.buswidth, op->data.buswidth, op->addr.val, op->data.nbytes); - err = stm32_qspi_wait_nobusy(qspi); - if (err) - goto abort; - cr = readl_relaxed(qspi->io_base + QSPI_CR); cr &= ~CR_PRESC_MASK & ~CR_FSEL; cr |= FIELD_PREP(CR_PRESC_MASK, flash->presc); |
