AnsweredAssumed Answered

lan8720 (RMII) with imx6Q(L3.0.35_4.1.0)

Question asked by fang min on Jun 3, 2014
Latest reply on Oct 1, 2014 by Samuel Park

Hi,

 

I connected a lan8720 (RMII) with imx6Q. We use the GPIO 16 as clock output for the phy.

i used the following the patch to my kernel. 

Re: iMX6 RGMII + ENET_REF_CLK/ENET_TX_CLK

 

But in both of uboot and kernel , the phy does not work and the link led also does not light.

because the RST pin of lan8720a on our board is connected with POR_B of imx6 control ,

it can't not be set to GPIO. i use soft reset to reset phy.

8720a.JPG.jpg

Here is my iomux config:

board_mx6q_XXX.h file

----------------------------------------------------------------------

/* ENET */

MX6Q_PAD_ENET_MDIO__ENET_MDIO,

MX6Q_PAD_ENET_MDC__ENET_MDC,

MX6Q_PAD_ENET_RXD0__ENET_RDATA_0,

MX6Q_PAD_ENET_RXD1__ENET_RDATA_1,

MX6Q_PAD_ENET_CRS_DV__ENET_RX_EN,

MX6Q_PAD_ENET_TXD0__ENET_TDATA_0,

MX6Q_PAD_ENET_TXD1__ENET_TDATA_1,

MX6Q_PAD_ENET_TX_EN__ENET_TX_EN,

MX6Q_PAD_GPIO_16__ENET_ANATOP_ETHERNET_REF_OUT,

MX6Q_PAD_ENET_RX_ER__ENET_RX_ER,

-------------------------------------------------------------------------

My fec init procedure:

board_mx6q_XXX.c file

----------------------------------------------------------------------

static int mx6q_8720_fec_phy_init(struct phy_device *phydev)

{

     int val;

     mxc_iomux_set_gpr_register(1, 21, 1, 1);

     /* reset phy */

     val = phy_read(phydev, 0x0);

     phy_write(phydev, 0x0, (val |BMCR_RESET));

    

     msleep(10);

 

     val = phy_read(phydev, 0x0);

     if (val & BMCR_PDOWN) {

phy_write(phydev, 0x0, (val & ~BMCR_PDOWN));

     }

 

     return 0;

}

--------------------------------------------------------


Please give me a suggestion or idea.

 

B&R

peter.cao

Outcomes