RMII interface error on i.MX6Q(KSZ8051RNL)

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

RMII interface error on i.MX6Q(KSZ8051RNL)

Jump to solution
4,107 Views
sanjeevsharma
Contributor IV

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";
};

pastedImage_1.png

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.

0 Kudos
1 Solution
2,946 Views
sanjeevsharma
Contributor IV

Root cause has been identified and we found issue in clock.

View solution in original post

0 Kudos
9 Replies
2,947 Views
sanjeevsharma
Contributor IV

Root cause has been identified and we found issue in clock.

0 Kudos
2,946 Views
lvmh
Contributor I

Hi,

I have a similar problem. Can you tell me why?I need your advice for reference.

0 Kudos
2,946 Views
shu_liu
Contributor II

Sanjeev,

What is the issue with the clock ? We still have the frame error problem with our ethernet. 

Thanks,

S

0 Kudos
2,946 Views
bernhardfink
NXP Employee
NXP Employee

Look into this thread, maybe it helps with your problem:

https://community.nxp.com/thread/389902 

Regards

0 Kudos
2,946 Views
igorpadykov
NXP Employee
NXP Employee

Hi sanjeev

one can try with nxp bsp releases described on

i.MX 6 / i.MX 7 Series Software and Development Tool|NXP 

Linux nitrogen6x 4.1.37 is not supported by nxp, it is developed by boundary

devices and issue may posted on meta-fsl-arm mailing list, so that someone

familiar with it could try to assist you.
https://lists.yoctoproject.org/listinfo/meta-freescale

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

0 Kudos
2,946 Views
sanjeevsharma
Contributor IV

Hi,

we tried on 4.1.15 kernel version with NXP BSP also but we found same result.we didn't find difference in PHY driver  and Ethernet controller driver(fec). It seems configuration or clock issue.

I could find https://community.nxp.com/thread/448768  issue which is similar to us. Please provide help in this context.

Regards

Sanjeev Sharma

0 Kudos
2,946 Views
igorpadykov
NXP Employee
NXP Employee

Hi

please try to reproduce this issue on some of nxp reference boards.

Best regards
igor

0 Kudos
2,946 Views
sanjeevsharma
Contributor IV

Hi,

we can't reproduced on nxp reference board because we can't use KSZ8051RNL PHY on nxp reference board. Do you see some configuration issue in these type of Errors ?

Regards

Sanjeev Sharma

0 Kudos
2,946 Views
igorpadykov
NXP Employee
NXP Employee

Hi

 

is it working fine in uboot?

 

Best regards
igor

0 Kudos