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/66AK2H12: EMAC driver on K2H

Part Number: 66AK2H12

Tool/software: TI-RTOS

XDCtools 3.50.02.20, SYS/BIOS 6.50.01.12, PDK 04.00.06, NDK 2.25.01.11

I'm struggling trying to move the working NIMU_emacExample_EVMK2H_armBiosExampleProject example to our SBC target and get it to work. It looks like the eval board uses EMAC1 (phy_addr 1). Our board uses EMAC0 (phy_addr 0).

I am looking at the EMAC documentation at the following URL: http://processors.wiki.ti.com/index.php/Processor_SDK_RTOS_EMAC. Is this current? 

Under my C:\ti\pdk_k2hk_4_0_6\packages\ti\drv directory I do not have an emac directory. The above documentation indicates that I should.

Further, from searches through the TI code it appears that the K2G board supports emac. For example, C:\ti\pdk_k2hk_4_0_6\packages\ti\board\diag\emac\src has emac_test.c but it implies K2G (e.g., #include <ti/csl/soc/k2g/src/cslr_soc_baseaddress.h>) but no evidence of anything for K2H. Even though this is a PDK specifically for Keystone II (K2H, K2K).

To solve the problem of selecting a different PHY, do we need to rebuild the EMAC driver? Rebuild the PDK? Or is it a run time setup configuration step?

Mike

  • Hi Mike,

    I've forwarded your query to the software experts. Their feedback should be posted here.

    BR
    Tsvetolin Shulev
  • Hi,

    For K2H, it uses packet accelerator (PA), so the driver is drv\pa and the Wiki is processors.wiki.ti.com/.../Processor_SDK_RTOS_PA. This should support all EMAC ports loopback by default.

    As you are trying to work on NIMU example, the wiki is processors.wiki.ti.com/.../Processor_SDK_RTOS_NDK. I believe the NIMU_emacExample_EVMK2H_armBiosExampleProject works on TI K2H EVM, EMAC port 0 already.

    Regards, Eric
  • Hi Eric. Thanks for reviewing my problem and clarifying the driver situation. Allow me to rephrase my question. How can I select the EMAC port I want to use in the NIMU_emacExample_EVMK2H_armBiosExampleProject example?
  • Hi,

    The K2H uses nimu driver ti\transport\ndk\nimu\src\v2, there is a nimu_eth.c with gTxPort = 0, which forces the packets coming out of ETH0. I thought you can change gTxPort = 1, then rebuild the nimu library, then the test application to try if you can ping ETH1. If it does not work, we need more time to debug.

    Regards, Eric
  • Eric,

    Thanks for your support. I did some testing yesterday.

    I see that nimu_eth.c gets compiled into a released library called : ti.transport.ndk.nimu.aa15fg

    That and other libraries including: ti.drv.rm.aa15fg, ti.drv.pa.aa15fg, ti.drv.qmss.aa15fg, ti.drv.cppi.aa15fg and ti.osal.aa15fg get linked in because they are listed in the cfg file. (I don't understand the difference between xdc.useModule() and xdc.loadPackage() in the cfg file yet).

    So this library is linked in our CCS projects like the NIMU_emacExample_EVMK2H_armBiosExampleProject example.

    I set the variable you indicate, gTxPort, to 1 in the file nimu_eth.c (in the two places I find where it is currently set to 0), rebuilt ti.transport.ndk.nimu.aa15fg and then the example project. (What is this variable, where is it defined, where is it commented/documented?)

    Result : I can no longer ping the EVM via ENET0 as expected but I also can not ping it on EMAC1 as I think was our expectation.

    I get no errors, compile or runtime. No messages other than the normal output messages on a fresh powerup:

    [arm_A15_0] QMSS successfully initialized

    CPPI successfully initialized

    PA successfully initialized

    TCP/IP Stack 'Hello World!' Application StackTest: using localIp

    Network Added: If-1:10.10.70.50

    Reverting gTxPort to 0, rebuilding the nimu library and project gets ping working again via ENET0.

    Mike

  • Hi,

    I need to check internally how to test K2H port 1 and get back to you.

    Regards, Eric
  • Eric,


    I’m still trying to get this to work.


    In nimu_eth.c I modified EMACInit_Core () by replacing the following:

    for (i = 0; i < NIMU_MAX_EMAC_PORT_NUM; i++)
    {
      NIMU_getEmacInfo (i, &emac_info);
      if (emac_info.mode == 1)
      {
        gTxPort = 0;
        break;
      }
    }
    if (i < NIMU_MAX_EMAC_PORT_NUM)
    {
      gTxPort = 0;
      memcpy(ptr_pvt_data->pdi.bMacAddr, emac_info.mac_address, 6);
    }
    else
    {
      NIMU_drv_log ("Error: Unable to find a TX EMAC port\n");
      return -1;
    }

    with:

    #define EMAC_PORT 1
    NIMU_getEmacInfo (EMAC_PORT, &emac_info);
    gTxPort = EMAC_PORT;
    memcpy(ptr_pvt_data->pdi.bMacAddr, emac_info.mac_address, 6);

    Recompiled the nimu library and NIMU_emacExample_EVMK2H_armBiosExampleProject. Could no long ping either ENET0 or ENET1.

    For the next test, I see where coreNum is set in many hardcoded to 0. (Again we are on the ARM so _TMS320C6X is not defined). I set coreNum in al locations within the file to a new define, CORE_NUM and defined CORE_NUM 1. I kept the above code changes in EMACInit_Core () . No success. We can not ping ENET1.


    I enabled the NIMU_drv_log functions by uncommenting #define CIO_DRV_CONSOLE in NIMU_drv_log.h. Here is what I get on my CCS console with the above changes:


    [arm_A15_0] QMSS successfully initialized
    CPPI successfully initialized
    PA successfully initialized

    TCP/IP Stack 'Hello World!' Application

    StackTest: using localIp
    EMACInitCore: coreNum: 1
    PASS successfully initialized
    SGMII Serdes Lanes Init Complete
    Ethernet subsystem successfully initialized
    Setup_Tx: gTxCmdFreeQHnd: 8929, 0x22e1
    Setup_Tx: gTxCmdFreeQHnd: 8929, 0x22e1
    Setup_Rx: coreNum: 1
    setup_rx_queue (accumulation queue): gRxQHnd: 0x22c0, qMgr: 0x2, qNum: 0x2c0
    setup_rx_queue: register interrupt sucessful
    Registration of the EMAC Successful, waiting for link up ..
    Network Added: If-1:10.10.70.50


    If I set my defines CORE_NUM and EMAC_PORT both to 0, recompile the nimu lib and NIMU_emacExample_EVMK2H_armBiosExampleProject, I can then again ping ENET0. Following is the console output for this:


    [arm_A15_0] QMSS successfully initialized
    CPPI successfully initialized
    PA successfully initialized

    TCP/IP Stack 'Hello World!' Application

    StackTest: using localIp
    EMACInitCore: coreNum: 0
    PASS successfully initialized
    SGMII Serdes Lanes Init Complete
    Ethernet subsystem successfully initialized
    Setup_Tx: gTxCmdFreeQHnd: 8929, 0x22e1
    Setup_Tx: gTxCmdFreeQHnd: 8929, 0x22e1
    Setup_Rx: coreNum: 0
    setup_rx_queue (accumulation queue): gRxQHnd: 0x22c0, qMgr: 0x2, qNum: 0x2c0
    setup_rx_queue: register interrupt sucessful
    Registration of the EMAC Successful, waiting for link up ..
    Network Added: If-1:10.10.70.50

  • Hi,

    Thanks for the trial. I had some discussion with dev team and trails, we are still working on that. Your requirement is to have both port 0 and port 1 working or just need port 1 working?

    Regards, Eric
  • Our own requirement is to have just one port working but to be able to select the one to use. Selection at build time is sufficient.

    I do wonder why the eval board would have two ENET ports yet both are not supported simultaneously. I could easily envision someone needing both as a requirement and seeing that the eval board has two ports incorrectly assume that that support was there.

    Regards,
    Mike
  • Hi Eric. I wonder if you could ping the dev team to see if they've figured out how to select which port to use.
  • Hi,

    I opened a ticket in our requirement tracking system. I will update you our progress.

    Regards, Eric