summaryrefslogtreecommitdiff
path: root/drivers/mtd/spi
diff options
context:
space:
mode:
authorPoddar, Sourav <sourav.poddar@ti.com>2013-10-07 15:53:01 +0530
committerJagannadha Sutradharudu Teki <jaganna@xilinx.com>2013-10-07 17:55:51 +0530
commit004f15b6000e220b74433b190e60805ce8776d92 (patch)
tree33fdceed2d361fffdc0d9f8f7f0282b425c0d978 /drivers/mtd/spi
parent62d206dc3126914f187cfb72e8a7c6cf84c19b7c (diff)
downloadu-boot-imx-004f15b6000e220b74433b190e60805ce8776d92.zip
u-boot-imx-004f15b6000e220b74433b190e60805ce8776d92.tar.gz
u-boot-imx-004f15b6000e220b74433b190e60805ce8776d92.tar.bz2
sf: Add memory mapped read support
Qspi controller can have a memory mapped port which can be used for data read. Added support to enable memory mapped port read. This patch enables the following: - It enables exchange of memory map address between mtd and qspi through the introduction of "memory_map" flag. - Add support to communicate to the driver that memory mapped transfer is to be started through introduction of new flags like "SPI_XFER_MEM_MAP" and "SPI_XFER_MEM_MAP_END". This will enable the spi controller to do memory mapped configurations if required. Signed-off-by: Sourav Poddar <sourav.poddar@ti.com> Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
Diffstat (limited to 'drivers/mtd/spi')
-rw-r--r--drivers/mtd/spi/sf_ops.c2
-rw-r--r--drivers/mtd/spi/sf_probe.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mtd/spi/sf_ops.c b/drivers/mtd/spi/sf_ops.c
index c009af5..2396e22 100644
--- a/drivers/mtd/spi/sf_ops.c
+++ b/drivers/mtd/spi/sf_ops.c
@@ -269,7 +269,9 @@ int spi_flash_cmd_read_ops(struct spi_flash *flash, u32 offset,
/* Handle memory-mapped SPI */
if (flash->memory_map) {
+ spi_xfer(flash->spi, 0, NULL, NULL, SPI_XFER_MMAP);
memcpy(data, flash->memory_map + offset, len);
+ spi_xfer(flash->spi, 0, NULL, NULL, SPI_XFER_MMAP_END);
return 0;
}
diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c
index 1525636..6aa7086 100644
--- a/drivers/mtd/spi/sf_probe.c
+++ b/drivers/mtd/spi/sf_probe.c
@@ -203,6 +203,7 @@ struct spi_flash *spi_flash_validate_params(struct spi_slave *spi, u8 *idcode)
flash->page_size = (ext_jedec == 0x4d00) ? 512 : 256;
flash->sector_size = params->sector_size;
flash->size = flash->sector_size * params->nr_sectors;
+ flash->memory_map = spi->memory_map;
/* Compute erase sector and command */
if (params->flags & SECT_4K) {