From: Jagannadha Sutradharudu Teki Date: Tue, 28 May 2013 10:29:57 +0000 (+0530) Subject: sf: Fix dual stacked mode upper qspi read X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1588eaa4788d6b81f820ada62e59dfb083afef78;p=thirdparty%2Fu-boot.git sf: Fix dual stacked mode upper qspi read For reading upper qspi in dual stacked mode, the remain_len logic should have a bank_sel based on the total size of the flash, not with half of total size. Signed-off-by: Jagannadha Sutradharudu Teki --- diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c index af534670246..bd679bf5e49 100644 --- a/drivers/mtd/spi/spi_flash.c +++ b/drivers/mtd/spi/spi_flash.c @@ -209,6 +209,9 @@ int spi_flash_cmd_read_fast(struct spi_flash *flash, u32 offset, return ret; } + if ((is_dual == MODE_DUAL_STACKED) && (flash->spi->u_page == 1)) + bank_sel += ((flash->size / 2) / bank_boun); + remain_len = (bank_boun * (bank_sel + 1) - offset); if (len < remain_len) read_len = len;