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


Groups > linux.kernel > #1291980 > unrolled thread

Re: [PATCH 2/6] ARM: DTS: da850: Use the new DT bindings for the eDMA3

Started bySekhar Nori <nsekhar@ti.com>
First post2015-12-15 10:40 +0100
Last post2015-12-15 16:30 +0100
Articles 5 — 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 2/6] ARM: DTS: da850: Use the new DT bindings for the  eDMA3 Sekhar Nori <nsekhar@ti.com> - 2015-12-15 10:40 +0100
    Re: [PATCH 2/6] ARM: DTS: da850: Use the new DT bindings for the  eDMA3 Peter Ujfalusi <peter.ujfalusi@ti.com> - 2015-12-15 12:50 +0100
      Re: [PATCH 2/6] ARM: DTS: da850: Use the new DT bindings for the  eDMA3 Sekhar Nori <nsekhar@ti.com> - 2015-12-15 14:50 +0100
        Re: [PATCH 2/6] ARM: DTS: da850: Use the new DT bindings for the  eDMA3 Peter Ujfalusi <peter.ujfalusi@ti.com> - 2015-12-15 15:10 +0100
          Re: [PATCH 2/6] ARM: DTS: da850: Use the new DT bindings for the  eDMA3 Sekhar Nori <nsekhar@ti.com> - 2015-12-15 16:30 +0100

#1291980 — Re: [PATCH 2/6] ARM: DTS: da850: Use the new DT bindings for the eDMA3

FromSekhar Nori <nsekhar@ti.com>
Date2015-12-15 10:40 +0100
SubjectRe: [PATCH 2/6] ARM: DTS: da850: Use the new DT bindings for the eDMA3
Message-ID<qFUfp-2at-13@gated-at.bofh.it>
Hi Peter,

