public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@mvista.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Fixing spi erase for S25FL128P_256K
Date: Tue, 10 Aug 2010 17:14:17 +0400	[thread overview]
Message-ID: <4C6150A9.4070600@mvista.com> (raw)
In-Reply-To: <AANLkTin4Rn+kK6xoBPXvMtnk6_e-SG58P6jxDs-jVX4B@mail.gmail.com>

Hello.

Marc-Andr? H?bert wrote:

> The spansion_erase currently only works when the sector size is 64KB.
> cmd[1] should contain the higher 8 bit of the 24 bit address of the
> sector to be erased. Currently it is holding the sector index to be
> erased which happens to be the same thing when the sector size is
> 64KB.

> Signed-off-by: Marc-Andre Hebert <marc-andre.hebert@humanware.com>
> ---
>  drivers/mtd/spi/spansion.c |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)

> diff --git a/drivers/mtd/spi/spansion.c b/drivers/mtd/spi/spansion.c
> index d6c1a5f..94489af 100644
> --- a/drivers/mtd/spi/spansion.c
> +++ b/drivers/mtd/spi/spansion.c
[...]
> @@ -274,8 +273,8 @@ int spansion_erase(struct spi_flash *flash, u32
> offset, size_t len)
>  	}
> 
>  	ret = 0;
> -	for (actual = 0; actual < len; actual++) {
> -		cmd[1] = (offset / sector_size) + actual;
> +	for (actual = 0; actual < len; actual+=sector_size) {

    Keep the  coding style consistent please -- add spaces around +=.

WBR, Sergei

  reply	other threads:[~2010-08-10 13:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-10 13:02 [U-Boot] [PATCH] Fixing spi erase for S25FL128P_256K Marc-André Hébert
2010-08-10 13:14 ` Sergei Shtylyov [this message]
2010-08-10 13:35   ` [U-Boot] [PATCH v2] " Marc-André Hébert
2010-08-10 20:55     ` Mike Frysinger
2010-08-11 11:23       ` Marc-André Hébert
2010-08-11 17:01         ` Mike Frysinger
2010-08-23 21:37 ` [U-Boot] [PATCH] " Mike Frysinger
2010-08-23 22:08   ` Mike Frysinger

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=4C6150A9.4070600@mvista.com \
    --to=sshtylyov@mvista.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