From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sourav Poddar Date: Sat, 5 Oct 2013 11:42:15 +0530 Subject: [U-Boot] [UBOOT][PATCHv4 3/6] driver: mtd: spi: Add memory mapped read support In-Reply-To: References: <1380898293-13755-1-git-send-email-sourav.poddar@ti.com> <1380898293-13755-4-git-send-email-sourav.poddar@ti.com> Message-ID: <524FADBF.6050308@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Saturday 05 October 2013 01:36 AM, Jagan Teki wrote: > Please use the commit msg head as "sf: .." Ok. > On Fri, Oct 4, 2013 at 8:21 PM, Sourav Poddar wrote: >> 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 >> --- >> drivers/mtd/spi/sf_ops.c | 2 ++ >> drivers/mtd/spi/sf_probe.c | 1 + >> include/spi.h | 3 +++ >> 3 files changed, 6 insertions(+), 0 deletions(-) >> >> diff --git a/drivers/mtd/spi/sf_ops.c b/drivers/mtd/spi/sf_ops.c >> index c009af5..bee4128 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_MEM_MAP); >> memcpy(data, flash->memory_map + offset, len); >> + spi_xfer(flash->spi, 0, NULL, NULL, SPI_XFER_MEM_MAP); > Is it correct, can you check it once. > where is SPI_XFER_MEM_MAP_END used? It will be used in the driver. check 4/6 patch of this series. > Looks like you have used mem-map for only reads is it? if so where is > SPI_XFER_BEGIN is using? Yes, only memory mapped read is supported. Ideally, we dont need BEGIN flag for memory mapped cases. I have explained a bit more on your similar comment on patch 4/6. > Please use _MMAP instead of _MEM_MAP for simple naming convention. > OK.