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.

Phy GigaEthernet RTL8211E on AM3359 board doesn't work

Other Parts Discussed in Thread: AM3359

We have a AM3359 board designed by ourselves.The phy is RTL8211E on the board.However,the ethernet doesn't work in both uboot and linux kernel.

I set the mode of MII as RGMII mode.RGMII1 interface is connected to the phy.

AM3359 could find the phy and set the register of phy.The status of phy shows that the phy links up.
However,When I ping network,it shows as following:

cpsw slave init

link up on port 0, speed 100, full duplex

What is the status of linking up mean?
In addtion,Does AM3359 support the Gbit phy named RTL8211E? 

  • John

    Can you provide kernel boot up logs?
    Is the phy connected to EMAC 0 or EMAC 1?

    Regards
    Mugunthan V N

  • Hi,John

    Thanks for your reply.

    The phy is connected to RGMII1 directly.I think the RGMII1 is EMAC0

    here is my connection,RGMII1 interface:

    Am3359 Pin connect to  PHY RTL8211E
    GMII1_TXCLK TXC
    GMII1_TXD0 TXD0
    GMII1_TXD1 TXD1
    GMII1_TXD2 TXD2
    GMII1_TXD3 TXD3
    GMII1_TXEN TXCLT
    GMII1_RXCLK RXC
    GMII1_RXD0 RXD0
    GMII1_RXD1 RXD1
    GMII1_RXD2 RXD2
    GMII1_RXD3 RXD3
    GMII1_RXDV RXCTL/PHYAD2
    GMII1_MDIO_CLK MDC
    GMII1_MDIO_DATA MDIO

    I modifed board-am335xevm.c as following

    /* Module pin mux for rgmii1 */
    static struct pinmux_config rgmii1_pin_mux[] = {
    {"mii1_txen.rgmii1_tctl", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT},
    {"mii1_rxdv.rgmii1_rctl", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN},
    {"mii1_txd3.rgmii1_td3", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT},
    {"mii1_txd2.rgmii1_td2", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT},
    {"mii1_txd1.rgmii1_td1", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT},
    {"mii1_txd0.rgmii1_td0", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT},
    {"mii1_txclk.rgmii1_tclk", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT},
    {"mii1_rxclk.rgmii1_rclk", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN},
    {"mii1_rxd3.rgmii1_rd3", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN},
    {"mii1_rxd2.rgmii1_rd2", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN},
    {"mii1_rxd1.rgmii1_rd1", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN},
    {"mii1_rxd0.rgmii1_rd0", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN},
    {"mdio_data.mdio_data", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
    {"mdio_clk.mdio_clk", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT_PULLUP},
    {NULL, 0},
    };

    static void rgmii1_init(void)
    {
    setup_pin_mux(rgmii1_pin_mux);
    return;
    }

    static void __init am335x_eth_init(void)
    {
    rgmii1_init();
    am33xx_cpsw_init(1);
    }

    static void __init am335x_evm_init(void)
    {
    .........................

    am335x_i2c0_init();
    am335x_eth_init();
    ...........................
    }

    The address of phy is 001,I modified the am33xx_cpsw_slaves in arch\arm\mach-oma\devices.c:

    static struct cpsw_slave_data am33xx_cpsw_slaves[] = {
    {
    .slave_reg_ofs = 0x208,
    .sliver_reg_ofs = 0xd80,
    .phy_id = "0:01",  // RTL8211E address
    },
    {
    .slave_reg_ofs = 0x308,
    .sliver_reg_ofs = 0xdc0,
    .phy_id = "0:02",
    },
    };

    I have modified MAC_MII_SEL register as following:

    #define RGMII_MODE_ENABLE 0x3A

    __raw_writel(RGMII_MODE_ENABLE,
    AM33XX_CTRL_REGADDR(MAC_MII_SEL));

    Is there someting wrong?What else should I configure with RGMII?

    Thanks!

    Regards!

  • The PHY can link to the attached Ethernet device without RGMII working properly and the link status is provided by reading PHY registers with MDIO.

    The RGMII timing budget is very tight, so I suspect your design is violating timing requirements.  It is very important you perform timing analysis when designing your system using RGMII.

    I’m not a software expert, but I think the drivers in the Linux kernel were written for the Atheros AR8031.  You may need to modify this driver to properly configure the RTL8211E and AM335x to work together.

    Regards,
    Paul   

  • Should I modify the driver about  CPSW?

  • Hi,

    Where can I find AM3359 timing  requirements?

    In addition,TXD[0:3]、RXD[0:3] and TXCTL have signals. However, RXCTL doesn't have any signals,it is always  low.Why does it happen? 

  • Peaves

    The driver in Linux is phy independent.

    John

    The internal delay in SoC is disabled in current Linux Kernel and it needs to be enabled in Phy if needed. You can refer to the following patch in which AR8031 internal delay is enabled
    http://arago-project.org/git/projects/?p=linux-am33x.git;a=commit;h=e1b08eedb60cf482795427b9341f456122773522

    with regards
    Mugunthan V N

  • You can find the AM335x RGMII timing parameters in the Ethernet MAC/Switch RGMII Electrical Data and Timing section of the AM335x data sheet.

    http://www.ti.com/product/am3359

    The RXCTL is sourced by the Ethernet PHY so you need determine why the PHY is not providing the signal you expect.  Most PHYs have boot strap inputs that configure the device during power-up.  You may need to verify these boot strap inputs are correct based on the expected configuration of the PHY.  I noticed your code has some internal AM335x resistors enabled which may be conflicting with any external resistors being used to set the boot strap inputs during power-up.

    As mentioned by Mugunthan, it is important you understand the internal delay mode configuration of both AM335x and PHY.  Note: The AM335x has the internal delay mode feature enabled by default, but this feature is not supported by AM335x.  So you must turn off this feature in the AM335x and enable it in the PHY.  Otherwise you must provide the delay by adjusting etch lengths in the PCB.  Please read Advisory 1.0.10 in the AM335x silicon errata.

    Regards,
    Paul

  • Hi,

    Thanks  Mugunthan and Paul.

    I  have found AM3359 RGMII timing parameters.And I shoud verify the RXCTL' signal.

    Paul,you said my  code had some internal AM335x resistors enabled which may be conflicting with any external resistors,could you point out clearly?

    I have disable AM3359 internal delay mode by writing MAC_MII SEL register to 0x3A,as following:

    #define RGMII_MODE_ENABLE 0x3A

    __raw_writel(RGMII_MODE_ENABLE,
    AM33XX_CTRL_REGADDR(MAC_MII_SEL));

    RTL8211E has no registers that could be configured to delay TXC and RXC ,it only has two pin named TXDLY and RXDLY which used to configure TXC and RXC to 2ns delay.

    However,I pull up the two pin to high  to make TXC and RXC delay 2ns.It doesn't work as well.

  • Hi,

    I have found out the reason. It is the problem of PCB board,The RXCTL PIN is dry joint.

    Now I can download uImage and rootfs via tftp,Linux kernel's ethenet works as well.

    Thanks TI engineer.I learn a lot of knowledge about PHY from you.

    Best Regards.