Re: [PATCH v3 07/14] dt-bindings: dma: ti: Add document for K3 UDMA
From: Peter Ujfalusi
Date: Tue Oct 22 2019 - 07:46:26 EST
On 17/10/2019 17.03, Rob Herring wrote:
> On Tue, Oct 15, 2019 at 12:29 PM Peter Ujfalusi <peter.ujfalusi@xxxxxx> wrote:
>>
>> Rob,
>>
>> On 10/11/19 10:30 AM, Peter Ujfalusi wrote:
>>>
>>> I have already moved the TR vs Packet mode channel selection, which does
>>> make sense as it was Linux's choice to use TR for certain cases.
>>>
>>> If I move these to code then we need to have big tables
>>> struct psil_config am654_psil[32767] = {};
>>> struct psil_config j721e_psil[32767] = {};
>>
>> After thinking about this a bit more, I think we can move all the PSI-L
>> endpoint configuration to the kernel as not all the 32767 threads are
>> actually in use. Sure it is going to be some amount of static data in
>> the kernel, but it is an acceptable compromise.
>>
>> The DMA binding can look like this:
>>
>> dmas = <&main_udmap 0xc400>,
>> <&main_udmap 0x4400>;
>> dma-names = "tx", "rx";
>>
>> or
>> dmas = <&main_udmap 0x4400 UDMA_DIR_TX>,
>> <&main_udmap 0x4400 UDMA_DIR_RX>;
>> dma-names = "tx", "rx";
>>
>> If I keep the direction.
>> 0xc400 is destination ID, which is 0x4400 | 0x8000 as per PSI-L
>> specification.
>> In the TRM only the source threads can be found as a map (thread IDs <
>> 0x7fff), but the binding document can cover this.
>>
>> This way we don't need another dtsi file and I can create the map in the
>> kernel.
>>
>> This will hide some details of the HW from DT, but since the PSI-L
>> thread configuration is static in hardware I believe it is acceptable.
>>
>> However we still have uncovered features in the binding or in code, like
>> a case when the RX does not have access to the DMA channel, only flows.
>> Not sure if I should reserve the direction parameter as an indication to
>> this or find other way.
>> Basically we communicate on the given PSI-L thread without having a DMA
>> channel as other core is owning the channel.
>>
>> What do you think?
>
> Seems like a reasonable solution
OK, I'll go ahead and implement the PSI-L thread representation to the
kernel.
> though I don't really follow the last issue.
In this DMA for RX (DEV_TO_MEM) we need the source thread paired to
UDMAP receive channel to get data flowing.
The arriving packets within PSI-L are directed by flowID to a specific
receive flow configuration which describe the ring from where UDMAP
should pick up the descriptor and to where the completed one should be
placed for the SW.
There are cases when Linux for example does not have access to the
receive channel at all, it is handled by another core, but certain
receive flow(s) are given to Linux so they can receive packets.
In this case we do RX DMA without actual DMA channel.
- PÃter
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki