AnsweredAssumed Answered

RMII-MDIO fails with Linux 4.9.11 Kernel

Question asked by Doug Bailey on Apr 30, 2018
Latest reply on Jun 1, 2018 by Doug Bailey
Branched to a new discussion

I have a board based on the Freescale iMX6DL SabreSD design that I have working fine with the Korgoth based BSP that runs Linux 4.1.15. I am trying to upgrade the BSP running on the board to the Morty based BSP that runs Linux 4.9.11.

 

I have been able to port my device tree files to the new BSP and I have migrated my init files over to the systemd board initialization.

 

One problem I am having is that the Ethernet port does not operate under the new kernel. (The Ethernet port works flawlessly with the 4.1.15 kernel.)

 

The first issue I am trying to correct is the operation of the MDIO communicating with the Phy. The behavior is manifested with the use of the mii-tool utility. Sometimes when the board boots, mii-tool properly communicates and I am able to read the Phy registers. Other times, the tool fails and all that I read back from the Phy are 0xffff's. (mii-tool never fails running under the 4.1.15 kernel.)

 

The network interface on this board is different from the SabreSD board in that it is communicating to a 10/100 Micrel KSZ8081RNA Phy. It communicates via an RMII interface with the 50 MHz reference clock supplied by the PHY device. That reference clock is input on the GPIO_16 pin of the iMX6DL.

 

In my device tree file, I have the fast Ethernet controller defined as:

&fec {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_enet>;
    phy-mode = "rmii";
    phy-reset-gpios = <&gpio1 2 0>;
    fsl,magic-packet;
    status = "okay";
};

where the fec is also defined in the imx6qdl.dtsi device tree include is defined as:

fec: ethernet@02188000 {
    compatible = "fsl,imx6q-fec";
    reg = <0x02188000 0x4000>;
    interrupts-extended =
         <&gpc 0 118 IRQ_TYPE_LEVEL_HIGH>,
         <&gpc 0 119 IRQ_TYPE_LEVEL_HIGH>;
    clocks = <&clks IMX6QDL_CLK_ENET>,
         <&clks IMX6QDL_CLK_ENET>,
         <&clks IMX6QDL_CLK_ENET_REF>;
    clock-names = "ipg", "ahb", "ptp";
    stop-mode = <&gpr 0x34 27>;
    fsl,wakeup_irq = <0>;
    status = "disabled";
};

 

The IOMuxc pins for the Ethernet is defined as:
pinctrl_enet: enetgrp {
    fsl,pins = <
        MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x1b0b0
        MX6QDL_PAD_ENET_MDC__ENET_MDC 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_16__ENET_REF_CLK 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_GPIO_2__GPIO1_IO02 0x1b0b0
    >;
};

 

All of these device tree definitions are the same between the 4.1.15 and the 4.9.11 kernel.

I am at a loss for what is causing the mii-tool to fail sometimes and succeed at other times. Does anyone have suggestions where I should look to determine what has changed in the Ethernet interface?

 

Regards, 

Doug Bailey 

Outcomes