Patchwork [U-Boot,2/5] sf: spansion|stmicro: Enable dual parallel access

login
register
mail settings
Submitter Jagannadha Sutradharudu Teki
Date July 29, 2013, 3:23 p.m.
Message ID <24d9edeb-836e-494d-a328-6b7bcada097a@AM1EHSMHS001.ehs.local>
Download mbox | patch
Permalink /patch/262839/
State Superseded
Delegated to: Jagannadha Sutradharudu Teki
Headers show

Comments

Jagannadha Sutradharudu Teki - July 29, 2013, 3:23 p.m.
Dual parallel accessing can be done by updating flash part
attributes like page_size*2, sector_size*2

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

Patch

diff --git a/drivers/mtd/spi/spansion.c b/drivers/mtd/spi/spansion.c
index 47a4897..a4ea16b 100644
--- a/drivers/mtd/spi/spansion.c
+++ b/drivers/mtd/spi/spansion.c
@@ -134,6 +134,12 @@  struct spi_flash *spi_flash_probe_spansion(struct spi_slave *spi, u8 *idcode)
 
 	flash->page_size = 256;
 	flash->sector_size = 256 * params->pages_per_sector;
+
+	if (flash->spi->is_dual == SPI_FLASH_CONN_DUALPARALLEL) {
+		flash->page_size *= 2;
+		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 0ca00f1..e9b4bc6 100644
--- a/drivers/mtd/spi/stmicro.c
+++ b/drivers/mtd/spi/stmicro.c
@@ -192,6 +192,12 @@  struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 * idcode)
 
 	flash->page_size = 256;
 	flash->sector_size = 256 * params->pages_per_sector;
+
+	if (flash->spi->is_dual == SPI_FLASH_CONN_DUALPARALLEL) {
+		flash->page_size *= 2;
+		flash->sector_size *= 2;
+	}
+
 	flash->size = flash->sector_size * params->nr_sectors;
 
 	/* for >= 512MiB flashes, use flag status instead of read_status */