[U-Boot] [PATCH 4/5] sf: spansion|stmicro: Enable dual stacked access

Jagannadha Sutradharudu Teki jagannadha.sutradharudu-teki at xilinx.com
Mon Jul 29 17:23:42 CEST 2013


Dual stacked accessing can be done by updating flash part
attributes like sector_size*2

Signed-off-by: Jagannadha Sutradharudu Teki <jaganna at xilinx.com>
---
 drivers/mtd/spi/spansion.c | 3 +++
 drivers/mtd/spi/stmicro.c  | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/drivers/mtd/spi/spansion.c b/drivers/mtd/spi/spansion.c
index a4ea16b..49ee842 100644
--- a/drivers/mtd/spi/spansion.c
+++ b/drivers/mtd/spi/spansion.c
@@ -140,6 +140,9 @@ struct spi_flash *spi_flash_probe_spansion(struct spi_slave *spi, u8 *idcode)
 		flash->sector_size *= 2;
 	}
 
+	if (flash->spi->is_dual == SPI_FLASH_CONN_DUALSTACKED)
+		flash->sector_size *= 2;
+
 	flash->size = flash->sector_size * params->nr_sectors;
 
 	return flash;
diff --git a/drivers/mtd/spi/stmicro.c b/drivers/mtd/spi/stmicro.c
index e9b4bc6..a701571 100644
--- a/drivers/mtd/spi/stmicro.c
+++ b/drivers/mtd/spi/stmicro.c
@@ -198,6 +198,9 @@ struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 * idcode)
 		flash->sector_size *= 2;
 	}
 
+	if (flash->spi->is_dual == SPI_FLASH_CONN_DUALSTACKED)
+		flash->sector_size *= 2;
+
 	flash->size = flash->sector_size * params->nr_sectors;
 
 	/* for >= 512MiB flashes, use flag status instead of read_status */
-- 
1.8.3




More information about the U-Boot mailing list