Ethernet on Custom Board doesn't work

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Ethernet on Custom Board doesn't work

Jump to solution
6,052 Views
stimpy
Contributor III

Hi,

We have designed a custom board with I.MX6 SoloX (MCIMX6X3EVO10AB). The whole board is very close to the eval board 6SX SABRE SDB (see relevant schematic_eth.png in attachment). The difference on our board is that only 100Mbps signals are used from RJ45 and 1Gbps Signals are not connected.

Linux of Yocto Rocko is running on it.

If the board is connected over ethernet the LED_ACT LED starts blinking. After about 15 seconds the LED_10_100 turns on and following messages are printed over serial console

fec 2188000.ethernet eth0: Link is Up - 10Mbps/Full - flow control off
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

When ethernet cable is unplugged, following messages appear:

fec 2188000.ethernet eth0: Link is Down
IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

Following activity are measured on the pins:

ENET1_MDC (2.36MHz, 0..3.3V),

ENET1_MDIO (0.3..3V),

ENET2_RX_CLK (25MHz, 0..3.3V),

ENET2_TX_CLK (3 V),

ENET2_COL(0V)

ENET2_CRS (3.3V)

RGMIII1_TD[0:2] (0..1.5V, some data every few seconds )

RGMIII1_TD[3] (0..1.5V, some data bit more frequent than RGMIII1_TD[0:2] )

RGMIII1_TX_CTL (0..1.5V, some data every few seconds )

RGMIII1_TXC (2.5MHz, 0..1.5V)

RGMIII1_RD[0:3] (0..1.5V), 

RGMIII1_RXC (25 MHz, 0...1.5V), 

RGMIII1_RX_CTL (0..1.5V), 

Suspicious things:

- TD seems to be on lower frequency than RX. This could be due to that the imx6 thinks it's 10Mbps and the PHY is on 100Mbps.

In the DeviceTree (see imx6sx-sdb.dtsi in attachment) there are following entries:

