AnsweredAssumed Answered

substitution of Ethernet phy chip

Question asked by kilsu hong on Mar 4, 2015
Latest reply on Mar 4, 2015 by igorpadykov

Dear,

 

I have tried to change ethernet phy chip (AR8031 --> Realtek 8211).

I added phy driver structure as below

 

====================================================================

.phy_id = 0x001cc912,

.name  = "RTL8211B Gigabit Ethernet",

.phy_id_mask = 0x001fffff,

.features  = PHY_GBIT_FEATURES,

.flags  = PHY_HAS_INTERRUPT,

.config_aneg = &genphy_config_aneg,

.read_status  = &genphy_read_status,

.ack_interrupt = &rtl821x_ack_interrupt,

.config_intr  = &rtl8211b_config_intr,

.driver  = { .owner = THIS_MODULE,},

====================================================================


But, my device cannot find eth0.

I looked through source code, and at "fec_enet_mii_probe", there is no phy_map information


=====================================================================

static int fec_enet_mii_probe(struct net_device *ndev)

{

  struct fec_enet_private *fep = netdev_priv(ndev);

  struct phy_device *phy_dev = NULL;

  char mdio_bus_id[MII_BUS_ID_SIZE];

  char phy_name[MII_BUS_ID_SIZE + 3];

  int phy_id;

  int dev_id = fep->pdev->id;

 

  fep->phy_dev = NULL;

 

  /* check for attached phy */

  for (phy_id = 0; (phy_id < PHY_MAX_ADDR); phy_id++) {

       if ((fep->mii_bus->phy_mask & (1 << phy_id)))

            continue;

       if (fep->mii_bus->phy_map[phy_id] == NULL)

            continue;

       if (fep->mii_bus->phy_map[phy_id]->phy_id == 0)

             continue;

       if (dev_id--)

            continue;

       strncpy(mdio_bus_id, fep->mii_bus->id, MII_BUS_ID_SIZE);

       break;

  }

.......

=====================================================================


what should I check to register phy_map?

In addition, where can I find AR8031 driver source code and how register information for AR8031 to platform?

(My base source code is mx6dl_sabreSD)


Outcomes