[U-Boot] [PATCH v2 9/9] spi: spi_flash: Set Quad enable bit of upper flash

Siva Durga Prasad Paladugu siva.durga.paladugu at xilinx.com
Tue Jul 19 17:48:34 CEST 2016


Set quad enable for upper flash incase of
Dual stacked mode.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur at xilinx.com>
---
 drivers/mtd/spi/spi_flash.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 293b47b..5a152db 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -1237,6 +1237,17 @@ int spi_flash_scan(struct spi_flash *flash)
 			debug("SF: Fail to set QEB for %02x\n", idcode[0]);
 			return -EINVAL;
 		}
+#ifdef CONFIG_SF_DUAL_FLASH
+		if (flash->dual_flash & SF_DUAL_STACKED_FLASH) {
+			flash->spi->flags |= SPI_XFER_U_PAGE;
+			if (set_quad_mode(flash, idcode[0])) {
+				debug("SF: Fail to set QEB Upper Flash %02x\n",
+				      idcode[0]);
+				return 0;
+			}
+			flash->spi->flags &= ~SPI_XFER_U_PAGE;
+		}
+#endif
 	}
 
 	/* Read dummy_byte: dummy byte is determined based on the
-- 
2.7.4



More information about the U-Boot mailing list