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.

Restarting an SRIO Messaging application on C6670 without the use of a System Reset.

MCSDK Version: 2.1.2.6
Compiler Version: 7.4.1

While developing an SRIO messaging application, it was observed that the application runs to completion successfully after a board power up. However, after performing a "CPU reset" on Core 0 (all other cores are idle) via the emulator and reloading/rerunning the application, Tx errors are observed (specifically, descriptors are pushed to the the Garbage TOUT queue). However, if a System Reset is performed, followed by an OPTIONAL run of the GEL script (evmc6670l.gel) included in the MCSDK, all is fine and the software will again run to completion. I am currently unsure if the reset problem resides in the SRIO peripheral or the multicore navigator.

SRIO messaging makes use of the Multicore Navigator, which does not appear to have a reset register. Based on other forum postings, a software approach is needed to get the Multicore Navigator in a reset state.
http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/261743.aspx
http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/247150.aspx
In the second post (second entry), it was suggested:
"1) cycling the clock+power domains of your peripherals - this will be similar to what is done on a SOC reset, and 2) reset the queue manager by clearing the memory regions and pushing a NULL pointer on each queue (this should destroy the descriptors of each queue)."

It is believed that the SRIO peripheral is being put into a reset state by cycling power to the module through the power sleep controller (SRIO CPPI DMA Tx registers at 0x0290_1400 appear to get cleared in this process).

The second item, the multicore navigator, was satisfied with the following reset function:

// reset the queue manager by clearing the memory regions and pushing a NULL
// pointer on each queue (this should destroy the descriptors of each queue).
void ReinitializeQmssDevice()
{
    uint32 u32MemoryRegion;
    uint32 u32QueueNum;
    uint16 u16Count;
    CSL_Qm_descriptor_region_configRegs *poConfigReg = (CSL_Qm_descriptor_region_configRegs *)CSL_QM_SS_CFG_DESCRIPTION_REGS;

    // Zero out the memory regions. The C6670 has 20 separate memory regions for descriptor sets.
    for(u32MemoryRegion = 0; u32MemoryRegion < 20; u32MemoryRegion++)
    {
        poConfigReg->MEMORY_REGION_BASE_ADDRESS_GROUP[u32MemoryRegion].MEMORY_REGION_BASE_ADDRESS_REG = 0;
        poConfigReg->MEMORY_REGION_BASE_ADDRESS_GROUP[u32MemoryRegion].MEMORY_REGION_DESCRIPTOR_SETUP_REG = 0;
        poConfigReg->MEMORY_REGION_BASE_ADDRESS_GROUP[u32MemoryRegion].MEMORY_REGION_START_INDEX_REG = 0;
    }

    // Push a NULL pointer on each queue. This will loop through all the queues
    // and ensure each is in an empty state. The Qmss_queueEmpty() will write a
    // NULL pointer to the Queue Register D.
    for(u32QueueNum = 0; u32QueueNum < 8192; u32QueueNum++)
    {
        u16Count = Qmss_getQueueEntryCount(u32QueueNum);
        if(u16Count)
        {
            Qmss_queueEmpty((Qmss_QueueHnd) u32QueueNum);
        }
    }
}

Even with this approach, it still appears that my SRIO messaging application does not restart properly and descriptors pushed onto the SRIO Tx queue are recycled to the garbage queues (TOUT). I have consulted with the SRIO_LoopbackTestProject, which is distributed in the MCSDK, and tested on a C6670EVM and have encountered the same problem of "software restartability." However, in this project, I didn't observe any descriptors being pushed onto garbage queues.

QUESTIONS:
1) My overall question is what additional steps do I need to take to get my software to properly reset peripherals (Multicore Navigator, SRIO) without a full System Reset?

