From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergei Shtylyov Date: Tue, 10 Aug 2010 17:14:17 +0400 Subject: [U-Boot] [PATCH] Fixing spi erase for S25FL128P_256K In-Reply-To: References: Message-ID: <4C6150A9.4070600@mvista.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > --- > 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