[U-Boot] [PATCH v4 3/5] sf: Use slave mode for dual_flash connection

Jagannadha Sutradharudu Teki jagannadha.sutradharudu-teki at xilinx.com
Tue Feb 4 17:06:15 CET 2014


SF uses mode from driver side for informing whether
flash can operated in single or dual connections.

Signed-off-by: Jagannadha Sutradharudu Teki <jaganna at xilinx.com>
---
 drivers/mtd/spi/sf_probe.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c
index 036f48d..22b6335 100644
--- a/drivers/mtd/spi/sf_probe.c
+++ b/drivers/mtd/spi/sf_probe.c
@@ -123,7 +123,6 @@ static struct spi_flash *spi_flash_validate_params(struct spi_slave *spi,
 	flash->spi = spi;
 	flash->name = params->name;
 	flash->memory_map = spi->memory_map;
-	flash->dual_flash = flash->spi->option;
 
 	/* Assign spi_flash ops */
 	flash->read = spi_flash_cmd_read_ops;
@@ -133,7 +132,13 @@ static struct spi_flash *spi_flash_validate_params(struct spi_slave *spi,
 	if (params->flags & SST_WP)
 		flash->write = sst_write_wp;
 #endif
-
+	/* Get the dual flash connection modes */
+#ifdef CONFIG_SF_DUAL_FLASH
+	if (flash->spi->mode & SPI_SHARED)
+		flash->dual_flash = SF_DUAL_STACKED_FLASH;
+	else if (flash->spi->mode & SPI_SEPARATED)
+		flash->dual_flash = SF_DUAL_PARALLEL_FLASH;
+#endif
 	/* Compute the flash size */
 	flash->shift = (flash->dual_flash & SF_DUAL_PARALLEL_FLASH) ? 1 : 0;
 	flash->page_size = ((ext_jedec == 0x4d00) ? 512 : 256) << flash->shift;
-- 
1.8.3




More information about the U-Boot mailing list