]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
sf: sf_probe: Get bank selection irrespective of qspi mode
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Tue, 17 Mar 2015 15:53:07 +0000 (21:23 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 18 Mar 2015 10:05:20 +0000 (11:05 +0100)
Get the current bank selection irrespective of qspi mode
from the flash device. This solves issue of erase, read and
write to wrong bank.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/mtd/spi/sf_probe.c

index 393947c61b5d5825af7f0a2525b8dd224a7e95d2..f0e434bd77436f1c7ecf870d792c3a48b421da8f 100644 (file)
@@ -350,15 +350,13 @@ static int spi_flash_validate_params(struct spi_slave *spi, u8 *idcode,
                flash->bank_write_cmd = (idcode[0] == 0x01) ?
                                        CMD_BANKADDR_BRWR : CMD_EXTNADDR_WREAR;
 
-               if (flash->dual_flash == SF_DUAL_PARALLEL_FLASH) {
-                       spi->flags |= SPI_XFER_LOWER;
-                       ret = spi_flash_read_common(flash,
-                                                    &flash->bank_read_cmd,
-                                                    1, &curr_bank, 1);
-                       if (ret) {
-                               debug("SF: fail to read bank addr register\n");
-                               return ret;
-                       }
+               spi->flags |= SPI_XFER_LOWER;
+               ret = spi_flash_read_common(flash,
+                                           &flash->bank_read_cmd,
+                                           1, &curr_bank, 1);
+               if (ret) {
+                       debug("SF: fail to read bank addr register\n");
+                       return ret;
                }
                flash->bank_curr = curr_bank;
        } else {