2) The first link above referenced an upcoming fix to address restartability of QMSS/CPPI. I am assuming this would be inside the low level drivers distributed in the MCSDK and get rolled in the next release? Is there a projected release date with these fixes?

  • I've never done what you are asking, only ever used the system reset.  I believe what you doing with the power domain shutdown on SRIO should reset the peripheral, but this was only implemented on rev2.0 silicon.  Make sure you have that one.  Alternatively you should be able to 1) de-assert boot_complete in the RIO_PER_SET 2) assert GBL_EN.  Then just reinitialize SRIO as you did the first time (boot_complete is asserted at the end of the init) and SRIO should be good to go.

    I'll try to also locate some code that can clear the QMSS resources.

    Regards,

    Travis

  • Ok, I've talked with one of the internal guys who has done exactly what you are trying to do with our throughput example from the PDK.  The example uses directIO and type 11 messages:

    C:\ti\pdk_C6678_1_1_2_6\packages\ti\drv\srio\test\tput_benchmarking

    So he is able to run in, do a cpu reset and reconfigure and run again.  He used the steps I mentioned above for the SRIO peripheral reset.  The QMSS was handled as mentioned here:

    Step-1

      Clear the SRIO register.

         {

         volatile unsigned int *srio_reg = (volatile unsigned int *)0x291B0E0;

     

         *srio_reg=0x2003F044;

    }

    Step-2

    Make sure that the other side (Producer) is reset  when you do step 1.
    This is because, the Step-1 fetches the remote(Producer’s) Inbound ACK-ID and the consumer then sends the outgoing packets with that ACK-ID. However, when the producer comes up, the producer’s inbound ACK-ID get reset to zero causing a mismatch for all the consumer packets going to DSP and getting dropped.
     
    So, make sure the step 1 happens only AFTER the remote producer’s SRIO is reset.
    This can be enforced manually ( using user prompt, or breakpoint to ensure that the producer runs the reset before Step1 happens at consumer) or we could perform the SRIO reset at the end of the application before exiting. This way, when the consumer comes up next time, it is ensured that the producer’s side SRIO registers are reset.
     
    Note: This is dependent on the graceful exit of the producer, upon  which we reset the SRIO.
     
    For Type11.
        Since Type11 uses a lot of QMSS CPPI buffers, we need to ensure that the QMSS resources (such as heap) allocated in the application is released properly upon exit.
    In our PDK example, we were not doing that. So, this is what I did,
     
    void test_empty_and_close_queue (UInt32 corenum, Qmss_QueueHnd hnd)
    {
        Qmss_Result retVal;
        Qmss_queueEmpty (hnd);
     
        if (QMSS_SOK != (retVal = Qmss_queueClose (hnd)))
        {
            System_printf ("Core %d: error closing %d (%d)\n", corenum, hnd, retVal);
          }
    }
     
    I found out all the places where Qmss_queueOpen() was called, and saved the QMSS handles so that I could forcefully free them upon exit ( using the above code:  test_empty_and_close())
        /* During the application..
        memoryHeapQueue= Qmss_queueOpen (Qmss_QueueType_GENERAL_PURPOSE_QUEUE, QMSS_PARAM_NOT_SPECIFIED, &isAllocated);
     
        myRxFreeQueueHnd=Qmss_queueOpen (Qmss_QueueType_GENERAL_PURPOSE_QUEUE, QMSS_PARAM_NOT_SPECIFIED, &isAllocated);
    .....
    .....
    /* At the end of the application */
     
        test_empty_and_close_queue (corenum, memoryHeapQueue);
        test_empty_and_close_queue (corenum, myRxFreeQueueHnd);
        test_empty_and_close_queue (corenum, myRxCompletionQueueHnd);
     
        System_printf("\n Closing Garbage Queues");
     
        for(i=0;i<6;i++) {
        test_empty_and_close_queue(corenum,GarbageQueueHnd[i]);
        }
     
    }
    Hope this helps.  BTW, the reason for step one is discussed here:

    Regards,

    Travis

  • Hi Friends,

    I am facing a similar problem in resetting the multicore navigator through DSP Core in restart. I posted my observations in a separate thread as it results in issue in handling FFTC coprocessor on TIC6670. With your good amount of experience, I request you to comment on the issue I posted on different thread (similar issue + FFTC).

    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/p/367471/1292764.aspx#1292764

    Thank You,

    Srinivas