I'm trying to get an i.MX8QXP to communicate with an RMII Ethernet PHY, specifically a Microchip KSZ8061RNDW. I can see the 50MHz reference clock coming out of the "ENET0_RGMII_TXC" pad. When I do an "ifconfig eth0 up", I get this notification in Linux telling me the link is up so I know the MDIO is working.
[ 2543.250265] Micrel KSZ8061 5b040000.ethernet-1:01: attached PHY driver [Micrel KSZ8061] (mii_bus:phy_addr=5b040000.ethernet-1:01, irq=POLL)
[ 2546.342710] fec 5b040000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
My device tree looks like this:
&fec1 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&pinctrl_fec1>;
clocks = <&clk IMX8QXP_ENET0_IPG_CLK>,
<&clk IMX8QXP_ENET0_AHB_CLK>,
<&clk IMX8QXP_ENET0_REF_50MHZ_CLK>,
<&clk IMX8QXP_ENET0_PTP_CLK>,
<&clk IMX8QXP_ENET0_TX_CLK>;
phy-mode = "rmii";
phy-handle = <ðphy1>;
phy-supply = <®_3v3_eth0>;
fsl,magic-packet;
status = "okay";
mdio {
#address-cells = <1>;
#size-cells = <0>;
ethphy1: ethernet-phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <1>;
phy-reset-gpios = <&gpio3 18 GPIO_ACTIVE_LOW>;
reset-assert-us = <1000>;
reset-deassert-us = <2000>;
max-speed = <100>;
};
};
};
&iomuxc {
pinctrl_fec1: fec1grp {
fsl,pins = <
SC_P_COMP_CTL_GPIO_1V8_3V3_ENET_ENETB0_PAD 0x000014a0
SC_P_COMP_CTL_GPIO_1V8_3V3_ENET_ENETB1_PAD 0x000014a0
SC_P_ENET0_MDC_CONN_ENET0_MDC 0x00000060
SC_P_ENET0_MDIO_CONN_ENET0_MDIO 0x00000060
SC_P_ENET0_RGMII_TXC_CONN_ENET0_RCLK50M_OUT 0x00000060
SC_P_ENET0_RGMII_RXD0_CONN_ENET0_RGMII_RXD0 0x00000060
SC_P_ENET0_RGMII_RXD1_CONN_ENET0_RGMII_RXD1 0x00000060
SC_P_ENET0_RGMII_RXD2_CONN_ENET0_RMII_RX_ER 0x00000060
SC_P_ENET0_RGMII_RX_CTL_CONN_ENET0_RGMII_RX_CTL 0x00000060
SC_P_ENET0_RGMII_TXD0_CONN_ENET0_RGMII_TXD0 0x00000060
SC_P_ENET0_RGMII_TXD1_CONN_ENET0_RGMII_TXD1 0x00000060
SC_P_ENET0_RGMII_TX_CTL_CONN_ENET0_RGMII_TX_CTL 0x00000060
>;
};
};When I added some debugging code to the FEC driver to tell me the speed of the reference clock, it indicated that the clock rate was 0Hz. So I'm pretty sure that the 50MHz reference clock which is coming from the "ENET0_RGMII_TXC" pad is not getting properly plumbed back into the FEC.
I did find this issue i.MXQXP RMII + 4.19.35 NXP Kernel Not Working which is similar enough to my problem to make me think the solution described there would also fix my problem. That discussion suggested a kernel patch is needed to fix that reference clock problem, but I've not been able to find the patch, or create it on my own.
We are using a 4.14 kernel which is not unlike this one 4.14.98_2.3.0, and I'm not sure if we can move to a newer kernel yet. So it would be ideal if we could find or create a patch that would fix the problem with the reference clock in the FEC.
Any help is greatly appreciated.