&iomuxc {
     pinctrl-names = "default";
     pinctrl-0 = <&pinctrl_hog &pinctrl_can_gpios>;

     imx6x-sdb {
...
          pinctrl_enet1: enet1grp {
               fsl,pins = <
                          MX6SX_PAD_ENET1_MDIO__ENET1_MDIO     0xa0b1
                    MX6SX_PAD_ENET1_MDC__ENET1_MDC          0xa0b1
                    MX6SX_PAD_RGMII1_TXC__ENET1_RGMII_TXC     0xa0b1
                    MX6SX_PAD_RGMII1_TD0__ENET1_TX_DATA_0     0xa0b1
                    MX6SX_PAD_RGMII1_TD1__ENET1_TX_DATA_1     0xa0b1
                    MX6SX_PAD_RGMII1_TD2__ENET1_TX_DATA_2     0xa0b1
                    MX6SX_PAD_RGMII1_TD3__ENET1_TX_DATA_3     0xa0b1
                    MX6SX_PAD_RGMII1_TX_CTL__ENET1_TX_EN     0xa0b1
                    MX6SX_PAD_RGMII1_RXC__ENET1_RX_CLK     0x3081
                    MX6SX_PAD_RGMII1_RD0__ENET1_RX_DATA_0     0x3081
                    MX6SX_PAD_RGMII1_RD1__ENET1_RX_DATA_1     0x3081
                    MX6SX_PAD_RGMII1_RD2__ENET1_RX_DATA_2     0x3081
                    MX6SX_PAD_RGMII1_RD3__ENET1_RX_DATA_3     0x3081
                    MX6SX_PAD_RGMII1_RX_CTL__ENET1_RX_EN     0x3081
                    MX6SX_PAD_ENET2_RX_CLK__ENET2_REF_CLK_25M     0x91
    >;
          };
          pinctrl_enet_3v3: enet3v3grp {
               fsl,pins = <
                    MX6SX_PAD_ENET2_COL__GPIO2_IO_6      0x000010B0
                    MX6SX_PAD_ENET2_CRS__GPIO2_IO_7      0x000010B0
                    MX6SX_PAD_ENET2_TX_CLK__GPIO2_IO_9      0x000010B0
               >;
          };
/*
          pinctrl_enet2: enet2grp {
...
          };
*/
...

&fec1 {
     pinctrl-names = "default";
     pinctrl-0 = <&pinctrl_enet1>;
     phy-supply = <®_enet_3v3>;
     phy-mode = "rgmii";
     phy-handle = <ðphy1>;
     status = "okay";

     mdio {
          #address-cells = <1>;
          #size-cells = <0>;

          ethphy1: ethernet-phy@1 {
               reg = <1>;
          };
/*
          ethphy2: ethernet-phy@2 {
               reg = <2>;
          };*/
     };
};‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Do you have any clue where to check next what to do?

Many thanks in advance for any tips.

Regards Dani

Labels (2)
0 Kudos
1 Solution
4,471 Views
stimpy
Contributor III

A primary mistake here was that the pull-up to ENET_3V3 from MDIO line was missing. So the Linux OS detects the controller and can retrieve and IP and autonegotiate speed.

Now I'm experiencing following issues:

  • U-Boot complains:
    U-Boot 2017.03-imx_v2017.03_4.9.88_2.0.0_ga+gb76bb1b (Sep 13 2018 - 16:28:25 +0200)
    
    CPU: Freescale i.MX6SX rev1.2 996 MHz (running at 792 MHz)
    CPU: Extended Commercial temperature grade (-20C to 105C) at 46C
    Reset cause: POR
    Model: Freescale i.MX6 SoloX SDB RevB Board
    Board: MX6SX SABRE SDB
    DRAM: 512 MiB
    PMIC: PFUZE100! DEV_ID=0x11 REV_ID=0x21
    MMC: FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
    *** Warning - bad CRC, using default environment
    
    Display: Hannstar-XGA (1024x768)
    Video: 1024x768x18
    In: serial
    Out: serial
    Err: serial
    switch to partitions #0, OK
    mmc1 is current device
    Net:
    Error: ethernet@02188000 address not set.
    No ethernet found.
  • Using miii command in U-Boot does not discover the PHY either
    => mii device
    MII devices:
  • In Linux it takes a while until link becomes ready. From time to time the message pops up:
    fec 2188000.ethernet eth0: Link is Down
    IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
    fec 2188000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
    IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

View solution in original post

0 Kudos
6 Replies
4,472 Views
stimpy
Contributor III

A primary mistake here was that the pull-up to ENET_3V3 from MDIO line was missing. So the Linux OS detects the controller and can retrieve and IP and autonegotiate speed.

Now I'm experiencing following issues:

  • U-Boot complains:
    U-Boot 2017.03-imx_v2017.03_4.9.88_2.0.0_ga+gb76bb1b (Sep 13 2018 - 16:28:25 +0200)
    
    CPU: Freescale i.MX6SX rev1.2 996 MHz (running at 792 MHz)
    CPU: Extended Commercial temperature grade (-20C to 105C) at 46C
    Reset cause: POR
    Model: Freescale i.MX6 SoloX SDB RevB Board
    Board: MX6SX SABRE SDB
    DRAM: 512 MiB
    PMIC: PFUZE100! DEV_ID=0x11 REV_ID=0x21
    MMC: FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
    *** Warning - bad CRC, using default environment
    
    Display: Hannstar-XGA (1024x768)
    Video: 1024x768x18
    In: serial
    Out: serial
    Err: serial
    switch to partitions #0, OK
    mmc1 is current device
    Net:
    Error: ethernet@02188000 address not set.
    No ethernet found.
  • Using miii command in U-Boot does not discover the PHY either
    => mii device
    MII devices:
  • In Linux it takes a while until link becomes ready. From time to time the message pops up:
    fec 2188000.ethernet eth0: Link is Down
    IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
    fec 2188000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
    IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
0 Kudos
4,471 Views
stimpy
Contributor III

The evaluation board had the same issue. After changing the switch this problem has gone.

igorpadykov‌: thank you for your effort.

0 Kudos
4,471 Views
igorpadykov
NXP Employee
NXP Employee

one can try to debug it checking signals with oscilloscope in

uboot/drivers/net/fec_mxc.c,  ..freescale/mx6sxsabresd/mx6sxsabresd.c

Best regards
igor

0 Kudos
4,471 Views
stimpy
Contributor III

Hi igor,

Many thanks for your reply.

To try to get it work on u-boot is a great idea indeed and I will definitely try to do that. Thank you for showing me where.

According to your advice I have changed the device tree. I set rmii in the device tree by replacing the rgmii. Checking dmesg I can see:

fec 2188000.ethernet eth0: registered PHC device 0
Generic PHY 2188000.ethernet-1:01: attached PHY driver [Generic PHY] (mii_bus:phy_addr=2188000.ethernet-1:01, irq=-1)


The messages on plugging in and out

fec 2188000.ethernet eth0: Link is Up - 10Mbps/Full - flow control off
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
fec 2188000.ethernet eth0: Graceful transmit stop did not complete!
fec 2188000.ethernet eth0: Link is Down
IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

With rgmii I get these messages on startup:

fec 2188000.ethernet eth0: registered PHC device 0
Generic PHY 2188000.ethernet-1:01: attached PHY driver [Generic PHY] (mii_bus:phy_addr=2188000.ethernet-1:01, irq=-1)

And when plug and unplugging 

fec 2188000.ethernet eth0: Link is Up - 10Mbps/Full - flow control off
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
fec 2188000.ethernet eth0: Link is Down
IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

If I check iMX Linux Reference Manual (IMXLXRM) Table 43.1 Pin Usage in MII, RMII, p. 300, I can see that with the wiring I am using and that is used on the eval board 6SX Sabre SDB (Schematics) I should use RGMII: i.e. the signal FEC_TX_CLK is wired (used in RGMII, not in RMII) and the Transceiver (same on both boards) does only support RGMII and not RMII. With this in mind I am more convinced that the way it has been on the device tree by using RGMII must be correct. What makes you thinking differently?

Thank you again,

Dani

0 Kudos
4,471 Views
igorpadykov
NXP Employee
NXP Employee

Hi Dani

on below case rmii in the device tree worked fine with i.MX6DL

How do I set the ENET_REF_CLK rate 

Best regards
igor

0 Kudos
4,471 Views
igorpadykov
NXP Employee
NXP Employee

Hi stimpy

first one can try to make it work in uboot, please check ethernet clocks in

setup_fec() in uboot/board/freescale/mx6sxsabresd/mx6sxsabresd.c

mx6sxsabresd.c\mx6sxsabresd\freescale\board - uboot-imx - i.MX U-Boot 

"CONFIG_FEC_ENET_DEV" in uboot/include/configs/mx6sxsabresd.h

Register settings in IOMUXC_GPR_GPR1, ENET2_TX_CLK_DIR,ENET2_CLK_SEL

sect.35.4.2 GPR1 General Purpose Register (IOMUXC_GPR_GPR1) i.MX6SX Reference Manual
http://www.nxp.com/docs/en/reference-manual/IMX6SXRM.pdf

In device tree one can try with

phy-mode = "rmii";

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos