From: Reinhard Meyer <u-boot@emk-elektronik.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] Fix timer usage of the Atmel SPI dataflash driver
Date: Mon, 18 Apr 2011 12:36:23 +0200 [thread overview]
Message-ID: <4DAC1427.7060706@emk-elektronik.de> (raw)
In-Reply-To: <1296168378-8399-1-git-send-email-linux@bohmer.net>
Dear Remy Bohmer,
> Signed-off-by: Remy Bohmer <linux@bohmer.net>
> ---
> drivers/spi/atmel_dataflash_spi.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/spi/atmel_dataflash_spi.c b/drivers/spi/atmel_dataflash_spi.c
> index 4a5c4aa..2f23f54 100644
> --- a/drivers/spi/atmel_dataflash_spi.c
> +++ b/drivers/spi/atmel_dataflash_spi.c
> @@ -133,7 +133,7 @@ unsigned int AT91F_SpiWrite1(AT91PS_DataflashDesc pDesc);
>
> unsigned int AT91F_SpiWrite(AT91PS_DataflashDesc pDesc)
> {
> - unsigned int timeout;
> + u32 time_start, timeout;
>
> pDesc->state = BUSY;
>
> @@ -158,12 +158,12 @@ unsigned int AT91F_SpiWrite(AT91PS_DataflashDesc pDesc)
> }
>
> /* arm simple, non interrupt dependent timer */
> - reset_timer_masked();
> - timeout = 0;
> + time_start = get_timer(0);
>
> writel(AT91_SPI_TXTEN + AT91_SPI_RXTEN, AT91_BASE_SPI + AT91_SPI_PTCR);
> while (!(readl(AT91_BASE_SPI + AT91_SPI_SR) & AT91_SPI_RXBUFF) &&
> - ((timeout = get_timer_masked()) < CONFIG_SYS_SPI_WRITE_TOUT));
> + ((timeout = get_timer(time_start)) < CONFIG_SYS_SPI_WRITE_TOUT));
> +
> writel(AT91_SPI_TXTDIS + AT91_SPI_RXTDIS, AT91_BASE_SPI + AT91_SPI_PTCR);
> pDesc->state = IDLE;
This issue had already been fixed by the ATMEL rework.
But you are welcome to further "fix" this driver to use structure SoC access ;)
Best Regards, Reinhard
prev parent reply other threads:[~2011-04-18 10:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-27 22:46 [U-Boot] [PATCH 1/2] Fix timer usage of the Atmel SPI dataflash driver Remy Bohmer
2011-01-27 22:46 ` [U-Boot] [PATCH 2/2] at91sam9261ek: make operational again Remy Bohmer
2011-01-27 22:49 ` Remy Bohmer
2011-01-27 23:11 ` Albert ARIBAUD
2011-01-28 20:38 ` Remy Bohmer
2011-02-01 10:45 ` Michael Trimarchi
2011-02-01 12:16 ` Albert ARIBAUD
2011-02-01 19:11 ` Michael Trimarchi
2011-02-01 19:31 ` Remy Bohmer
2011-02-01 19:54 ` Reinhard Meyer
2011-02-05 12:54 ` Remy Bohmer
2011-04-18 10:36 ` Reinhard Meyer [this message]
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=4DAC1427.7060706@emk-elektronik.de \
--to=u-boot@emk-elektronik.de \
--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