From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sourav Poddar Date: Sun, 6 Oct 2013 15:31:21 +0530 Subject: [U-Boot] [UBOOT][PATCHv4 3/6] driver: mtd: spi: Add memory mapped read support In-Reply-To: <20131006093329.GL14747@book.gsilab.sittig.org> References: <1380898293-13755-1-git-send-email-sourav.poddar@ti.com> <1380898293-13755-4-git-send-email-sourav.poddar@ti.com> <20131006093329.GL14747@book.gsilab.sittig.org> Message-ID: <525134F1.1020007@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 Sunday 06 October 2013 03:03 PM, Gerhard Sittig wrote: > On Fri, Oct 04, 2013 at 20:21 +0530, Sourav Poddar wrote: >> 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); >> return 0; >> } > Feedback has been sent before, but I'm afraid the motivation > wasn't received appropriately. Sorry, If I missed any mails. > Shouldn't the memcpy() call be surrounded by _MAP and _MAP_END > (please note the _END in the second spi_xfer() invocation)? The > current patch doesn't "close" the transfer, which appears to pass > tests but isn't correct. > > Yes, you are correct. Second xfer should be with a END flag. I will add it in my next version, thanks for pointing out. > virtually yours > Gerhard Sittig