From: York Sun <yorksun@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/1] fsl_qspi: Pet the watchdog while reading/writing
Date: Mon, 23 Nov 2015 10:51:49 -0800 [thread overview]
Message-ID: <56536045.6090204@freescale.com> (raw)
In-Reply-To: <1446625150-5677-1-git-send-email-alexander.stein@systec-electronic.com>
On 11/04/2015 12:19 AM, Alexander Stein wrote:
> When reading a large blob. e.g. a linux kernel (several MiBs) a watchdog
> timeout might occur meanwhile. So pet the watchdog while operating on
> the flash.
Alexander,
On which platform was this watchdog issue found?
>
> Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
> ---
> drivers/spi/fsl_qspi.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c
> index ed39114..feec3e8 100644
> --- a/drivers/spi/fsl_qspi.c
> +++ b/drivers/spi/fsl_qspi.c
> @@ -13,6 +13,7 @@
> #include <linux/sizes.h>
> #include <dm.h>
> #include <errno.h>
> +#include <watchdog.h>
> #include "fsl_qspi.h"
>
> DECLARE_GLOBAL_DATA_PTR;
> @@ -527,6 +528,8 @@ static void qspi_op_read(struct fsl_qspi_priv *priv, u32 *rxbuf, u32 len)
> to_or_from = priv->sf_addr + priv->cur_amba_base;
>
> while (len > 0) {
> + WATCHDOG_RESET();
> +
> qspi_write32(priv->flags, ®s->sfar, to_or_from);
>
> size = (len > RX_BUFFER_SIZE) ?
> @@ -574,6 +577,8 @@ static void qspi_op_write(struct fsl_qspi_priv *priv, u8 *txbuf, u32 len)
>
> status_reg = 0;
> while ((status_reg & FLASH_STATUS_WEL) != FLASH_STATUS_WEL) {
> + WATCHDOG_RESET();
> +
> qspi_write32(priv->flags, ®s->ipcr,
> (SEQID_WREN << QSPI_IPCR_SEQID_SHIFT) | 0);
> while (qspi_read32(priv->flags, ®s->sr) & QSPI_SR_BUSY_MASK)
>
York
next prev parent reply other threads:[~2015-11-23 18:51 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-04 8:19 [U-Boot] [PATCH 1/1] fsl_qspi: Pet the watchdog while reading/writing Alexander Stein
2015-11-23 18:51 ` York Sun [this message]
2015-11-24 7:19 ` Alexander Stein
2015-11-24 20:44 ` York Sun
2015-11-25 2:20 ` Huan Wang
2015-11-25 9:33 ` Alexander Stein
2015-12-03 9:49 ` Huan Wang
2015-12-03 10:04 ` Alexander Stein
2015-12-04 1:38 ` Huan Wang
2015-12-03 16:06 ` York Sun
2015-12-04 1:56 ` Huan Wang
2015-12-04 20:10 ` York Sun
2015-12-07 6:39 ` Alexander Stein
2015-12-02 17:49 ` York Sun
2015-12-04 20:54 ` Fabio Estevam
2015-12-04 21:00 ` York Sun
2015-12-07 6:35 ` Alexander Stein
2015-12-15 1:06 ` York Sun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56536045.6090204@freescale.com \
--to=yorksun@freescale.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox