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.

How to use 2 ethernet port simultaneously (each interface has unique IP)

My b'd has 2 ethernet PHYs. both transiver of them are same "Mavell 88E1111".

I tested with "client" in mcsdk_2_00_00_11\examples\ndk.(no modification).

It worked with SGMII1. So, I knew the driver(NIMU and emac) does not need to be modified for Mavell 88E1111.

Because I had to use 2 port, I searched way to enable SGMII0 like SGMII1.

But, the "nimu_eth.c" in pdk_C6670_1_1_2_6\packages\ti\transport\ndk\nimu\src seemed that supports ONLY 1 PHY(PLATFORM_EMAC_PORT_MODE_PHY).

So, I searched many posts and queried to get information or ways.

But, I actually do not get perfect understand and solution.

 

On collected information,

I have to seperate driver for each interface(SGMII0, SGMII1).

Then, I have to connect the drivers to NIMU table(NIMUDeviceTable).

 

I have no much time to develop driver.

I just want to modify simply and easily  "nimu_eth.c".

Is this possible?

I tried to modify "nimu_eth.c". But it was not easy. ^^;;;

I will explain my modification at next post

Please, teach me.

  • Here is my modification.

     

    1. NIMUDeviceTable

    NIMU_DEVICE_TABLE_ENTRY NIMUDeviceTable[] =
    {
    /**
      * @brief  EmacInit for the platform
      */
        Emac2Init0, // for SGMII0
        Emac2Init1, // for SGMII1
        NULL
    };

      * Emac2Init0 and Emac2Init1 is copy version of EmacInit. 0 and 1 means index of physical interface(SGMII0 and 1).

     

    2. EMACInit_Core

       - I put the index to ptr_pvt_data->pdi.PhysIdx instead of corenum. -> ptr_pvt_data->pdi.PhysIdx = index

       - I make to perform Init_PASS() and Init_Cpsw() when index=0

       - forecd mac address mapping(instead of searching PLATFORM_EMAC_PORT_MODE_PHY part)

          platform_get_emac_info(index, &emac_info);
          memcpy(ptr_pvt_data->pdi.bMacAddr, emac_info.mac_address, 6);

    3. EmacStart

       - I make to perform Setup_Tx() and Setup_Rx() when index=0

     

    These are all of my modification for 2 ports activatity. -_-;;

    After this, SGMII0 works but SGMII1 does not work(initial fail).

     

       *  I think I have to

         - register interrupt for SGMII1( for distinguishing with SGMII0 ???).

         - somethings more...

         But, I don't know well about these.

         I'm a beginner for DSP programming.      I need some help.

  • Hi,

    You can debug like using CCS register view to find the SGMII config and status.

    Yes, Please find the details of config on board side for SGMII if you are using same phy like Mavell 88E1111 (datasheet).
    Make sure there is no issue on hardware. Did you get link status for both the SGMII?

  • Hello.

    I am good to see you again.

     

    Yes, there is no H/W issue.

    The issue is on S/W.

    I think that the NIMU library supports only 1 SGMII as PLATFORM_EMAC_PORT_MODE_PHY.(* NIMU library is from c:\ti\pdk_C6670_1_1_2_6\packages\ti\transport\ndk\nimu)

    Thus, if I (or TI) modify some part of nimu_eth.c, it can support 2 SGMII as PLATFORM_EMAC_PORT_MODE_PHY.(not combination of PHY and AMC) and each can work with its own IP address.

     

    Canyou help me?

  • Hi,

    For NIMU driver code is not tested for simultaneous port operations on EVMC6678.
    You can refer this E2E post, will help you to modify the nimu driver code.
    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/p/196772/953799.aspx#953799

  • Ummm, thank you for your response.

    The contents of the post are very good and useful.

    But,

    I think it is perfect answer for my problem.

    I really want to make 2 ethernet port to work independently with its own IP address.

    On the solution which you suggest me will make 2 SGMII to be active, but not make to work independently.

     

    Dear Pubesh,

    Have you ever test code on the post? or consider about the approach?

    I think it still has some problem for independelt working with different IP.

     

    I really hope you to consider and suggest more efficient and correct solution.

     

    Thank you.

     

    P.S.

    Does TI not have plan to support 2 Phy. and 2 IP in normal(which will released as common driver) NIMU driver?

  • I'm waiting for response from TI.

    Plz, answer me.

  • Hi,

    Apologize for the delayed response. I was on leave.
    Can you share the register values of EMAC, SGMII0 and SGMII1.

  • Please make sure when you do changes in NIMU driver code,
    Clean and Build the NIMU driver: The NIMU driver will be rebuilt.

  • Hi  Pubesh

         Now I get some problem when I want to run "Client"(the ndk example) with SGMII0.

         I do the changes as 

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

          but the SGMII0 still doesn't work . My SGMII1 worked correctly.

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

    You said "Clean and Build the NIMU driver: The NIMU driver will be rebuilt."

    In ccs, I changed the nimu_eth.c and do "Clean Project" ,then "Build Project". Is this what you mean?

    hope for your reply.     

  • Yimin Dong,

    Good to see you again. Yes, I have mentioned the same like Clean Project the Build Project. This will be good when change the NIMU code and using this lib will take effectively.

  •  Pubesh:

    Now I  run "Client"(the ndk example) with SGMII0. But it still doesn't work.

    And I found  it had no difference when I modified nimu_eth.c.

    Even I deleted nimu_eth.c , then rebuild the project. The  "Client" example can still run with SGMII1, but can't run with SGMII0.

     

    So I think nimu_eth driver was not rebuilded.

    After I buliding the project, the console show:

    ------------------------------------------------------------------------------------------------------
    **** Build of configuration Debug for project client_evmc6678l ****

    "C:\\ti\\ccsv5\\utils\\bin\\gmake" -k all
    'Building file: ../client.cfg'
    'Invoking: XDCtools'
    "C:/ti/xdctools_3_23_04_60/xs" --xdcpath="C:/ti/pdk_C6678_1_1_2_6/packages;C:/ti/ndk_2_21_01_38/packages;C:/ti/bios_6_33_06_50/packages;C:/ti/mcsdk_2_01_02_06/demos;C:/ti/ccsv5/ccs_base;" xdc.tools.configuro -o configPkg -t ti.targets.elf.C66 -p ti.platforms.evm6678 -r debug -c "C:/ti/ccsv5/tools/compiler/c6000_7.4.1" "../client.cfg"
    making package.mak (because of package.bld) ...
    generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
    configuring client.xe66 from package/cfg/client_pe66.cfg ...
    cle66 package/cfg/client_pe66.c ...
    'Finished building: ../client.cfg'
    ' '
    'Building file: C:/ti/mcsdk_2_01_02_06/examples/ndk/client/client.c'
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c6000_7.4.1/bin/cl6x" -mv6600 --abi=eabi -g --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.4.1/include" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/platform/evmc6678l/platform_lib/src" --include_path="C:/ti/mcsdk_2_01_02_06/examples/ndk/client" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/qmss" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/cppi" --display_error_number --diag_warning=225 --preproc_with_compile --preproc_dependency="client.pp" --cmd_file="./configPkg/compiler.opt" "C:/ti/mcsdk_2_01_02_06/examples/ndk/client/client.c"
    'Finished building: C:/ti/mcsdk_2_01_02_06/examples/ndk/client/client.c'
    ' '
    'Building file: C:/ti/mcsdk_2_01_02_06/examples/ndk/client/platform_osal.c'
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c6000_7.4.1/bin/cl6x" -mv6600 --abi=eabi -g --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.4.1/include" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/platform/evmc6678l/platform_lib/src" --include_path="C:/ti/mcsdk_2_01_02_06/examples/ndk/client" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/qmss" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/cppi" --display_error_number --diag_warning=225 --preproc_with_compile --preproc_dependency="platform_osal.pp" --cmd_file="./configPkg/compiler.opt" "C:/ti/mcsdk_2_01_02_06/examples/ndk/client/platform_osal.c"
    'Finished building: C:/ti/mcsdk_2_01_02_06/examples/ndk/client/platform_osal.c'
    ' '
    'Building file: C:/ti/mcsdk_2_01_02_06/examples/ndk/client/resourcemgr.c'
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c6000_7.4.1/bin/cl6x" -mv6600 --abi=eabi -g --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.4.1/include" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/platform/evmc6678l/platform_lib/src" --include_path="C:/ti/mcsdk_2_01_02_06/examples/ndk/client" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/qmss" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/cppi" --display_error_number --diag_warning=225 --preproc_with_compile --preproc_dependency="resourcemgr.pp" --cmd_file="./configPkg/compiler.opt" "C:/ti/mcsdk_2_01_02_06/examples/ndk/client/resourcemgr.c"
    'Finished building: C:/ti/mcsdk_2_01_02_06/examples/ndk/client/resourcemgr.c'
    ' '
    'Building file: C:/ti/mcsdk_2_01_02_06/examples/ndk/client/webpage.c'
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c6000_7.4.1/bin/cl6x" -mv6600 --abi=eabi -g --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.4.1/include" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/platform/evmc6678l/platform_lib/src" --include_path="C:/ti/mcsdk_2_01_02_06/examples/ndk/client" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/qmss" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/cppi" --display_error_number --diag_warning=225 --preproc_with_compile --preproc_dependency="webpage.pp" --cmd_file="./configPkg/compiler.opt" "C:/ti/mcsdk_2_01_02_06/examples/ndk/client/webpage.c"
    'Finished building: C:/ti/mcsdk_2_01_02_06/examples/ndk/client/webpage.c'
    ' '
    'Building target: client_evmc6678l.out'
    'Invoking: C6000 Linker'
    "C:/ti/ccsv5/tools/compiler/c6000_7.4.1/bin/cl6x" -mv6600 --abi=eabi -g --display_error_number --diag_warning=225 -z -m"client_evmc6678l.map" -i"C:/ti/ccsv5/tools/compiler/c6000_7.4.1/lib" -i"C:/ti/ccsv5/tools/compiler/c6000_7.4.1/include" --reread_libs --warn_sections --rom_model -o "client_evmc6678l.out" -l"./configPkg/linker.cmd" "./webpage.obj" "./resourcemgr.obj" "./platform_osal.obj" "./client.obj" -l"libc.a"
    <Linking>
    'Finished building target: client_evmc6678l.out'
    ' '

    **** Build Finished ****

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

    And I saw in 

    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/150203.aspx

     said "Please note that after building Platform Lib, please rebuild Nimu_ETH driver and then the application."

    My question:How to bulid Platform.Lib and Nimu_ETH driver in ccs5.3?

     

     

    Regards,

    Yimin

  • excuse me,

    i am trying to communicate between two dsp using ethernet .. can you tell me what shall i do ?? i have tried all the examples but nothing happen and nothing comes up on the console

    i have an evm c6670l 

    thanks in advance

  • Yimin,

    The Platform Library package is present in the pdk_ ####_#_##_##_##/packages/ti/platform/evm####/platform_lib directory
    The library is re-buildable as a CCSv5 project. Just import from the platform_lib directory as an existing CCS project.


    Select and Import the NIMU Project:
    Click the browse button to open a directory browser. Navigate to the PDK transport directory and select the NIMU transport project. Click "Finish" to import the nimu_eth_evmc66xxl project into CCS.

    Change the NIMU project active build configuration to Little Endian (Debug or Release):
    In the C/C++ Projects window, right-click on the nimu_eth_evmc66xxl RTSC project folder, click on Build Configurations -> Set Active -> Debug_LE (or Release_LE for release).

    Clean and Build the NIMU driver:
    The NIMU driver will be rebuilt in Little Endian format and can now be linked by rebuilt Little Endian NDK examples with your application.

    The same steps you can follow for platform lib.

  • Pubesh

    It works!! Now the "client" example can run with SGMII0 and SGMII1.

    Your reply is very helpful.

    Thank you very very very much.

    Regards

    Yimin

  • Yimin,

    However this discussion of thread can helpful for future readers, If you verified this thread.

  • Pubesh:

    Sorry, I can't do this.

    But I see someone has done..

    Regards 

    Yimin