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.

66AK2G12: Issues with Ethernet interfacing with a linux machine on K2G custom board

Part Number: 66AK2G12

Hi,

We are working with K2G evaluation board and our own custom board. On both board we have the same 66AK2G12 processor interfaced with the ethernet PHY chip "KSZ9031RNX" from Microchip.

We are running TI-RTOS on both the boards and similar routine is followed to initialize the PHY registers and Ethernet peripheral.

However when these boards are interfaced with the Linux machine, the behavior is quite different. For the evaluation board the connection is successful at 1000Mb/s and ping test is also working good.

But for the custom board, as you can see from the attached logs below, the linux machine stops advertising 1000Mb/s mode and connects with board only at 100Mb/s. Also during the ping test, all packets are completely lost with "Destination Host unreachable" error.

FOR EVALUATION BOARD:

$ ethtool enp1s0
Settings for enp1s0:
	Supported ports: [ TP MII ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Half 1000baseT/Full 
	Supported pause frame use: No
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	Advertised pause frame use: Symmetric Receive-only
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Speed: 10Mb/s
	Duplex: Half
	Port: MII
	PHYAD: 0
	Transceiver: internal
	Auto-negotiation: on
        Cannot get wake-on-lan settings: Operation not permitted
	Current message level: 0x00000033 (51)
			       drv probe ifdown ifup
	Link detected: no


$ ethtool enp1s0
Settings for enp1s0:
	Supported ports: [ TP MII ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Half 1000baseT/Full 
	Supported pause frame use: No
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	Advertised pause frame use: Symmetric Receive-only
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Link partner advertised link modes:  10baseT/Half 10baseT/Full 
	                                     100baseT/Half 100baseT/Full 
	                                     1000baseT/Half 1000baseT/Full 
	Link partner advertised pause frame use: No
	Link partner advertised auto-negotiation: Yes
	Link partner advertised FEC modes: Not reported
	Speed: 1000Mb/s
	Duplex: Full
	Port: MII
	PHYAD: 0
	Transceiver: internal
      	Auto-negotiation: on
        Cannot get wake-on-lan settings: Operation not permitted
	Current message level: 0x00000033 (51)
			       drv probe ifdown ifup
	Link detected: yes

FOR CUSTOM BOARD:

$ ethtool enp1s0
Settings for enp1s0:
	Supported ports: [ TP MII ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Half 1000baseT/Full 
	Supported pause frame use: No
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	Advertised pause frame use: Symmetric Receive-only
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Speed: 10Mb/s
	Duplex: Half
	Port: MII
	PHYAD: 0
	Transceiver: internal
	Auto-negotiation: on
        Cannot get wake-on-lan settings: Operation not permitted
	Current message level: 0x00000033 (51)
			       drv probe ifdown ifup
	Link detected: no

$ ethtool enp1s0
Settings for enp1s0:
	Supported ports: [ TP MII ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Half 1000baseT/Full 
	Supported pause frame use: No
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	Advertised pause frame use: Symmetric Receive-only
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Link partner advertised link modes:  10baseT/Half 10baseT/Full 
	                                     100baseT/Half 100baseT/Full 
	                                     1000baseT/Half 1000baseT/Full 
	Link partner advertised pause frame use: No
	Link partner advertised auto-negotiation: Yes
	Link partner advertised FEC modes: Not reported
	Speed: 100Mb/s
	Duplex: Full
	Port: MII
	PHYAD: 0
	Transceiver: internal
	Auto-negotiation: on
        Cannot get wake-on-lan settings: Operation not permitted
	Current message level: 0x00000033 (51)
			       drv probe ifdown ifup
	Link detected: yes

So could give us any explanation on why this scenario could occur. The schematic is exactly similar to evaluation board's schematic and we are using the same Linux test machine with same LAN cable.

Thanks,

Krishna.

  • Krishna,

    I am not sure that this is a software issue yet. Have you checked the PHY boot strapping or tried to read over MDIO the settings on the EVM And the custom board. Even if the schematics is same you also need to check layout meets the guidelines for high speed interfaces.

    https://www.ti.com/lit/an/spraar7h/spraar7h.pdf

  • Hi Rahul,

    We checked the PHY registers on both EVM and our custom board and found the following difference.

    All the above three bits are set on K2G evaluation board PHY chip at address 0xA. But on our custom board these bits are not set. 

    Also the Ethernet MODE configuration through the MODE strap-in pins are exactly similar with that of EVM board. 

    With regards,

    Krishna

  • Hi Rahul,

    We probed the TX and RX clocks of the RGMII interface between the K2G and the PHY chip on both evaluation board and our custom board. We noticed the following behavior.

    On evaluation board:

    1. Before connecting the board to PC via ethernet cable:

    TX_clk remains steady at 125MHz, RX_clk remains steady at 25MHz

    2. After connecting the board to PC via ethernet cable:

    TX_clk remains steady at 125MHz, RX_clk remains steady at 125MHz

    On Custom Board:

    1. Before connecting the board to PC via ethernet cable:

    TX_clk remains steady at 125MHz, RX_clk remains steady at 25MHz

    2. After connecting the board to PC via ethernet cable:

    TX_clk remains steady at 125MHz, RX_clk switches between 125MHz and 25MHz few times and drops back to 25MHz.  

    So now I am trying to enable loopback on PHY chip and try to send some data packets from K2G and see if it comes back. 

    Since I am running TI-RTOS, is there any example project that I could use as a reference, where the application sends commands like PING or some data packets through network stack. 

    Thank you.

    Regards,
    Krishna.

  • Krishna,

    I am not a PHY expert but shouldn`t the A11 bit be set to 1 to advertise that the Link partner is 1000base-T full duplex.

    All the networking examples for the platform are in the following folder in the PDK component in processor SDK RTOS :

    pdk_k2g_1_0_xx\packages\ti\transport\ndk\nimu\examples

    You need to create the project using pdkProjectCreate in the pdk_k2g_x_X_X_x\packages folder.

    Regards,

    Rahul

  • Hi Rahul,

    We used the emac loopback test files available at "C:\ti\pdk_k2g_1_0_15\packages\ti\drv\emac\test\EmacLoopbackTest\k2g" and disabled the EMAC loopback so we can send raw frames through RGMII. 

    Also we ported the code at "C:\ti\ndk_3_61_01_01\packages\ti\ndk\tools\console\conping.c" to enable pinging from K2G to other system through ethernet.

    We used the following test setup and observed the results as tabulated below.

    Test

    SOURCE

    DESTINATION

    LOOPBACK

    EVM BOARD

    CUSTOM BOARD

    Ping Test           (multiple pings are sent)

    K2G

    LINUX PC

    -

    PASS

      FAIL 

    (Error number 64 - Host down)

    Ping Test           (multiple pings are sent)

    K2G

    PHY chip

    PHY local loopback

    PARTIAL PASS  

       (transmitted 2 packets and receviced 1 packet)

    FAIL 

    (packets transmitted and received are inconsistent)

     

    Ping Test           (multiple pings are sent)

    LINUX PC

    K2G

    -

    PASS

    FAIL

    (Destination host unreachable)

     

    Ping Test           (multiple pings are sent)

    LINUX PC

    PHY chip

    PHY remote loopback

    PASS

    PASS

     

    Send RAW frame 

    (ported from emac loopback example project)

    K2G

    LINUX PC

    -

    PASS

    FAIL

    Send RAW frame  (ported from emac loopback example project)

    K2G

    PHY chip

    PHY local loopback

    PASS

    PASS

    • PHY local loopback” is the loopback enabled between K2G’s EMAC and PHY chip interfaced with the K2G.
    • PHY remote loopback” is the loopback enabled between the Linux PC and the PHY chip interfaced with the K2G

    For the evaluation board the connection is successful at 1000Mb/s whenever the ethernet cable is connected.

    But for the custom board the linux machine stops advertising 1000Mb/s mode and connects with board only at 100Mb/s when the ethernet cable is connected.

    Kindly review these results and let us know how to proceed further with debugging.

    Thank You.

  • Hi Rahul,

      For the same above issue we are trying to force PHY chip of K2G EVM to 10/100Mbps it is not working.

      We probed RGMII TX clock it is always showing 125MHz.

      Similar thing we tried in our target board seen same issue unable to force to 10/100Mbps speed.

    Regards,

    Vinayak Arkachari