]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
spi: spi_flash: Don't read bank address register in 4-byte mode
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Fri, 13 Apr 2018 11:13:16 +0000 (16:43 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 23 Apr 2018 06:57:39 +0000 (08:57 +0200)
There is no need to read bank address register when working
in 4-byte mode and hence bypass it.

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

index 15d91a7f7e60e07eb5ff32552420ba828e056488..8e79a4a125a78876ab5e363e82702b59023cb54a 100644 (file)
@@ -1566,9 +1566,11 @@ int spi_flash_scan(struct spi_flash *flash)
 
        /* Configure the BAR - discover bank cmds and read current bank */
 #ifdef CONFIG_SPI_FLASH_BAR
-       ret = read_bar(flash, info);
-       if (ret < 0)
-               return ret;
+       if (flash->spi->bytemode != SPI_4BYTE_MODE) {
+               ret = read_bar(flash, info);
+               if (ret < 0)
+                       return ret;
+       }
 #endif
 
 #if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)