]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
sf: Set QUAD enable of upper flash in Dual Stacked
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Mon, 24 Feb 2014 06:06:55 +0000 (11:36 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 9 Sep 2014 12:42:41 +0000 (14:42 +0200)
Sets the QUAD enable bit for upper flash incase of
dual stacked mode.
This fixes the issue of where the quad enable bit
of the upperflash was not set and hence not able
to access the upperflash using quad commands in
Dual stacked mode.

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

index 970a415127c22309982d0da97f848a6fe8bbad83..114627052a57d7022aa90ae4c03584cf2b8adc59 100644 (file)
@@ -197,6 +197,27 @@ static struct spi_flash *spi_flash_validate_params(struct spi_slave *spi,
                /* Go for default supported write cmd */
                flash->write_cmd = CMD_PAGE_PROGRAM;
 
+       /* Set the quad enable bit - only for quad commands */
+       if ((flash->read_cmd == CMD_READ_QUAD_OUTPUT_FAST) ||
+           (flash->read_cmd == CMD_READ_QUAD_IO_FAST) ||
+           (flash->write_cmd == CMD_QUAD_PAGE_PROGRAM)) {
+               if (spi_flash_set_qeb(flash, idcode[0])) {
+                       debug("SF: Fail to set QEB for %02x\n", idcode[0]);
+                       return NULL;
+               }
+#ifdef CONFIG_SF_DUAL_FLASH
+               if (flash->dual_flash & SF_DUAL_STACKED_FLASH) {
+                       flash->spi->flags |= SPI_XFER_U_PAGE;
+                       if (spi_flash_set_qeb(flash, idcode[0])) {
+                               debug("SF: Fail to set QEB Upper Flash %02x\n",
+                                     idcode[0]);
+                               return NULL;
+                       }
+                       flash->spi->flags &= ~SPI_XFER_U_PAGE;
+               }
+#endif
+       }
+
        /* Read dummy_byte: dummy byte is determined based on the
         * dummy cycles of a particular command.
         * Fast commands - dummy_byte = dummy_cycles/8