RE: [PATCH] Add support for packet synchronised sDMA transfers.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Hari,

Thanks for your comment.
What you're saying is perfectly true, however I find current way is a bit awkward and potentially dangerous if for any reason value of OMAP_DMA_SYNC_PACKET changes in the future, or if more constants are defined later on.

I think proposed patch improves the readability of the code and makes it clearer to developers what DMA synchronisations are supported.

Regards,

Fabrice



Texas Instruments France SA, 821 Avenue Jack Kilby, 06270 Villeneuve Loubet. 036 420 040 R.C.S Antibes. Capital de EUR 753.920

-----Original Message-----

From: hari n [mailto:hari.zoom@xxxxxxxxx]
Sent: 03 March 2010 14:03
To: Goucem, Fabrice
Cc: linux-omap@xxxxxxxxxxxxxxx
Subject: Re: [PATCH] Add support for packet synchronised sDMA transfers.

I believe, packet mode is already supported in the current DMA driver.
Both the FS and BS bits of the CCR are set when packet mode is selected. This is because, enum for OMAP_DMA_SYNC_PACKET is '0x03'
(i.e OMAP_DMA_SYNC_FRAME | OMAP_DMA_SYNC_BLOCK).


On Wed, Mar 3, 2010 at 4:20 AM, Fabrice Goucem <f-goucem@xxxxxx> wrote:
> System DMA packet synchronisation is currently not supported in the
> Linux Kernel.
> This patch provides necessary modifications to support packet
> synchronisation:
> Function omap_set_dma_transfer_params() handles value
> OMAP_DMA_SYNC_PACKET to program FS and BS bits of register CCR.
> Users can give the packet size to the DMA driver by using parameters
> src_fi / dst_fi in functions omap_set_dma_src_params() /
> omap_set_dma_dest_params().
>
> Patch has been validated using OMAP's McSPI (on Zoom2, OMAP3430):
> McSPI is configured to use DMA transfer.
> FIFO are activated with a threshold of 16 bytes (i.e. DMA requests
> will be triggered as soon as more than 16 bytes are free in the FIFO).
> A frame of 132 elements (bytes) has been transfered, by packets of 16
> elements. Resulting transfer was 8 packets of 16 elements plus a last
> packet of 4 elements.
>
> Modifications tested building on OMAP2, OMAP3 and OMAP4 configurations.
>
> Signed-off-by: Fabrice Goucem <f-goucem@xxxxxx>
> Acked-by: Venkatraman S <svenkatr@xxxxxx>
> Acked-by: Santosh Shilimkar <santosh.shilimkar@xxxxxx>
> Acked-by: Shilpa Maddi <s-maddi@xxxxxx>
> ---
>  arch/arm/plat-omap/dma.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index
> 2ab224c..48f9355 100644
> --- a/arch/arm/plat-omap/dma.c
> +++ b/arch/arm/plat-omap/dma.c
> @@ -293,12 +293,14 @@ void omap_set_dma_transfer_params(int lch, int
> data_type, int elem_count,
>                val |= (dma_trigger & ~0x1f) << 14;
>                val |= dma_trigger & 0x1f;
>
> -               if (sync_mode & OMAP_DMA_SYNC_FRAME)
> +               if ((sync_mode == OMAP_DMA_SYNC_FRAME) ||
> +                   (sync_mode == OMAP_DMA_SYNC_PACKET))
>                        val |= 1 << 5;
>                else
>                        val &= ~(1 << 5);
>
> -               if (sync_mode & OMAP_DMA_SYNC_BLOCK)
> +               if ((sync_mode == OMAP_DMA_SYNC_BLOCK) ||
> +                   (sync_mode == OMAP_DMA_SYNC_PACKET))
>                        val |= 1 << 18;
>                else
>                        val &= ~(1 << 18);
> --
> 1.6.0.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap"
> in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo
> info at  http://vger.kernel.org/majordomo-info.html
>

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux