[U-Boot] [PATCH 2/5] sf: spansion|stmicro: Enable dual parallel access
Jagannadha Sutradharudu Teki
jagannadha.sutradharudu-teki at xilinx.com
Mon Jul 29 17:23:40 CEST 2013
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 at xilinx.com>
---
drivers/mtd/spi/spansion.c | 6 ++++++
drivers/mtd/spi/stmicro.c | 6 ++++++
2 files changed, 12 insertions(+)
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 */
--
1.8.3
More information about the U-Boot
mailing list