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.

AM3352: Ethernet can't support 10Mbps in Uboot, 100Mbps and 1Gbps works

Part Number: AM3352

Hi team,

Customer had an issue on UBOOT. Ethernet can't support 10Mbps in Uboot,  but 100Mbps and 1Gbps works

Please find the details information below. Could you please help to identify the issue. Thanks.

Set the host in 1Gbps, it works.

U-Boot# 
U-Boot# 
U-Boot# ping 128.7.8.128
link up on port 0, speed 1000, full duplex
Using cpsw device
host 128.7.8.128 is alive
U-Boot# 
link up on port 0, speed 1000, full duplex
Using cpsw device
host 128.7.8.128 is alive

Set the host in 100Mbps, it works.

U-Boot# 
cpsw Waiting for PHY auto negotiation to complete. done
link up on port 0, speed 100, full duplex
Using cpsw device
host 128.7.8.128 is alive
U-Boot# 
link up on port 0, speed 100, full duplex
Using cpsw device
host 128.7.8.128 is alive
U-Boot# 
link up on port 0, speed 100, full duplex
Using cpsw device
host 128.7.8.128 is alive

Set the host in 10Mbps, it fails.

U-Boot# 
link up on port 0, speed 10, full duplex
Using cpsw device
ping failed; host 128.7.8.128 is not alive
U-Boot# 
link up on port 0, speed 10, full duplex
Using cpsw device
ping failed; host 128.7.8.128 is not alive
U-Boot# 
link up on port 0, speed 10, full duplex
Using cpsw device
ping failed; host 128.7.8.128 is not alive
U-Boot# 

Also, when using 100M and 1Gbps, the uImage can load to RAM successful. but 10Mbps fails.

U-Boot# 
U-Boot# 
U-Boot# 
U-Boot# setenv tftpuImage tftp 0x81000000 uImage
U-Boot# 
U-Boot# 
U-Boot# run tftpuImage
link up on port 0, speed 10, full duplex
Using cpsw device
TFTP from server 128.7.8.128; our IP address is 128.7.8.7
Filename 'uImage'.
Load address: 0x81000000
Loading: T T T T T T T T T T T T T T T T T T T T 
Retry count exceeded; starting again
link up on port 0, speed 10, full duplex
Abort
U-Boot# 
U-Boot# 
U-Boot# 
U-Boot# 
U-Boot# 
U-Boot# run tftpuImage
link up on port 0, speed 10, full duplex
Using cpsw device
TFTP from server 128.7.8.128; our IP address is 128.7.8.7
Filename 'uImage'.
Load address: 0x81000000
Loading: T T T T T T T T T T T 
Abort

When host is set to 1Gbps, it works.

U-Boot#  run tftpuImage
link up on port 0, speed 1000, full duplex
Using cpsw device
TFTP from server 128.7.8.128; our IP address is 128.7.8.7
Filename 'uImage'.
Load address: 0x81000000
Loading: T T 
TFTP error: 'File not found' (1)
Not retrying...
U-Boot# run tftpuImage
link up on port 0, speed 1000, full duplex
Using cpsw device
TFTP from server 128.7.8.128; our IP address is 128.7.8.7
Filename 'uImage'.
Load address: 0x81000000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################
         816.4 KiB/s
