[U-Boot] [PATCH v2 3/5] sf: Use mode_bits for dual_flash connection
Jagannadha Sutradharudu Teki
jagannadha.sutradharudu-teki at xilinx.com
Mon Jan 20 15:29:09 CET 2014
SF uses mode_bits from driver side for informing whether
flash can operated in single or dual connections.
Signed-off-by: Jagannadha Sutradharudu Teki <jaganna at xilinx.com>
Cc: Marek Vasut <marex at denx.de>
---
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 abde69b..a5f3046 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_bits & SPI_SHARED)
+ flash->dual_flash = SF_DUAL_STACKED_FLASH;
+ else if (flash->spi->mode_bits & 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