On Friday 04 December 2015 07:23 PM, Peter Ujfalusi wrote:
> Switch to use the ti,edma3-tpcc and ti,edma3-tptc binding for the eDMA3.
> With the new bindings boards can customize and tweak the DMA channel
> priority to match their needs. With the new binding the memcpy is safe
> to be used since with the old binding it was not possible for a driver
> to know which channel is allowed to be used as non HW triggered channel.
> Using the new binding will allow us to reserve PaRAM slots to be used by
> the DSP which was not possible before and prevented the da850 boards to be
> moved to DT only.
> 
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> ---
>  arch/arm/boot/dts/da850-enbw-cmc.dts |  5 +++++
>  arch/arm/boot/dts/da850-evm.dts      |  5 +++++
>  arch/arm/boot/dts/da850.dtsi         | 27 ++++++++++++++++++++++-----
>  3 files changed, 32 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/da850-enbw-cmc.dts b/arch/arm/boot/dts/da850-enbw-cmc.dts
> index e750ab9086d5..ca9117624cf9 100644
> --- a/arch/arm/boot/dts/da850-enbw-cmc.dts
> +++ b/arch/arm/boot/dts/da850-enbw-cmc.dts
> @@ -28,3 +28,8 @@
>  		};
>  	};
>  };
> +
> +&edma0 {
> +	ti,edma-reserved-slot-ranges = /bits/ 16 <32 50>;
> +	ti,edma-memcpy-channels = /bits/ 16 <20 21>;
> +};
> diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts
> index d807285a61cd..33467feb272a 100644
> --- a/arch/arm/boot/dts/da850-evm.dts
> +++ b/arch/arm/boot/dts/da850-evm.dts
> @@ -243,3 +243,8 @@
>  	tx-num-evt = <32>;
>  	rx-num-evt = <32>;
>  };
> +
> +&edma0 {
> +	ti,edma-reserved-slot-ranges = /bits/ 16 <32 50>;
> +	ti,edma-memcpy-channels = /bits/ 16 <20 21>;

These correspond to PRU events. It is true that most likely they will
never be used for peripheral DMA and can be dedicated as memcpy
channels. However, since this is being encoded in DT, we need to be sure
that they will never be used for peripheral DMA on this board.

So, I would prefer if you do not reserve any channels for memcpy until
there is a real need/usecase for them. I know the board file has these
reserved but board file could be updated as you liked. With DT we need
to maintain backward compatibility. So I would rather do it when there
is an actual need for it.

In future, if/when we gain QDMA support, the QDMA channels could be used
for memcopy.

> +};
> diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
> index e73f5efb3aa3..9e46eb51a8da 100644
> --- a/arch/arm/boot/dts/da850.dtsi
> +++ b/arch/arm/boot/dts/da850.dtsi
> @@ -151,11 +151,28 @@
>  
>  		};
>  		edma0: edma@01c00000 {
> -			compatible = "ti,edma3";
> +			compatible = "ti,edma3-tpcc";
>  			/* eDMA3 CC0: 0x01c0 0000 - 0x01c0 7fff */
>  			reg =	<0x0 0x8000>;
> -			interrupts = <11 13 12>;
> -			#dma-cells = <1>;
> +			reg-names = "edma3_cc";
> +			interrupts = <11 12>;
> +			interrupt-names = "edma3_ccint", "edma3_ccerrint";
> +			#dma-cells = <2>;
> +
> +			ti,tptcs = <&edma0_tptc0 7>, <&edma0_tptc1 0>;
> +			ti,edma-memcpy-channels = /bits/ 16 <20 21>;

Same here. I would drop this.

Thanks,
Sekhar
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1292074

FromPeter Ujfalusi <peter.ujfalusi@ti.com>
Date2015-12-15 12:50 +0100
Message-ID<qFWhb-3v9-11@gated-at.bofh.it>
In reply to#1291980
On 12/15/2015 11:38 AM, Sekhar Nori wrote:
> Hi Peter,
> 
> On Friday 04 December 2015 07:23 PM, Peter Ujfalusi wrote:
>> Switch to use the ti,edma3-tpcc and ti,edma3-tptc binding for the eDMA3.
>> With the new bindings boards can customize and tweak the DMA channel
>> priority to match their needs. With the new binding the memcpy is safe
>> to be used since with the old binding it was not possible for a driver
>> to know which channel is allowed to be used as non HW triggered channel.
>> Using the new binding will allow us to reserve PaRAM slots to be used by
>> the DSP which was not possible before and prevented the da850 boards to be
>> moved to DT only.
>>
>> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
>> ---
>>  arch/arm/boot/dts/da850-enbw-cmc.dts |  5 +++++
>>  arch/arm/boot/dts/da850-evm.dts      |  5 +++++
>>  arch/arm/boot/dts/da850.dtsi         | 27 ++++++++++++++++++++++-----
>>  3 files changed, 32 insertions(+), 5 deletions(-)
>>
>> diff --git a/arch/arm/boot/dts/da850-enbw-cmc.dts b/arch/arm/boot/dts/da850-enbw-cmc.dts
>> index e750ab9086d5..ca9117624cf9 100644
>> --- a/arch/arm/boot/dts/da850-enbw-cmc.dts
>> +++ b/arch/arm/boot/dts/da850-enbw-cmc.dts
>> @@ -28,3 +28,8 @@
>>  		};
>>  	};
>>  };
>> +
>> +&edma0 {
>> +	ti,edma-reserved-slot-ranges = /bits/ 16 <32 50>;
>> +	ti,edma-memcpy-channels = /bits/ 16 <20 21>;
>> +};
>> diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts
>> index d807285a61cd..33467feb272a 100644
>> --- a/arch/arm/boot/dts/da850-evm.dts
>> +++ b/arch/arm/boot/dts/da850-evm.dts
>> @@ -243,3 +243,8 @@
>>  	tx-num-evt = <32>;
>>  	rx-num-evt = <32>;
>>  };
>> +
>> +&edma0 {
>> +	ti,edma-reserved-slot-ranges = /bits/ 16 <32 50>;
>> +	ti,edma-memcpy-channels = /bits/ 16 <20 21>;
> 
> These correspond to PRU events. It is true that most likely they will
> never be used for peripheral DMA and can be dedicated as memcpy
> channels. However, since this is being encoded in DT, we need to be sure
> that they will never be used for peripheral DMA on this board.
> 
> So, I would prefer if you do not reserve any channels for memcpy until
> there is a real need/usecase for them. I know the board file has these
> reserved but board file could be updated as you liked. With DT we need
> to maintain backward compatibility. So I would rather do it when there
> is an actual need for it.

If we do not reserve channels for memcpy then you will have no support for
memcpy on these boards. Not sure if we use memcpy in any of our drivers in
daVinci, so it might be just fine to not have DMA memcpy support at all.
But how about using edma1's reserved channels as memcpy (19-23, 30-31)? I
don't know which channels the DSP would use on these boards, so it is never
going to be safe from that point.

> In future, if/when we gain QDMA support, the QDMA channels could be used
> for memcopy.

Well, in short there is no way to get the qDMA working in a different way
either. qDMA channel is in essence using 'normal' eDMA channel. This means
that we still need to reserve the eDMA channel to be used for memcpy, but
instead of SW triggering it (as we do it right now), we would need to use the
channel as qDMA and set things up accordingly. I don't really see the benefit
for qDMA mode to be honest.
> 
>> +};
>> diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
>> index e73f5efb3aa3..9e46eb51a8da 100644
>> --- a/arch/arm/boot/dts/da850.dtsi
>> +++ b/arch/arm/boot/dts/da850.dtsi
>> @@ -151,11 +151,28 @@
>>  
>>  		};
>>  		edma0: edma@01c00000 {
>> -			compatible = "ti,edma3";
>> +			compatible = "ti,edma3-tpcc";
>>  			/* eDMA3 CC0: 0x01c0 0000 - 0x01c0 7fff */
>>  			reg =	<0x0 0x8000>;
>> -			interrupts = <11 13 12>;
>> -			#dma-cells = <1>;
>> +			reg-names = "edma3_cc";
>> +			interrupts = <11 12>;
>> +			interrupt-names = "edma3_ccint", "edma3_ccerrint";
>> +			#dma-cells = <2>;
>> +
>> +			ti,tptcs = <&edma0_tptc0 7>, <&edma0_tptc1 0>;
>> +			ti,edma-memcpy-channels = /bits/ 16 <20 21>;
> 
> Same here. I would drop this.

OK, I'll drop this part.

> 
> Thanks,
> Sekhar
> 


-- 
Péter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1292198

FromSekhar Nori <nsekhar@ti.com>
Date2015-12-15 14:50 +0100
Message-ID<qFY9k-4Mo-21@gated-at.bofh.it>
In reply to#1292074
On Tuesday 15 December 2015 05:14 PM, Peter Ujfalusi wrote:
> On 12/15/2015 11:38 AM, Sekhar Nori wrote:
>> Hi Peter,
>>
>> On Friday 04 December 2015 07:23 PM, Peter Ujfalusi wrote:
>>> Switch to use the ti,edma3-tpcc and ti,edma3-tptc binding for the eDMA3.
>>> With the new bindings boards can customize and tweak the DMA channel
>>> priority to match their needs. With the new binding the memcpy is safe
>>> to be used since with the old binding it was not possible for a driver
>>> to know which channel is allowed to be used as non HW triggered channel.
>>> Using the new binding will allow us to reserve PaRAM slots to be used by
>>> the DSP which was not possible before and prevented the da850 boards to be
>>> moved to DT only.
>>>
>>> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
>>> ---
>>>  arch/arm/boot/dts/da850-enbw-cmc.dts |  5 +++++
>>>  arch/arm/boot/dts/da850-evm.dts      |  5 +++++
>>>  arch/arm/boot/dts/da850.dtsi         | 27 ++++++++++++++++++++++-----
>>>  3 files changed, 32 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/arch/arm/boot/dts/da850-enbw-cmc.dts b/arch/arm/boot/dts/da850-enbw-cmc.dts
>>> index e750ab9086d5..ca9117624cf9 100644
>>> --- a/arch/arm/boot/dts/da850-enbw-cmc.dts
>>> +++ b/arch/arm/boot/dts/da850-enbw-cmc.dts
>>> @@ -28,3 +28,8 @@
>>>  		};
>>>  	};
>>>  };
>>> +
>>> +&edma0 {
>>> +	ti,edma-reserved-slot-ranges = /bits/ 16 <32 50>;
>>> +	ti,edma-memcpy-channels = /bits/ 16 <20 21>;
>>> +};
>>> diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts
>>> index d807285a61cd..33467feb272a 100644
>>> --- a/arch/arm/boot/dts/da850-evm.dts
>>> +++ b/arch/arm/boot/dts/da850-evm.dts
>>> @@ -243,3 +243,8 @@
>>>  	tx-num-evt = <32>;
>>>  	rx-num-evt = <32>;
>>>  };
>>> +
>>> +&edma0 {
>>> +	ti,edma-reserved-slot-ranges = /bits/ 16 <32 50>;
>>> +	ti,edma-memcpy-channels = /bits/ 16 <20 21>;
>>
>> These correspond to PRU events. It is true that most likely they will
>> never be used for peripheral DMA and can be dedicated as memcpy
>> channels. However, since this is being encoded in DT, we need to be sure
>> that they will never be used for peripheral DMA on this board.
>>
>> So, I would prefer if you do not reserve any channels for memcpy until
>> there is a real need/usecase for them. I know the board file has these
>> reserved but board file could be updated as you liked. With DT we need
>> to maintain backward compatibility. So I would rather do it when there
>> is an actual need for it.
> 
> If we do not reserve channels for memcpy then you will have no support for
> memcpy on these boards. Not sure if we use memcpy in any of our drivers in
> daVinci, so it might be just fine to not have DMA memcpy support at all.

Not that I know of. No driver uses DMA memcpy

> But how about using edma1's reserved channels as memcpy (19-23, 30-31)? I

I think this is much more reasonable.

> don't know which channels the DSP would use on these boards, so it is never
> going to be safe from that point.

Yeah, and thats why I think its better to add it as and when there is a
real need for it. At least at that point we are sure of the usecase.

> 
>> In future, if/when we gain QDMA support, the QDMA channels could be used
>> for memcopy.
> 
> Well, in short there is no way to get the qDMA working in a different way
> either. qDMA channel is in essence using 'normal' eDMA channel. This means
> that we still need to reserve the eDMA channel to be used for memcpy, but
> instead of SW triggering it (as we do it right now), we would need to use the
> channel as qDMA and set things up accordingly. I don't really see the benefit
> for qDMA mode to be honest.

I guess the only advantage is that they will not clash with peripheral
mode usage. But even then, some sort of reservation is needed. So I
guess QDMA is no better than the EDMA reserved channels?

>>
>>> +};
>>> diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
>>> index e73f5efb3aa3..9e46eb51a8da 100644
>>> --- a/arch/arm/boot/dts/da850.dtsi
>>> +++ b/arch/arm/boot/dts/da850.dtsi
>>> @@ -151,11 +151,28 @@
>>>  
>>>  		};
>>>  		edma0: edma@01c00000 {
>>> -			compatible = "ti,edma3";
>>> +			compatible = "ti,edma3-tpcc";
>>>  			/* eDMA3 CC0: 0x01c0 0000 - 0x01c0 7fff */
>>>  			reg =	<0x0 0x8000>;
>>> -			interrupts = <11 13 12>;
>>> -			#dma-cells = <1>;
>>> +			reg-names = "edma3_cc";
>>> +			interrupts = <11 12>;
>>> +			interrupt-names = "edma3_ccint", "edma3_ccerrint";
>>> +			#dma-cells = <2>;
>>> +
>>> +			ti,tptcs = <&edma0_tptc0 7>, <&edma0_tptc1 0>;
>>> +			ti,edma-memcpy-channels = /bits/ 16 <20 21>;
>>
>> Same here. I would drop this.
> 
> OK, I'll drop this part.

For now, I think its better to not add any reservation. It can be added
when its really needed.

Thanks,
Sekhar
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1292208

FromPeter Ujfalusi <peter.ujfalusi@ti.com>
Date2015-12-15 15:10 +0100
Message-ID<qFYsG-58o-11@gated-at.bofh.it>
In reply to#1292198
On 12/15/2015 03:48 PM, Sekhar Nori wrote:
>>> These correspond to PRU events. It is true that most likely they will
>>> never be used for peripheral DMA and can be dedicated as memcpy
>>> channels. However, since this is being encoded in DT, we need to be sure
>>> that they will never be used for peripheral DMA on this board.
>>>
>>> So, I would prefer if you do not reserve any channels for memcpy until
>>> there is a real need/usecase for them. I know the board file has these
>>> reserved but board file could be updated as you liked. With DT we need
>>> to maintain backward compatibility. So I would rather do it when there
>>> is an actual need for it.
>>
>> If we do not reserve channels for memcpy then you will have no support for
>> memcpy on these boards. Not sure if we use memcpy in any of our drivers in
>> daVinci, so it might be just fine to not have DMA memcpy support at all.
> 
> Not that I know of. No driver uses DMA memcpy
> 
>> But how about using edma1's reserved channels as memcpy (19-23, 30-31)? I
> 
> I think this is much more reasonable.
> 
>> don't know which channels the DSP would use on these boards, so it is never
>> going to be safe from that point.
> 
> Yeah, and thats why I think its better to add it as and when there is a
> real need for it. At least at that point we are sure of the usecase.

OK, I'll disable the memcpy for now.

>>> In future, if/when we gain QDMA support, the QDMA channels could be used
>>> for memcopy.
>>
>> Well, in short there is no way to get the qDMA working in a different way
>> either. qDMA channel is in essence using 'normal' eDMA channel. This means
>> that we still need to reserve the eDMA channel to be used for memcpy, but
>> instead of SW triggering it (as we do it right now), we would need to use the
>> channel as qDMA and set things up accordingly. I don't really see the benefit
>> for qDMA mode to be honest.
> 
> I guess the only advantage is that they will not clash with peripheral
> mode usage. But even then, some sort of reservation is needed. So I
> guess QDMA is no better than the EDMA reserved channels?

It will clash with the peripheral mode use since it needs to take one of the
eDMA channels. qDMA mode is basically differs from the mode we are using by
how the channel is triggered. Currently we start the memcpy with SW trigger.
In qDMA mode we can select a paRAM parameter which if it is updated will do
the triggering. It is useful if you have mostly constant memcpy parameters and
you only need to change one thing in there (reusing the paRAM slot), like you
change the dst address. In this case you just update the dst and the qDMA will
be triggered. I don't think we can take advantage of this feature via dmaengine.

-- 
Péter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1292261

FromSekhar Nori <nsekhar@ti.com>
Date2015-12-15 16:30 +0100
Message-ID<qFZI6-5X4-15@gated-at.bofh.it>
In reply to#1292208
On Tuesday 15 December 2015 07:35 PM, Peter Ujfalusi wrote:
> On 12/15/2015 03:48 PM, Sekhar Nori wrote:

>>>> In future, if/when we gain QDMA support, the QDMA channels could be used
>>>> for memcopy.
>>>
>>> Well, in short there is no way to get the qDMA working in a different way
>>> either. qDMA channel is in essence using 'normal' eDMA channel. This means
>>> that we still need to reserve the eDMA channel to be used for memcpy, but
>>> instead of SW triggering it (as we do it right now), we would need to use the
>>> channel as qDMA and set things up accordingly. I don't really see the benefit
>>> for qDMA mode to be honest.
>>
>> I guess the only advantage is that they will not clash with peripheral
>> mode usage. But even then, some sort of reservation is needed. So I
>> guess QDMA is no better than the EDMA reserved channels?
> 
> It will clash with the peripheral mode use since it needs to take one of the
> eDMA channels. qDMA mode is basically differs from the mode we are using by
> how the channel is triggered. Currently we start the memcpy with SW trigger.

Alright, so I was missing this detail. Thanks for clarifying it on IRC.
The EDMA specification makes it look like 8 additional QDMA channels can
be used over 32 DMA channels, but in reality they are not additional
channels since TCC is only valid between 0-31.

So, I agree. QDMA does not buy us any parallel transfers.

Thanks,
Sekhar
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web