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.

EDMA3LLD initialization for C6670

Guru 15520 points

Hi,

I have a question about EDMA3LLD for C6670.

In my system, I use multiple coprocessor which are supported by C6670.

For example, I use VCP2 and TCP3D co-processor which both uses EDMA3.

My question is about EDMA3 initialization. In EDMA3LLD, there is edma initialization function edma3init().

Q1.Does edma3init() need to be executed twice for each VCP2 and TCP3D?

Q2.Or should edma3init() be executed only once by making common edma3init()?

Q3. If executing edma3init() not twice but once is must,    

      are there any sample program of multiple co-processor with EDMA3?    

 

best regards,

g.f.

  • Hi g.f,

    g.f says said:
     are there any sample program of multiple co-processor with EDMA3?    

    Yes, Sample driver code ( not example) is available for VCP2. you will find it as a part of MCSDK package which encloses the PDK (version : C6670_1_1_2_5 ). Usually, you will not find a sample code combining both VCP2 and TCP3D. User may have to develop it.

    Location of driver source after PDK installation ".. \ti\pdk_C6670_1_1_2_5\packages\ti\csl\src\ip\vcp2"

    For EDMA3 initialization, please refer to the file, csl_edma3Init.c located at "..\ti\pdk_C6670_1_1_2_5\packages\ti\csl\src\ip\edma\"

    Regards,

    Shankari

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.

    --------------------------------------------------------------------------------------------------------

  • Hi Shankari,

    Thank you for the reply.

    I'm sorry, my question was bad.

    I understand that a sample program for eache co-processor are available in PDK.
    I want one single sample program using multiple co-procesor and initializing EDMA3 for those co-processor,
    so I can check how edma3init() are called. But this isn't available in PDK.

    By the way, in tpc3d sample program, edma3init() are called and it have 4 arguments.
    One of argument is "edmaId" which is TPCC #.
    Please see pdk_C6670_x_x_x_x\packages\ti\drv\tcp3d\example\src\tcp3d_example_main.c

    So, if tpc3d and vcp2 uses differnet EDMA TPCC, edma3init() need to be
    called twice for each co-processor, is this correct?

    If those co-processor uses same EDMA TPCC and configured at same EDMA Region,
    edma3init() need to be called only once, is it correct?

    best regards,
    g.f.
  • Hi,

    Thanks for your update.

    To my opinion, even if you use multiple co-processoer on a single program, each co-processor needs to be initialize EDMA3 individually and even if both co-processor uses same TPCC and same EDMA region, edma3init() needs to be called uniquely for both coprocessor since there is no dependancy between edma3init() call and each coprocessor is unique in its own way which needs a seperate edma3 initialization which would initialize edma3 drivers and registers the interrupt handlers accordingly to each coprocessor's unique identity.

    In my knowledge, each coprocessor would need a EDMA3 driver initialization seperately which require a unique edma3 driver object for each instance and there is no relation between region ID, EDMA TPCC and edma3init() call across different coprocessor which would not really feasible to use same EDMA TPCC and same EDMA region at all instances.

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.

    -------------------------------------------------------------------------------------------------------

  • Hi Sivaraj,

    Thank you for the reply.

    Sorry, but let me ask again.
    I found the following information for EDMA3_DRV_create() in EDMA3LLD header file:
    edma3_lld_02_11_05_02\packages\ti\sdo\edma3\drv "edma3_drv.h"
    /////////////////////////////////////////////////////////////////
    This API is used to create the EDMA3 Driver Object.
    It should be called only ONCE for each EDMA3 hardware instance.
    /////////////////////////////////////////////////////////////////

    EDMA3_DRV_create() are called from edma3init().
    So, I guess edma3init() can be called only once for each TPCC.
    Isn't it?

    best regards,
    g.f.
  • Hi,

    Even i do agree, edma3init() should be called only once for each TPCC and at the same time, TPCC would be unique for each hardware accelerators/coprocessor. So, I mean, each coprocessor would have a unique TPCC to complete a DMA transfer which would be the identity for the transfer completion interrupt. Each and every peripheral would require a unique EDMA driver object instance for EDMA initialization which should be mandatory. Again, TPCC cannot be same across peripherals/coprocessors and it is uniquely mapped between event queues and transfer controllers.

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.

    -------------------------------------------------------------------------------------------------------

  • Hi Sivaraj,

    Thank you for the reply.

    I'm very sorry. I don't understand yet.

    In C6670, there are 3 TPCC( EDMA3 channel controller).
    I guess TPCC is not unique for each hardware accelerators/coprocessor.
    But each DMA channel is unique.

    For example, VCP2 and TCP3D are assigned to the same TPCC(EDMA3CC2) and
    each of this coprocessor are allocated to unique DMA channel of TPCC(EDMA3CC2).

    So, I thought that edma3init() are required once per each TPCC.
    After calling edma3init() once, appropriate EDMA Driver handler for the TPCC can be used
    at initialization for each unique DMA channel.

    best regards,
    g.f.
  • Hi,

    Yes, you are correct. There should be mapping between peripheral events and EDMA3 Channel controller event queue which you can see in the EDMA3 user guide. With this context, if VCP2 and TCP3D are mapped to the same EDMA3CC2 then, it should be possible. But i do agree that, each of the coprocessor should allocate an unique DMA channel to the appropriate EDMA3CC2.  

    I guess, eventhough both VCP2 and TCP3D are assigned to the same TPCC as per unique mapping between peripheral events and channel controller event queue, it would require seperate edma3init() for VCP2 and TCP3D repectively since each EDMA3 driver object instance would need a unique handle to EDMA3 instance for each DMA channel mapped to it.

    I apologise for the misinterpretation.

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.

    -------------------------------------------------------------------------------------------------------

  • Hi Sivaraj,

    Thank you for the reply.

    It seem that allocation of DMA channel are done in other API (not edma3init()).
    In example project(tcp3d), it seems that DMA channel allocation are done in openEdmaChannels().

    This openEdmaChannels() are called after the edma3init().

    And I found the other following E2E post which are discussing about multiple edma3init() calls.
    e2e.ti.com/.../51248
    It said that multiple call are not allowed and it will return "EDMA3_DRV_E_INVALID_STATE".

    best regards,
    g.f.
  • HI,

    I agree that, multiple edma3init(0 calls to a single application project would always return "EDMA3_DRV_E_INVALID_STATE" but this should be the case only with one coprocessor, say like TCP3D. Even i guess, multiple instances of TCP3 decoder would require only one edma3init() call which is allowed and acceptable and the init functions for the TCP3D which can be used to initialize for multiple instances for the same coprocessor but different coprocessor would require different EDMA driver object and the instances of the other coprocessor would require a unique edma3init() call for EDMA driver initialization. Please think of first and validate whether the two coprocessors can be combined into a single project application with single edma3init() call wouldn't be possible, i believe so, which is why, we have provided the test example projects seperately for each coprocessor. Kindly think about the feasibility of doing so and in my opinion, it is not possible so.

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.

    -------------------------------------------------------------------------------------------------------

  • Hi Sivaraj,

    Thank you for the details.
    And I'm sorry for taking your time.
    I understood now.

    best regards,
    g.f.