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.

Linux/AM3352: Ethernet PHY loopback test

Guru 16580 points
Part Number: AM3352

Tool/software: Linux


My customers make their custom board with a combination of AM3352 and DP83822.
They have been trying the Ethernet PHY loopback test and using ping command in u-boot as a test; however, the test failed (ping command is TIMEOUT).
Could you tell me whether u-boot has a feature to achieve loopback test?
Or, could you tell me another way to complete the loopback test in u-boot?

The followings are condition:
-Processor SDK of Linux v04.00.00.04 is used as their system OS.
-In case the ping command is sent from AM3352 to a competitor, the command succeed.
-Only the case of the loopback test in Ethernet PHY fails.
-They are referring snla266 to set the PHY into the loopback mode.
-The u-boot commands are following.
=> mii write 1 1f 8000
=> mii read 1 1f
=> mii write 1 0 6100
=> mii read 1 0
=> mii write 1 1f 4000
=> mii read 1 1f
=> mii read 1 0
=> setenv ipaddr
=> setenv netmask
=> ping
cpsw Waiting for PHY auto negotiation to complete......... TIMEOUT !
Using cpsw device

ARP Retry count exceeded; starting again ping failed; host is not alive

Best Regards,

  • Hi,

    I think you are experiencing a U-Boot design requirement. U-Boot maintains no state between commands so the loopback mode that you are setting most likely is not staying set when the ping command is issued. A high level overview of what happens is that the ping will perform a complete network interface initialization since there is no state maintained between commands. So the ping command will init both the mdio interfaces and the CPSW interfaces. Also from a network transaction view the PHY must establish a link partner before the ICMP packet is sent which looks to be the issue. The auto negotiation looks to be timing out which halts the network transaction.

    Because of the stateless nature of U-Boot I don't know of a command to put the port in loopback. Please also note that U-Boot's main function is to boot another binary, while it can be used for some testing it is not really intended to be a debug platform . The SDK provides the U-Boot source that you can perhaps modify the functionality but that will be beyond the scope of TI support.

    I can't comment on the register commands that you are passing. But I would recommend using the mii tool using the dump command to look at registers 0 1, example using phy address 0

    mii dump 0 0 - this will display the contents of register 0
    mii dump 0 1 - displays the contents of register 1

    Between these two register dumps you should be to see if auto negotiation completed, it will be a line in one of the registers like A/N completed. Also please note that auto-negotiation should happen when the PHY is brought out of reset and does not rely on any software configuration to complete.

    Best Regards,
  • Hello Schuyler-san,

    Thank you for your reply and gentle supports.
    I'll try your suggestions.

    Best Regards,