]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
mtd: spi-nor: Added support to check addressing mode before calling clean_bar()
authorVipul Kumar <vipul.kumar@xilinx.com>
Tue, 16 Jan 2018 10:48:00 +0000 (16:18 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 31 Jan 2018 12:15:49 +0000 (13:15 +0100)
SPI erase, write and read operations were not happening properly and due to
this compare operation was getting failed. This patch checks addressing
mode before calling clean_bar() function. There is no need to set bank
address in 4 bytes addressing mode. This is to be inline with write_bar()
function.

Signed-off-by: Vipul Kumar <vipulk@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/mtd/spi/spi_flash.c

index 506f6e0e178b7ce3aa9508dc253755fa57557581..994681281da40e66012cd5b29afbb40cbd4e684f 100644 (file)
@@ -508,9 +508,11 @@ int spi_flash_cmd_erase_ops(struct spi_flash *flash, u32 offset, size_t len)
                len -= erase_size;
        }
 
+       if (flash->spi->bytemode != SPI_4BYTE_MODE) {
 #ifdef CONFIG_SPI_FLASH_BAR
-       ret = clean_bar(flash);
+               ret = clean_bar(flash);
 #endif
+       }
 
        return ret;
 }
@@ -587,9 +589,11 @@ int spi_flash_cmd_write_ops(struct spi_flash *flash, u32 offset,
                offset += chunk_len;
        }
 
+       if (flash->spi->bytemode != SPI_4BYTE_MODE) {
 #ifdef CONFIG_SPI_FLASH_BAR
-       ret = clean_bar(flash);
+               ret = clean_bar(flash);
 #endif
+       }
 
        return ret;
 }
@@ -746,9 +750,11 @@ int spi_flash_cmd_read_ops(struct spi_flash *flash, u32 offset,
 
        spi->dummy_bytes = 0;
 
+       if (flash->spi->bytemode != SPI_4BYTE_MODE) {
 #ifdef CONFIG_SPI_FLASH_BAR
-       ret = clean_bar(flash);
+               ret = clean_bar(flash);
 #endif
+       }
 
        free(cmd);
        return ret;