AnsweredAssumed Answered

RMII with imx6ul not working

Question asked by Asma Alekar on Sep 2, 2019
Latest reply on Sep 4, 2019 by Asma Alekar

Hello All,

 

We have custom board made on imx6ul. I am trying to get my ethernet working on ethernet2 with TI DP83822 in RMII mode. I am getting the following log output.

 

imx sema4 driver is registered.
[drm] Initialized vivante 1.0.0 20120216 for platform:Vivante GCCore on minor 0
[drm] Initialized vivante 1.0.0 20120216 on minor 0
brd: module loaded
loop: module loaded
spi_imx 2010000.ecspi: probed
libphy: Fixed MDIO Bus: probed
CAN device driver interface
OF: /soc/aips-bus@02000000/ethernet@020b4000: could not get #gpio-cells for /soc/aips-bus@02100000/i2c@021a4000/gpio@20
fec 20b4000.ethernet: 20b4000.ethernet supply phy not found, using dummy regulator
pps pps0: new PPS source ptp0
fec 20b4000.ethernet (unnamed net_device) (uninitialized): Invalid MAC address: 00:00:00:00:00:00
fec 20b4000.ethernet (unnamed net_device) (uninitialized): Using random MAC address: 1e:cd:92:b1:09:15
libphy: fec_enet_mii_bus: probed
fec 20b4000.ethernet eth0: registered PHC device 0
usbcore: registered new interface driver kaweth
pegasus: v0.9.3 (2013/04/25), Pegasus/Pegasus II USB Ethernet driver
usbcore: registered new interface driver pegasus
usbcore: registered new interface driver rtl8150
usbcore: registered new interface driver r8152
usbcore: registered new interface driver asix
usbcore: registered new interface driver ax88179_178a
usbcore: registered new interface driver cdc_ether
usbcore: registered new interface driver net1080
usbcore: registered new interface driver cdc_subset
usbcore: registered new interface driver zaurus
usbcore: registered new interface driver cdc_ncm
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver

 

When I do ifconfig, I get the following output:

root@imx6ulevk:~# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:140 (140.0 B) TX bytes:140 (140.0 B)

 

I am not gettinh ethernet working, following is the device tree... what could be wrong 

pinctrl_enet2: enet2grp {
fsl,pins = <
MX6UL_PAD_GPIO1_IO07__ENET2_MDC 0x1b0b0
MX6UL_PAD_ENET1_TX_DATA1__ENET2_MDIO 0x1b0b0
MX6UL_PAD_ENET2_RX_EN__ENET2_RX_EN 0x1b0b0
MX6UL_PAD_ENET2_RX_ER__ENET2_RX_ER 0x1b0b0
MX6UL_PAD_ENET2_RX_DATA0__ENET2_RDATA00 0x1b0b0
MX6UL_PAD_ENET2_RX_DATA1__ENET2_RDATA01 0x1b0b0
MX6UL_PAD_ENET2_TX_EN__ENET2_TX_EN 0x1b0b0
MX6UL_PAD_ENET2_TX_DATA0__ENET2_TDATA00 0x1b0b0
MX6UL_PAD_ENET2_TX_DATA1__ENET2_TDATA01 0x1b0b0
MX6UL_PAD_ENET2_TX_CLK__ENET2_REF_CLK2 0x4001b031
>;

 

&fec2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_enet2>;
pinctrl-assert-gpios = <&pca9535_1 8 GPIO_ACTIVE_HIGH>; /*dp83822 reset gpio*/
phy-mode = "rmii";
phy-handle = <&ethphy1>;
status = "okay";

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

ethphy1: ethernet-phy@0 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <0>;
clocks = <&clks IMX6UL_CLK_ENET2_REF>;
clock-names = "rmii-ref";
device-type = "ethernet-phy";
};
};
};

 

what could possibly be wrong?

I have also referred following links

linux/imx7d-sdb.dts at master · torvalds/linux · GitHub 

linux/imx6ul-14x14-evk.dts at master · torvalds/linux · GitHub 

imx6sx enet2 issue 

 

I have also made changes to mach-imx6ul.c

static void __init imx6ul_enet_phy_init(void)
{
    if (IS_BUILTIN(CONFIG_PHYLIB)) {
        /*
         *  qt850 uses DP83822
         *
         */
        #define TI_DP83822_PHY_ID       0x2000a240
        phy_register_fixup(PHY_ANY_ID, TI_DP83822_PHY_ID,
                 0xffffffff, DP83822_phy_fixup);
                 pr_warn("TI_DP83822_PHY_ID initialiseing\n");    
    }
}

 

Any other change do I need to make for clock or anything?

 

 

Thanks,

Asma

Outcomes