AnsweredAssumed Answered

RMII interface error on i.MX6Q(KSZ8051RNL)

Question asked by sanjeev sharma on Aug 25, 2017
Latest reply on Feb 27, 2018 by lvmh

Hello everyone,

 

We have a custom hardware with i.MX6 Quad CPU. we would like to use its RMII interface to communicate with KSZ8051RNL PHY.Configuration, detection and communication seem to be right, but we see a very high number of broken network packages when copying data via scp from PC to custom hardware via PHY Ethernet. Interestingly, the reverse direction does not have this problem.I mean to say TX(FEC ->PHY->HOST) communication is fine.

 

Here is the statistic.
cat /sys/custom/net/eth0/statistics/*
collisions 0
multicast 0
rx_bytes 4338780
rx_compressed 0
rx_crc_errors 504
rx_dropped 0
rx_errors 1229
rx_fifo_errors 0
rx_frame_errors 725
rx_length_errors 0
rx_missed_errors 0
rx_over_errors 0
rx_packets 8236
tx_aborted_errors 0
tx_bytes 6200152
tx_carrier_errors 0
tx_compressed 0
tx_dropped 0
tx_errors 0
tx_fifo_errors 0
tx_heartbeat_errors 0
tx_packets 8719
tx_window_errors 0

 

The system uses GPIO_16 pin to generate the reference clock.we have also enabled SION bit in imx6q-pinfunch.h

#define MX6QDL_PAD_GPIO_16__ENET_REF_CLK_RMII            0x248 0x618 0x83c 0x12 0x1

 

Device Tree:

pinctrl_enet: enetgrp {
        fsl,pins = <
                        MX6QDL_PAD_KEY_COL3__ENET_CRS          0x1b0b0
                MX6QDL_PAD_ENET_MDIO__ENET_MDIO       0x1b0b0
                MX6QDL_PAD_ENET_MDC__ENET_MDC         0x1b0b0
                MX6QDL_PAD_GPIO_16__ENET_REF_CLK_RMII 0x1b0b0
                MX6QDL_PAD_ENET_RXD0__ENET_RX_DATA0   0x1b0b0
                MX6QDL_PAD_ENET_RXD1__ENET_RX_DATA1   0x1b0b0
                MX6QDL_PAD_ENET_CRS_DV__ENET_RX_EN    0x1b0b0
                MX6QDL_PAD_ENET_RX_ER__ENET_RX_ER     0x1b0b0
                MX6QDL_PAD_ENET_TXD0__ENET_TX_DATA0   0x1b0b0
                MX6QDL_PAD_ENET_TXD1__ENET_TX_DATA1   0x1b0b0
                MX6QDL_PAD_ENET_TX_EN__ENET_TX_EN     0x1b0b0
                MX6QDL_PAD_GPIO_19__ENET_TX_ER        0x1b0b0
                MX6QDL_PAD_EIM_DA9__GPIO3_IO09          0x0b0b0
                MX6QDL_PAD_EIM_DA8__GPIO3_IO08        0x0b0b0
        >;
    };

 


&fec {  /* KSZ8051RNLU RMII interface */
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_enet>;
    phy-mode = "rmii";
    phy-reset-gpios = <&gpio3 9 0>;    /* RMII_nRST GPIO3_I009 */

 

#if 0
    interrupt-parent = <&gpio3>;    /* RMII Phy Interrupt GPIO3_IOO8 */
    interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
#endif
    status = "okay";
};

 

 

Tested software versions:

Linux nitrogen6x 4.1.37

 

I would like to understand following things.

 

1: WHY only issue in RX Channel.

2: We could see CRC and Frame error. what could be the reason.

 

Any help would be appreciated.

Outcomes