]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
sf: Fix dual stacked mode upper qspi read
authorJagannadha Sutradharudu Teki <jaganna@xilinx.com>
Tue, 28 May 2013 10:29:57 +0000 (15:59 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 28 May 2013 16:20:46 +0000 (18:20 +0200)
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 <jaganna@xilinx.com>
drivers/mtd/spi/spi_flash.c

index af53467024649a2810aa0253e71fb0aec7ab0c02..bd679bf5e493504916b503baf26f12cf4728582a 100644 (file)
@@ -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;