]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
spi: spi_flash: Set quad enable for macronix upper flash
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Fri, 20 Jan 2017 09:45:00 +0000 (15:15 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 23 Jan 2017 08:48:46 +0000 (09:48 +0100)
Set quad enable bit for upper flash as well in case of
dual parallel when using generic qspi.

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 eee7a7fa4eb5c4479befcfaa0d6173f556838cee..169c3ea93dfd6426df88e1e2742250629d34fcab 100644 (file)
@@ -1045,9 +1045,21 @@ static int macronix_quad_enable(struct spi_flash *flash)
        ) {
                debug("SF: mxic: QEB is already set\n");
        } else {
+#ifdef CONFIG_SPI_GENERIC
+               if (flash->dual_flash & SF_DUAL_PARALLEL_FLASH)
+                       flash->spi->flags |= SPI_XFER_LOWER;
+#endif
                ret = write_sr(flash, STATUS_QEB_MXIC);
                if (ret < 0)
                        return ret;
+#ifdef CONFIG_SPI_GENERIC
+               if (flash->dual_flash & SF_DUAL_PARALLEL_FLASH) {
+                       flash->spi->flags |= SPI_XFER_UPPER;
+                       ret = write_sr(flash, STATUS_QEB_MXIC);
+                       if (ret < 0)
+                               return ret;
+               }
+#endif
        }
 
        return ret;