From patchwork Tue Apr 21 06:27:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuldeep Singh X-Patchwork-Id: 238161 List-Id: U-Boot discussion From: kuldeep.singh at nxp.com (Kuldeep Singh) Date: Tue, 21 Apr 2020 11:57:47 +0530 Subject: [Patch v2] spi: nxp-fspi: Add 1us delay to make controller ready for next transaction Message-ID: <1587450467-19721-1-git-send-email-kuldeep.singh@nxp.com> Board gets reset when performing burst read/write operations. On the other hand, no such behaviour is observed on small size operations. In Linux, readl_poll_timeout API already add delay of 1us which is skipped in U-boot. Since, NXP Flexspi U-boot driver is a ported version of Linux driver and U-boot poll_timeout API lacks delay functionality, add 1us delay so as to make controller ready for other transactions. Signed-off-by: Kuldeep Singh --- v1: Add comments above udelay(1) change. drivers/spi/nxp_fspi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/spi/nxp_fspi.c b/drivers/spi/nxp_fspi.c index 0e6c7be..1c6538c 100644 --- a/drivers/spi/nxp_fspi.c +++ b/drivers/spi/nxp_fspi.c @@ -757,6 +757,13 @@ static int nxp_fspi_exec_op(struct spi_slave *slave, FSPI_STS0_ARB_IDLE, 1, POLL_TOUT, true); WARN_ON(err); + /* + * Watchdog gets triggered for large read/write/erase since this + * delay is not present in this API(readl_poll_timeout), add + * this delay here. + */ + udelay(1); + nxp_fspi_prepare_lut(f, op); /* * If we have large chunks of data, we read them through the AHB bus