This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/AM5728: Shared EDMA configuration

Part Number: AM5728


Tool/software: TI-RTOS

My application has some peripherals controlled by IPU/M4 cores running TI-RTOS and some by MPU/A15 cores running Linux. I want to use DMA transfers for these peripherals (UART, SPI) on the M4 side of the system. Looking through Linux kernel documentation (kernel_src/Documentation/devicetree/bindings/dma/ti-edma.txt) I see that there are several relevant device tree parameters:

  • ti,edma-memcpy-channels which tells Linux what channels can be used for memcpy operations (if any)
  • ti-edma-reserved-slot-ranges which tells Linux which PaRAM sets it canNOT use (i.e., which are reserved for IPU and DSP use)
  • dmas which tells Linux which DMA channels to use for which peripherals

My understanding is that I'll need to tell Linux to NOT use certain channels and PaRAM sets so that there is no conflict between what the IPU is doing and what Linux is doing. That makes sense, and it seems like it's a pretty straightforward thing to do on the Linux side.

The problem is on the IPU side. I have no idea how I am supposed to know which channels and PaRAM sets the IPU drivers will use, nor do I know how I can have any influence on this and have not been able to find any relevant documentation about it. I tried stepping through a UART example on the IPU core with my debugger and it looks like the PaRAM sets to use are retrieved from an edma3DrvChBoundRes object based on channel number. I tried to track down how this object is set up, but couldn't find anything in the source code about it.

Can you please provide guidance on how I can determine IPU driver set up so that I can configure the Linux device tree correctly?

For reference, I'm using the libraries and drivers in the TI Processor SDK RTOS for AM57xx devices, version 4.02.00.09.

  • Scott,

    Your understanding is correct - there should be no conflict in EDMA channel between IPU and Linux. I have been trying to get more inputs from EDMA experts, but it appears we don't have such document to cover the topic at this point. Essentially, the EDMA channel is allocated by EDMA3_DRV_requestChannel() API after EDMA_DRV_Open() and after the channel is allocated then EDMA3_RM_allocResource () is called and the PaRAM is set before initiating an EDMA transfer.

    The document EDMA driver user guide and resource manager user guide in EDMA LLD packages\ti\sdo\edma3\drv\docs and packages\ti\sdo\edma3\rm\docs\ may help.

    >>I tried to track down how this object is set up, but couldn't find anything in the source code about it.
    If you have an AM572x EVM setup with the UART example, you should be able to step into the functions and identify the call flow.

    Regards,
    Garrett
  • Garrett,

    Thanks for the reply. I've stepped through the UART example with my debugger and I can see where channels and PaRAM sets get allocated. For example, I can see that EDMA3_DRV_getParam will get the PaRAM set currently mapped to a specified channel and EDMA3_DRV_requestChannel can be used to allocate and set up a channel to use with a transfer. I have not seen where the internal mappings get initialized during debugging (though I did find where a "default" mapping is made if one doesn't exist while searching the source tree; see below).

    The RM manual makes reference to a dmaChannelPaRAMMap object that maps DMA channels to PaRAM sets, but it is not clear where this actually gets defined. A search of the source tree (e.g., grep -rnw "dmaChannelPaRAMMap" within the edma3_lld_2_21_05_30B directory) yields a whole bunch of binary file matches, but no obvious place in the source code where the mapping gets set up, other than a function that sets up a 1-to-1 PaRAM to channel mapping if no other mapping is defined. I have to assume that it will always be a 1-to-1 mapping since I see no other definitions.

    The Technical Reference Manual describes how I can link multiple PaRAM sets together for more complex transfers (e.g., the "link" field of PaRAM set 1 can point to set 29, which could in turn point to 125 and so on), which is something I'd like to do. From what I have seen in the RM and Driver documentation, however, neither the RM nor the EDMA3 driver appear to support this through available APIs or XDC build options (the latter of which, I could not find any documentation on). That is, there is no obvious way to use the provided libraries to either A) request PaRAM slots that are unassociated with any channel or B) associate more than one PaRAM set with a given channel.

    I assume that my best bet is to manually decide that I'm going to use certain PaRAM sets (say, 500-512) for my IPU application and reserve those in the kernel device tree. Then I can go into my IPU application and manually address and configure each PaRAM set as needed using my own code. Finally, I would use the EDMA3_DRV_getParam function to get the PaRAM set currently associated with a channel and link it to one of the other sets I've manually "allocated." Would you agree that this is the best approach? Or is there something in the API or XDC configuration that I've missed?

    If there's something I've missed in the existing documentation, please tell me; there's a lot of stuff there and I could have easily overlooked something.

    Scott

  • Hi,

    For the UART, the DMA event is fixed as shown in UART_soc.c under AM572x. Then the EDMA channel and Parameter set is determined from EDMA3_DRV_requestChannel() call, it is calls into EDMA LLD. I believe it is from sample_tda2xx_cfg.c.

    Regards, Eric
  • Thanks, Eric.

    Based on your response, it sounds like the EDMA3 driver does not directly support use of PaRAM sets that are not directly mapped to a channel and it is thus up to me to configure extra sets manually if I want to use them. Does that sound accurate?

    I was also able to eventually trace down that the mapping comes from files related to a TDA2xx family chip, but saw no obvious connection between my build process for the AM57xx and the TDA2xx family. If I wanted to override the channel to PaRAM mapping found in the default file, is there a recommended way to do this as part of my application build process (e.g., by defining my own table and overriding the provided table either through an API call or at link time by overriding the symbol)? Or should I, at run time, just overwrite values in the table before calling edma3init?

  • Hi Scott
    with the EDMA there are multiple regions i will send you the file that has all these regions. The IPU is in region 4 and they assign certain PARAM to that region. I am still working to see what PARAM is assigned to region 4. Hopefully by the end of the week should be able to figure that out.

    Regards
    Mohsen
  • Hi Scott
    Sorry for the extra email but I think I know how this can be configured. The below file is an example configuration for the tDA2x. which you can configure which PARAM belongs to which region that way you can pick which ever you want.

    edma3_lld_2_12_04_28\packages\ti\sdo\edma3\rm\src\configs\edma3_tda2xx_cfg.c

    Which you can use for AM572x. You should add this file to your project and the EDMA will use it as the configuration file for the EDMA.

    I hope this answers your question

    Regards
    Mohsen
  • Mohsen,

    This seems to be the answer though I had to use this file instead:
    edma3_lld_2_12_04_28/packages/ti/sdo/edma3/drv/sample/src/platforms/sample_tda2xx_cfg.c


    For whatever reason, the build looks for the symbol sampleInstInitConfig (as opposed to defInstInitConfig in the file you referenced).


    Scott