diff options
author | Mark Brown <broonie@kernel.org> | 2022-05-11 21:48:07 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-05-11 21:48:07 +0300 |
commit | d5efbfc5210cc7ce8e413278da0dc4b7ccbe5bb7 (patch) | |
tree | 723be8852798ef09e5e9b253fc9efbba75917fe2 /drivers/spi/spi-stm32-qspi.c | |
parent | 0d8688298d6a43f2e187dad1e45871248123764f (diff) | |
parent | ae16cc18f37bcdea7d4ef57a5e526a60b09a1506 (diff) | |
download | linux-d5efbfc5210cc7ce8e413278da0dc4b7ccbe5bb7.tar.xz |
spi: stm32-qspi: flags management fixes
Merge series from patrice.chotard@foss.st.com <patrice.chotard@foss.st.com>
Patrice Chotard <patrice.chotard@foss.st.com>:
From: Patrice Chotard <patrice.chotard@foss.st.com>
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); |