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.

Setting PLATFORM_EMAC_PORT_MODE_PHY to both ports.

Hi,

 

I’m trying to modify MCSDK (DSP6678) example code “client” to make it work fine with both Ethernet ports.

Because my board has two SGMII interconnections to PHY.

My board will have only one IP address and both Ethernet ports are supposed to be merely L2 switch extensions of CPU port.

Of course, L2 layer packet forwarding is required between both Ethernet ports without CPU's intervention.

 

In order to do that, I modified the variable “emac_port_mode” in platform.c, setting PLATFORM_EMAC_PORT_MODE_PHY to both ports.

I expected, that’s all I need to modify, but still 2nd port didn’t work. SGMII negotiation on 2nd port was failed.

 

Could you let me know how I can modify the example code for my case?

 

Regards.

  • JungBai,

    What kind of loopback are you talking about? Internal? External?

    You mentioned you modified the port mode for emac, but I believe you need to do more than that to enable loopback, as it says in the user guide quote below.  

    Try that and see how it works.

    Regards,

    Kat

  • Kat,

     

    Thank you for your reply.

    I think, the above question of mine was insufficient to make you understand what I’m trying to do.

     

    I’m neither trying loopback tests, nor trying on the EVM board.

    But only, my target board has two Ethernet ports, and I need an actual solution for it.

     

    Again, my board will have only one IP address and both Ethernet ports are supposed to be merely L2 switch extensions of CPU port. L2 layer packet forwarding is required between both Ethernet ports without software intervention.

     

    Setting PLATFORM_EMAC_PORT_MODE_PHY to both ports and applying your suggestion above, I succeeded to get both SGMII linked up. Physical links of PHY to UTP cable was OK.

     

    But, still only one port worked fine. DSP could not give PING test replies to PC#2.

     

     

    DSP & PC #1

    DSP & PC #2

    emac_port_mode[0] =   PLATFORM_EMAC_PORT_MODE_PHY;

    emac_port_mode[1] =   PLATFORM_EMAC_PORT_MODE_AMC;

    Ping   OK

    No   response

    emac_port_mode[0] =   PLATFORM_EMAC_PORT_MODE_AMC;

    emac_port_mode[1] =   PLATFORM_EMAC_PORT_MODE_PHY;

    No   response

    Ping   OK

    emac_port_mode[0] =   PLATFORM_EMAC_PORT_MODE_PHY;

    emac_port_mode[1] =   PLATFORM_EMAC_PORT_MODE_PHY;

    Ping   OK

    No   response

     

    One more thing, function “platform_get_emac_info” was called twice while initializing,

    I’m not sure whether I should give different MAC addresses for two ports or same MAC address.

    It is certain that one IP address needs only one MAC address.

     

    If you could find and provide the solution for my board, that would be really appreciated.

     

    Best Regards

  • JunBai, 

    You're right in that the different ports don't need a different IP address, but that might be a good debug to see if the response is that or not. 

    I'm trying to determine if it is software or hardware that is causing it.  Have you tried flipping the ports so that PC#1 goes to the port PC#2 was using?  If that port isn't working then it's your second PC that's the issue, or the programming there. It makes me think that because the PC isn't receiving any pings during your ping test. 

    I think the platform_get_emac_info should be called twice, one for each port.  But I don't know for sure. 

    So I noticed that it's when you set the emac mode [0] that the no response is enabled (more like the two ports switch the statuses). Have you flipped which you switch first (as in the ordered enabled) as in setting it to PHY for [0] and then for port [1]?  

    Try those debug methods and see what happens. 

    -Kat Kelsch 

  • Hello, JungBai Park!

    Do you found solution of your question or not? I have the same problem with two SGMII ports but under linux system.

    Thank you.