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>
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 {