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.

restart NETCP

Hi,

I have a problem about NETCP and PA. My aim is to write a bootloader that can take the binary code over ethernet and copying it to the DDR. So it configures NETCP and PA. But the application (copied) code also configures NETCP and PA. In order to simulate the situation I load the application code to my custom board over the emulator, and run. Then I restart the code after passing the initializing routines. Unfortunately there are errors like "Error Allocating Rx Free Descriptors", "Error Allocating Tx Free Descriptors" and "Timeout waiting for the reply from PA to Pa". All these errors mentions that something missing in initialization.

In the forum, the post "714284.aspx#714284" (disable "Network Coprocessor" powerdomain after reloading outfile to DSP) is about the same problem, so that I add the following code to the starting point. Therefore if PASS power domain is not OFF, I try to reset it :

CSL_PSC_PDSTATE pdstate=PSC_PDSTATE_OFF;
pdstate=CSL_PSC_getPowerDomainState(CSL_PSC_PD_PASS);
if (pdstate!=PSC_PDSTATE_OFF)
/*if PASS power domain is not OFF then reset*/
{
*pa_padma_txchconf0|=0x40000000; /*teardown the 9 TX channels and the 24 RX channels*/
*pa_padma_rxchconf0|=0x40000000;

*CPSW_CTRL = 0;// disable port 0 of the Gigabit Ethernet Switch
*PDSP0_CTRL &= 0xFFFFFFFD;// disable PDSP0
*PDSP1_CTRL &= 0xFFFFFFFD;// disable PDSP1
*PDSP2_CTRL &= 0xFFFFFFFD; // disable PDSP2
*PDSP3_CTRL &= 0xFFFFFFFD; // disable PDSP3
*PDSP4_CTRL &= 0xFFFFFFFD;// disable PDSP4
*PDSP5_CTRL &= 0xFFFFFFFD;// disable PDSP5

// disable the clocks for PASS modules
CSL_PSC_setModuleNextState (CSL_PSC_LPSC_PKTPROC, PSC_MODSTATE_DISABLE);
CSL_PSC_setModuleNextState (CSL_PSC_LPSC_CPGMAC, PSC_MODSTATE_DISABLE);
CSL_PSC_setModuleNextState (CSL_PSC_LPSC_Crypto, PSC_MODSTATE_DISABLE);

CSL_PSC_disablePowerDomain(CSL_PSC_PD_PASS);
CSL_PSC_startStateTransition(CSL_PSC_PD_PASS);
while (!CSL_PSC_isStateTransitionDone(CSL_PSC_PD_PASS));
}


/* Set PASS Power domain to ON */
CSL_PSC_enablePowerDomain (CSL_PSC_PD_PASS);

/* Enable the clocks for PASS modules */
CSL_PSC_setModuleNextState (CSL_PSC_LPSC_PKTPROC, PSC_MODSTATE_ENABLE);
CSL_PSC_setModuleNextState (CSL_PSC_LPSC_CPGMAC, PSC_MODSTATE_ENABLE);
CSL_PSC_setModuleNextState (CSL_PSC_LPSC_Crypto, PSC_MODSTATE_ENABLE);

/* Start the state transition */
CSL_PSC_startStateTransition (CSL_PSC_PD_PASS);

/* Wait until the state transition process is completed. */
while (!CSL_PSC_isStateTransitionDone (CSL_PSC_PD_PASS));

In the first run everthing is OK, but when I restart the code, I have encountered the same error messages. When I restart the program at that point again, it stucks in state transition while loop. So how can it be reset suitable?

If someone gives me any suggetions, I will be very happy. 

Alpaslan

  • Alpaslan,

    Please provide the details of development environment(Device, packages) on your side?
    Which version of MCSDK package using by you?

  • Looks you are looking for a reliable way to reset PA and NetCP via PSC domain. There are some example codes by Advantech how they did in the Linux PCIE driver, that may help.

    The driver is under http://www.advantech.com/products/PCIe-DSP-Card/sub_HALF-LENGTH_PCIE_CARD1.aspx for DSPC-8681 product. I looked my copy of version 0.7 (the latest is 0.8, not sure if any thing changed for local reset), check \dsp_loader\app\src\dsp_loader.c, function dio_put_dsp_in_reset() and dio_bring_dsp_out_reset() how they reset PA/NETCP.

    Regards, Eric

  • The versions that I use:

    CCSV5 5.3.67

    MCSDK 2.1.2.6

    PDK 1.1.2.6

    Alpaslan

  • Thank you for your suggestion Eric.

    I inspect the code and adapting into my environment accordingly. It seems to be very close to my reset code. It has some extra initializations. But I am not able to reset PA as I expect. There is again allocating free descriptors  and timeout error messages.

    Indeed there are some issues that I am questioned about cppi_initdescriptor part. In the first run I call Cppi_initDescriptor() API for 2048 descriptors. Then I use 512 of them for tx queue, 1024 of them rx queue. When I restart the code, Cppi_initDescriptor() for 2048 descriptors seems to be succesful. Also I can pop 512 of them to push them tx queue. But I cannot pop any longer for rx queue. So I suppose that Cppi keeps its state, although I do all the initialization. In order to avoid from this situation, I close the all the queues, I close all the channels, and I use cppi_close() and cppi_exit() APIs just before the restarting the code. Unfortunately this does not effect the situation.

    I don not know whether this issue is related with the resetting PA module. But I suppose this is an other problem. So How can eliminate this problem? 

    Have you got any example project or code having restarting facitility?

    What is the teardown sequence for Cppi, QMSS, flows ?

    ,Alpaslan

  • Alpaslan,

    Please have a look at the section "6.2.5 Channel Teardown" in KeyStone Architecture Multicore Navigator User Guide for QMSS.
    It gives a brief description for tearing down channel. And also the example code that comes with QMSS driver in C6678 PDK shows the sequence of closing down all the components of QMSS. You can follow that sequence.

  • Hi,

    I solved the problem. I emptied the queues which I want to close by popping all of the descriptors. I suppose that the queues have to be emptied before closing it. So ethernet becomes active...

    Thank you,

    Alpaslan

  • Hello Alpaslan.
    And somebody tell me how to empty the queue. And if it is possible, with an example of the code.

    Sincerely Dmitry

  • while ( (plocalDesc=Qmss_queuePop(gGlobalQueueHnd)) != NULL); //pop all the remaining descriptors from the queue

    Qmss_queueClose(gGlobalQueueHnd); //close the queue

  • Thank try. )) And where that variable gGlobalQueueHnd is defined?
  • How it will work after you restart the program? After all HVND all lost. Or operation (pop all the remaining descriptors from the queue) must be carried out before restarting
  • Qmss_QueueHnd gGlobalQueueHnd;
    defined as global variable.
  • On this issue a full response to be here !!!!!    solution   !!!!

    But there are a couple.

    1. You just have to use the kernel 0.

    2. Works well when debugging a project. If stitched one project, and debug other may not work.