[U-Boot] [UBOOT][PATCHv4 3/6] driver: mtd: spi: Add memory mapped read support

Jagan Teki jagannadh.teki at gmail.com
Fri Oct 4 22:06:24 CEST 2013


Please use the commit msg head as "sf: .."

On Fri, Oct 4, 2013 at 8:21 PM, Sourav Poddar <sourav.poddar at ti.com> 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 <sourav.poddar at ti.com>
> ---
>  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?

Looks like you have used mem-map for only reads is it? if so where is
SPI_XFER_BEGIN is using?
Please use _MMAP instead of _MEM_MAP for simple naming convention.

-- 
Thanks,
Jagan.
--------
Jagannadha Sutradharudu Teki,
E: jagannadh.teki at gmail.com, P: +91-9676773388
Engineer - System Software Hacker
U-boot - SPI Custodian and Zynq APSOC
Ln: http://www.linkedin.com/in/jaganteki


More information about the U-Boot mailing list