AnsweredAssumed Answered

I'm debugging eht phy LAN8720 driver, and i met the problem the eth0 can not get ip address, and can not ping ip after  i set the ip address manually.

Question asked by wenjing wang on Sep 27, 2014
Latest reply on Jul 19, 2016 by 承 王

My develop env is :

               IMX6DL board

               Linux kernel 3.0.35

  and my pin config is :

MX6DL_PAD_ENET_MDIO__ENET_MDIO,

  MX6DL_PAD_ENET_MDC__ENET_MDC,

MX6DL_PAD_ENET_CRS_DV__ENET_RX_EN,

MX6DL_PAD_ENET_RXD1__ENET_RDATA_1,

MX6DL_PAD_ENET_RXD0__ENET_RDATA_0,

MX6DL_PAD_RGMII_TX_CTL__ENET_ANATOP_ETHERNET_REF_OUT,

  MX6DL_PAD_ENET_REF_CLK__ENET_TX_CLK,

MX6DL_PAD_ENET_TXD1__ENET_TDATA_1,

MX6DL_PAD_ENET_TXD0__ENET_TDATA_0,

MX6DL_PAD_ENET_TX_EN__ENET_TX_EN,

in the board-mx6q_sabresd.c file:

          static struct fec_platform_data fec_data __initdata = {    

            .init = mx6q_8720_fec_phy_init, //WWJ add    

            .phy = PHY_INTERFACE_MODE_RMII,     

            .gpio_irq = MX6_ENET_IRQ,  //WWJ add

          };

#define SABRESD_LAN8720_RST IMX_GPIO_NR(1, 1)

static int mx6q_8720_fec_phy_init(struct phy_device *phydev)

{

     int val;

 

 

     printk("WWJ============%s start\n", __FUNCTION__);//WWJ

     gpio_request(SABRESD_LAN8720_RST, "lan-reset");

     gpio_direction_output(SABRESD_LAN8720_RST, 0);

     msleep(10);

     gpio_set_value(SABRESD_LAN8720_RST, 1);

 

 

     //mxc_iomux_set_gpr_register(1, 21, 1, 1);

     /* reset phy */

  

     val = phy_read(phydev, 0x0);

     msleep(500);

     printk("phydev->addr = %x\n", phydev->addr);

   

     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;

}

 

and i added the follow function:

          mxc_iomux_set_gpr_register(1, 21, 1, 1);//WWJ add for FEC_RMII_CLK

in  static void __init mx6_sabresd_board_init(void);

 

 

the attachment is my hardware env.

Outcomes