Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1530061 > unrolled thread

Re: [PATCH v2 2/2] dmaengine: omap-dma: Support for slave devices with data port window

Started byPeter Ujfalusi <peter.ujfalusi@ti.com>
First post2016-11-25 10:40 +0100
Last post2016-11-29 04:10 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v2 2/2] dmaengine: omap-dma: Support for slave devices  with data port window Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-11-25 10:40 +0100
    Re: [PATCH v2 2/2] dmaengine: omap-dma: Support for slave devices  with data port window Vinod Koul <vinod.koul@intel.com> - 2016-11-29 04:10 +0100

#1530061 — Re: [PATCH v2 2/2] dmaengine: omap-dma: Support for slave devices with data port window

FromPeter Ujfalusi <peter.ujfalusi@ti.com>
Date2016-11-25 10:40 +0100
SubjectRe: [PATCH v2 2/2] dmaengine: omap-dma: Support for slave devices with data port window
Message-ID<sHl97-7fg-23@gated-at.bofh.it>

On 11/25/2016 08:12 AM, Vinod Koul wrote:
> On Thu, Nov 17, 2016 at 02:50:17PM +0200, Peter Ujfalusi wrote:
>> @@ -921,11 +931,45 @@ static struct dma_async_tx_descriptor *omap_dma_prep_slave_sg(
>>  
>>  	d->ccr = c->ccr | CCR_SYNC_FRAME;
>>  	if (dir == DMA_DEV_TO_MEM) {
>> -		d->ccr |= CCR_DST_AMODE_POSTINC | CCR_SRC_AMODE_CONSTANT;
>>  		d->csdp = CSDP_DST_BURST_64 | CSDP_DST_PACKED;
>> +
>> +		d->ccr |= CCR_DST_AMODE_POSTINC;
>> +		if (port_window) {
>> +			d->ccr |= CCR_SRC_AMODE_DBLIDX;
>> +			d->ei = 1;
>> +			/*
>> +			 * One frame covers the port_window and by  configure
>> +			 * the source frame index to be -1 * (port_window - 1)
>> +			 * we instruct the sDMA that after a frame is processed
>> +			 * it should move back to the start of the window.
>> +			 */
>> +			d->fi = -(port_window - 1);
>> +
>> +			if (port_window >= 64)
>> +				d->csdp = CSDP_SRC_BURST_64 | CSDP_SRC_PACKED;
>> +			else if (port_window >= 32)
>> +				d->csdp = CSDP_SRC_BURST_32 | CSDP_SRC_PACKED;
>> +			else if (port_window >= 16)
>> +				d->csdp = CSDP_SRC_BURST_16 | CSDP_SRC_PACKED;
> 
> this and other would look better with a switch..

I'm not sure if it will be any better:

switch (port_window) {
case 0 ... 15:
	break;
case 16 ... 31:
	d->csdp = CSDP_SRC_BURST_16 | CSDP_SRC_PACKED;
	break;
case 32 ... 63:
	d->csdp = CSDP_SRC_BURST_32 | CSDP_SRC_PACKED;
	break;
default:
	d->csdp = CSDP_SRC_BURST_64 | CSDP_SRC_PACKED;
	break;
}


-- 
Péter

[toc] | [next] | [standalone]


#1531877

FromVinod Koul <vinod.koul@intel.com>
Date2016-11-29 04:10 +0100
Message-ID<sIGXT-2Bs-11@gated-at.bofh.it>
In reply to#1530061
On Fri, Nov 25, 2016 at 11:38:51AM +0200, Peter Ujfalusi wrote:
> 
> 
> On 11/25/2016 08:12 AM, Vinod Koul wrote:
> > On Thu, Nov 17, 2016 at 02:50:17PM +0200, Peter Ujfalusi wrote:
> >> @@ -921,11 +931,45 @@ static struct dma_async_tx_descriptor *omap_dma_prep_slave_sg(
> >>  
> >>  	d->ccr = c->ccr | CCR_SYNC_FRAME;
> >>  	if (dir == DMA_DEV_TO_MEM) {
> >> -		d->ccr |= CCR_DST_AMODE_POSTINC | CCR_SRC_AMODE_CONSTANT;
> >>  		d->csdp = CSDP_DST_BURST_64 | CSDP_DST_PACKED;
> >> +
> >> +		d->ccr |= CCR_DST_AMODE_POSTINC;
> >> +		if (port_window) {
> >> +			d->ccr |= CCR_SRC_AMODE_DBLIDX;
> >> +			d->ei = 1;
> >> +			/*
> >> +			 * One frame covers the port_window and by  configure
> >> +			 * the source frame index to be -1 * (port_window - 1)
> >> +			 * we instruct the sDMA that after a frame is processed
> >> +			 * it should move back to the start of the window.
> >> +			 */
> >> +			d->fi = -(port_window - 1);
> >> +
> >> +			if (port_window >= 64)
> >> +				d->csdp = CSDP_SRC_BURST_64 | CSDP_SRC_PACKED;
> >> +			else if (port_window >= 32)
> >> +				d->csdp = CSDP_SRC_BURST_32 | CSDP_SRC_PACKED;
> >> +			else if (port_window >= 16)
> >> +				d->csdp = CSDP_SRC_BURST_16 | CSDP_SRC_PACKED;
> > 
> > this and other would look better with a switch..
> 
> I'm not sure if it will be any better:
> 
> switch (port_window) {
> case 0 ... 15:
> 	break;
> case 16 ... 31:
> 	d->csdp = CSDP_SRC_BURST_16 | CSDP_SRC_PACKED;
> 	break;
> case 32 ... 63:
> 	d->csdp = CSDP_SRC_BURST_32 | CSDP_SRC_PACKED;
> 	break;
> default:
> 	d->csdp = CSDP_SRC_BURST_64 | CSDP_SRC_PACKED;
> 	break;
> }

Yeah agree with you on this..

-- 
~Vinod

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web