All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/6] sf: sf_ops: use dma to copy data from mmap region if platform supports
Date: Tue, 1 Dec 2015 14:54:40 -0700	[thread overview]
Message-ID: <CAPnjgZ1nuWoWN8j76SQtA1tYH_Et0NW+M1aYoh=CpEEi1zEG5Q@mail.gmail.com> (raw)
In-Reply-To: <1448968398-8270-4-git-send-email-mugunthanvnm@ti.com>

Hi,

On 1 December 2015 at 04:13, Mugunthan V N <mugunthanvnm@ti.com> wrote:
> Add dma memcpy api to the default spi_flash_copy_mmap(), so that
> dma will be used to copy data when DM_DMA is defined for the
> platform.
>
> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
> ---
>  drivers/mtd/spi/sf_ops.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/mtd/spi/sf_ops.c b/drivers/mtd/spi/sf_ops.c
> index 3a56d7f..3c83f8a 100644
> --- a/drivers/mtd/spi/sf_ops.c
> +++ b/drivers/mtd/spi/sf_ops.c
> @@ -16,6 +16,7 @@
>  #include <watchdog.h>
>  #include <linux/compiler.h>
>  #include <linux/log2.h>
> +#include <dma.h>
>
>  #include "sf_internal.h"
>
> @@ -389,6 +390,10 @@ int spi_flash_read_common(struct spi_flash *flash, const u8 *cmd,
>
>  void __weak spi_flash_copy_mmap(void *data, void *offset, size_t len)
>  {
> +#ifdef CONFIG_DM_DMA
> +       if (!dma_memcpy(data, offset, len))
> +               return;
> +#endif
>         memcpy(data, offset, len);
>  }
>
> --
> 2.6.3.368.gf34be46
>

This looks like one driver (SPI flash) calling a weak function in
another (SPI). Why isn't this done with the driver interface?

Regards,
Simon

  reply	other threads:[~2015-12-01 21:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-01 11:13 [U-Boot] [PATCH 0/6] add dma uclass implementation and adopt ti-edma3 to it Mugunthan V N
2015-12-01 11:13 ` [U-Boot] [PATCH 1/6] dm: implement a DMA uclass Mugunthan V N
2015-12-01 21:54   ` Simon Glass
2015-12-02  8:17     ` Mugunthan V N
2015-12-02  9:11       ` Mugunthan V N
2015-12-01 11:13 ` [U-Boot] [PATCH 2/6] dma: Kconfig: Add TI_EDMA3 entry Mugunthan V N
2015-12-01 21:54   ` Simon Glass
2015-12-01 11:13 ` [U-Boot] [PATCH 3/6] sf: sf_ops: use dma to copy data from mmap region if platform supports Mugunthan V N
2015-12-01 21:54   ` Simon Glass [this message]
2015-12-02  9:45     ` Mugunthan V N
2015-12-02 21:05       ` Simon Glass
2015-12-01 11:13 ` [U-Boot] [PATCH 4/6] spi: ti_qspi: compile out spi_flash_copy_mmap when DM_DMA is defined Mugunthan V N
2015-12-01 21:54   ` Simon Glass
2015-12-01 11:13 ` [U-Boot] [PATCH 5/6] drivers: dma: ti-edma3: convert driver to adopt driver model Mugunthan V N
2015-12-01 21:54   ` Simon Glass
2015-12-02  9:47     ` Mugunthan V N
2015-12-01 11:13 ` [U-Boot] [PATCH 6/6] defconfig: am437x_sk_evm: enable dma " Mugunthan V N
2015-12-01 21:54   ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPnjgZ1nuWoWN8j76SQtA1tYH_Et0NW+M1aYoh=CpEEi1zEG5Q@mail.gmail.com' \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.