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.

AM4376: Processors forum

Part Number: AM4376

Hi, Dear Sir

We designed a board with TI AM4376 + RSZ9031RNX, but we faced a LAN problem repeatedly (Phenomenon: LAN port will be Link UP/Down after using a while and it seems only happened with Giga LAN)

during our testing we found if we added a 100M LAN HUB with the board, this problem will not occur....

So, we would like to use another way to solve the issue, is anybody know how to change the kernel setting based on this structure? Do I need other tools to change the setting?

We're using Linux version  4.9.69 and here is the mill dump information as below: 

(We would like to know how to disable A/N and setting the speed to 100Mbps in Kernel code, thanks!!)

=> mii dump 4
0. (1140) -- PHY control register --
(8000:0000) 0.15 = 0 reset
(4000:0000) 0.14 = 0 loopback
(2040:0040) 0. 6,13 = b10 speed selection = 1000 Mbps
(1000:1000) 0.12 = 1 A/N enable
(0800:0000) 0.11 = 0 power-down
(0400:0000) 0.10 = 0 isolate
(0200:0000) 0. 9 = 0 restart A/N
(0100:0100) 0. 8 = 1 duplex = full
(0080:0000) 0. 7 = 0 collision test enable
(003f:0000) 0. 5- 0 = 0 (reserved)


=> mii dump 5
0. (1140) -- PHY control register --
(8000:0000) 0.15 = 0 reset
(4000:0000) 0.14 = 0 loopback
(2040:0040) 0. 6,13 = b10 speed selection = 1000 Mbps
(1000:1000) 0.12 = 1 A/N enable
(0800:0000) 0.11 = 0 power-down
(0400:0000) 0.10 = 0 isolate
(0200:0000) 0. 9 = 0 restart A/N
(0100:0100) 0. 8 = 1 duplex = full
(0080:0000) 0. 7 = 0 collision test enable
(003f:0000) 0. 5- 0 = 0 (reserved)

  • Hi,

    To limit the speed to 100Mbps please reference this example from another processor that TI offers.

    Please review this file in the Linux source tree arch/arm/boot/dts/am57xx-beagle-x15.dts and look for this example.

    In this file there is an appended node called phy1 that has the speed limitation added for phy1 which is on eth1. You will need to do something like this in the DTS file  for your custom board.

    &phy1{
    max-speed = <100>;
    };

    The link cycling issue that you are seeing is more than likely a PHY issue since the link is going up and down due to what I will assume is not due to a user command. If the PHY detects a carrier loss the link will be lost and the PHY will attempt to re-establish the link.

    This link was experiencing a similar link loss and possibly illustrates where to look for underlying issue.

    e2e post about unstable ethernet link.

    Best Regards,

    Schuyler

  • Hi, Schuyler

    Thanks for your reply!!

    I'll ask our engineer to check the DTS file and added the command

    BTW, Do we have to disable auto-negotiation function as well? If yes, do you have any reference sample to let us know how to added command to disable it? 

    And about the link cycling issue, I'll check the link and study first, once thanks for your kindly reply!!

    Jimmy

  • Hi Jimmy,

    You can turn off auto-neg with this command:

    ethtool -s eth0 autoneg off

    I would be careful though using this command. One reason is that if the link partner resets the link may not resolve to a link speed. With the max-speed option autoneg remains so if the link partner can only do 10Mbps than the link would be able to resolve to that speed.

    Best Regards,

    Schuyler

  • Hi, Schuyler

    Sorry,, I just realized that I ask wrong question

    I should ask if I would like to change the setting let 100MFULL to be Max during Auto negotiation

    Which command that we can use?

    Best regards

  • Hi,

    You can use ethtool to set the advertised link speed and duplex mode for auto-negotiation. The example here is setting for 10M Half/Full and 100M Half/Full:

    ethtool -s eth0 advertise 0x0f

    The 0x0f comes from this link on the man page for ethtool, there is a table the defines options. Here is a brief snippet from that table showing what the 0x0f means:

    0x001                  10baseT Half
    0x002 10baseT Full 0x004 100baseT Half 0x008 100baseT Full

    Best Regards,
    Schuyler