done
Bytes transferred = 7879697 (783c11 hex)

  • Hi,

    Please post all the required information from this checklist: processors.wiki.ti.com/.../5x_CPSW
  • Hi,

    The first question is determining if you have a link at 10Mbps, the next question will be the code necessary is written for 10Mbps for the board. TI does not test the PHYs that slow on the EVM.

    What is reason you want to run the link at 10Mbps?

    How are you setting the link speed for 10Mbps?

    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

    Please post the results of those two commands.

    Between these two register dumps you should be to see if you a link as well as other information.

    Best Regards,
    Schuyler
  • ----------------------------------------PHY basic info as bellow----------------------
    We use two 88E1111 as PHYs , one is MNG-Port(Addr is 0x5 ) and the other as OUT-BAND (Addr is 0x1)
    U-Boot#
    U-Boot#
    U-Boot#
    U-Boot# mii info
    PHY 0x01: OUI = 0x5043, Model = 0x0C, Rev = 0x02, 1000baseX, HDX
    PHY 0x05: OUI = 0x5043, Model = 0x0C, Rev = 0x02, 1000baseX, FDX
    U-Boot# <INTERRUPT>
    U-Boot#
    U-Boot#
    U-Boot#
    U-Boot#


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


    U-Boot# mii dump 0 1
    1. (ffff) -- PHY status register --
    (8000:8000) 1.15 = 1 100BASE-T4 able
    (4000:4000) 1.14 = 1 100BASE-X full duplex able
    (2000:2000) 1.13 = 1 100BASE-X half duplex able
    (1000:1000) 1.12 = 1 10 Mbps full duplex able
    (0800:0800) 1.11 = 1 10 Mbps half duplex able
    (0400:0400) 1.10 = 1 100BASE-T2 full duplex able
    (0200:0200) 1. 9 = 1 100BASE-T2 half duplex able
    (0100:0100) 1. 8 = 1 extended status
    (0080:0080) 1. 7 = 1 (reserved)
    (0040:0040) 1. 6 = 1 MF preamble suppression
    (0020:0020) 1. 5 = 1 A/N complete
    (0010:0010) 1. 4 = 1 remote fault
    (0008:0008) 1. 3 = 1 A/N able
    (0004:0004) 1. 2 = 1 link status
    (0002:0002) 1. 1 = 1 jabber detect
    (0001:0001) 1. 0 = 1 extended capabilities
  • Hi,
    Thank you for the mii utility output. There are two conditions indicated that should be researched. Both remote fault and jabber detect are set, I would recommend consulting the PHY datasheet as to what these bits mean.

    After looking at the current U-Boot driver code the cpsw driver does not support a phy speed of 10Mbps and is probably complicated by using RGMII PHYs. You will need to check the PHY datasheet about in 10Mbps mode the RGMII PHY will or may use in-band mode. Since the SDK being used is not reported here I can only make a general suggestion on the code to look at and modify for the customer needs using the latest (at this time) SDK which is 05.02....

    If I understand the issue correctly you might try adding something like this to the cpsw driver code in drivers/net/cpsw.c. There are several conditional statements that are setting various bits in the MAC control register. There are selections based on PHY speed, after the (phy->speed==100) conditional you might try adding this line which is from the Linux driver cpsw.c so it may not drop into the U-Boot driver:

    /* in band mode only works in 10Mbps RGMII */
    else if ((phy->speed == 10) && phy_interface_is_rgmii(phy))
    mac_control |= BIT(18); /* In Band mode */

    The register is being accessed is defined here in the AM335x TRM
    Table 14-189. MACCONTROL Register Field Descriptions

    We will take under review about adding 10Mbps support to future SDK releases but for the moment I have not tried the provided code and only offer this solution as a recommendation for a work around. Please let us know how it works out.

    Best Regards,
    Schuyler
  • Thanks for the reply,

    I have a question ,  where is the definition of  the function  phy_interface_is_rgmii() , I have added the code but Compiled failed  , as follow 

  • Hi , Schuyler

    I have added follow codes ,

    #if 1
    static int phy_interface_is_rgmii(struct phy_device *phydev)
    {
    return phydev->interface <= PHY_INTERFACE_MODE_RGMII_TXID;
    }
    #endif

    static void cpsw_slave_update_link(struct cpsw_slave *slave,
    struct cpsw_priv *priv, int *link)
    {
    struct phy_device *phy = priv->phydev;
    u32 mac_control = 0;

    phy_startup(phy);
    *link = phy->link;

    if (*link) { /* link up */
    mac_control = priv->data.mac_control;
    if (phy->speed == 1000)
    mac_control |= GIGABITEN;
    if (phy->duplex == DUPLEX_FULL)
    mac_control |= FULLDUPLEXEN;
    if (phy->speed == 100)
    mac_control |= MIIEN;
    /* in band mode only works in 10Mbps RGMII */
    else if ((phy->speed == 10) && phy_interface_is_rgmii(phy))
    mac_control |= BIT(18); /* In Band mode */
    }

    if (mac_control == slave->mac_control)
    return;

    if (mac_control) {
    printf("link up on port %d, speed %d, %s duplex\n",
    slave->slave_num, phy->speed,
    (phy->duplex == DUPLEX_FULL) ? "full" : "half");
    } else {
    printf("link down on port %d\n", slave->slave_num);
    }

    __raw_writel(mac_control, &slave->sliver->mac_control);
    slave->mac_control = mac_control;
    }

    Finally , it works

    U-Boot# <INTERRUPT>
    U-Boot# ping 128.7.8.128
    link up on port 0, speed 10, full duplex
    Using cpsw device
    host 128.7.8.128 is alive
    U-Boot#

    uImage can be download in speed of 10-M successfully

    -Boot#
    U-Boot#
    U-Boot#
    U-Boot# run tftpuImage
    link up on port 0, speed 10, full duplex
    Using cpsw device
    TFTP from server 128.7.8.128; our IP address is 128.7.8.7
    Filename 'uImage'.
    Load address: 0x81000000
    Loading: #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################
    506.8 KiB/s
    done
    Bytes transferred = 7879697 (783c11 hex)
    U-Boot# <INTERRUPT>
    U-Boot#
    U-Boot#

    Thanks for support of TI

    Best Regards,

    ZTE-liukai
  • Hi,
    I see two posts. The first looks like a compilation issue. The latest post looks like you are able to successfully download the kernel at the 10Mbps bit rate. I just want to confirm that the issue you were having is resolved.
    Thanks,

    Best Regards,
    Schuyler