diff mbox series

spi: nxp-fspi: Add 1us delay to make controller ready for next transaction

Message ID 1582543342-21393-1-git-send-email-kuldeep.singh@nxp.com
State New
Headers show
Series spi: nxp-fspi: Add 1us delay to make controller ready for next transaction | expand

Commit Message

Kuldeep Singh Feb. 24, 2020, 11:22 a.m. UTC
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 <kuldeep.singh at nxp.com>
---
 drivers/spi/nxp_fspi.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jagan Teki April 3, 2020, 2:39 p.m. UTC | #1
On Mon, Feb 24, 2020 at 4:52 PM Kuldeep Singh <kuldeep.singh at nxp.com> wrote:
>
> 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 <kuldeep.singh at nxp.com>
> ---
>  drivers/spi/nxp_fspi.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/spi/nxp_fspi.c b/drivers/spi/nxp_fspi.c
> index 0e6c7be..9703642 100644
> --- a/drivers/spi/nxp_fspi.c
> +++ b/drivers/spi/nxp_fspi.c
> @@ -756,6 +756,7 @@ static int nxp_fspi_exec_op(struct spi_slave *slave,
>         err = fspi_readl_poll_tout(f, f->iobase + FSPI_STS0,
>                                    FSPI_STS0_ARB_IDLE, 1, POLL_TOUT, true);
>         WARN_ON(err);
> +       udelay(1);

Can you add relevant comments here, why is it for udelay(1) ?
Ashish Kumar April 16, 2020, 8:48 a.m. UTC | #2
> -----Original Message-----
> From: U-Boot <u-boot-bounces at lists.denx.de> On Behalf Of Jagan Teki
> Sent: Friday, April 3, 2020 8:09 PM
> To: Kuldeep Singh <kuldeep.singh at nxp.com>
> Cc: U-Boot-Denx <u-boot at lists.denx.de>
> Subject: [EXT] Re: [PATCH] spi: nxp-fspi: Add 1us delay to make controller
> ready for next transaction
> 
> Caution: EXT Email
> 
> On Mon, Feb 24, 2020 at 4:52 PM Kuldeep Singh <kuldeep.singh at nxp.com>
> wrote:
> >
> > 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 <kuldeep.singh at nxp.com>
> > ---
> >  drivers/spi/nxp_fspi.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/spi/nxp_fspi.c b/drivers/spi/nxp_fspi.c index
> > 0e6c7be..9703642 100644
> > --- a/drivers/spi/nxp_fspi.c
> > +++ b/drivers/spi/nxp_fspi.c
> > @@ -756,6 +756,7 @@ static int nxp_fspi_exec_op(struct spi_slave *slave,
> >         err = fspi_readl_poll_tout(f, f->iobase + FSPI_STS0,
> >                                    FSPI_STS0_ARB_IDLE, 1, POLL_TOUT, true);
> >         WARN_ON(err);
> > +       udelay(1);
> 
> Can you add relevant comments here, why is it for udelay(1) ?
Hi Jagan,
 
Watchdog gets triggered for large read/write/erase since this delay is not present in this API(readl_poll_timeout), add this delay here.

Regards
Ashish
diff mbox series

Patch

diff --git a/drivers/spi/nxp_fspi.c b/drivers/spi/nxp_fspi.c
index 0e6c7be..9703642 100644
--- a/drivers/spi/nxp_fspi.c
+++ b/drivers/spi/nxp_fspi.c
@@ -756,6 +756,7 @@  static int nxp_fspi_exec_op(struct spi_slave *slave,
 	err = fspi_readl_poll_tout(f, f->iobase + FSPI_STS0,
 				   FSPI_STS0_ARB_IDLE, 1, POLL_TOUT, true);
 	WARN_ON(err);
+	udelay(1);
 
 	nxp_fspi_prepare_lut(f, op);
 	/*