]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
spi: spi_flash: Fix the incorrect check for going to 3-byte mode
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Fri, 30 Jun 2017 11:16:00 +0000 (16:46 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 4 Jul 2017 06:20:39 +0000 (08:20 +0200)
It should go to 3-byte mode if flash size is less than or
equal to 16MiB. This patch corrects the if condition for
going to 3-byte mode.

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

index 0f05cfa902369c7d48f0cbae75045dd9c800048a..e39416294cc774d0f065902485c4ef9b9d0901be 100644 (file)
@@ -1343,7 +1343,7 @@ int spi_flash_scan(struct spi_flash *flash)
         * and make sure the chip (> 16MiB) in default 3-byte address mode,
         * in case of warm bootup, the chip was set to 4-byte mode in kernel.
         */
-       if (((flash->size >> flash->shift) < SPI_FLASH_16MB_BOUN) &&
+       if (((flash->size >> flash->shift) <= SPI_FLASH_16MB_BOUN) &&
            (flash->spi->bytemode == SPI_4BYTE_MODE))
                /*
                 * Clear the 4-byte support if the flash size is