On Thu, 2009-02-12 at 15:22 +0530, Subrahmanya, Chaithrika wrote: > > On Wed, 2009-02-11 at 11:20 +0530, Subrahmanya, Chaithrika wrote: > > > > On Tue, 2009-02-10 at 18:09 +0530, [email protected] wrote: > > > > > From: Chaithrika U S <[email protected]> > > > > > > > > > > @@ -2443,34 +2454,43 @@ static int emac_dev_open(struct > > net_device > > > > *ndev) > > > > > > > > > > /* find the first phy */ > > > > > priv->phydev = NULL; > > > > > - for (phy_addr = 0; phy_addr < PHY_MAX_ADDR; phy_addr++) { > > > > > - if (priv->mii_bus->phy_map[phy_addr]) { > > > > > - priv->phydev = priv->mii_bus- > > > > >phy_map[phy_addr]; > > > > > - break; > > > > > + if (priv->phy_mask) { > > > > > + for (phy_addr = 0; phy_addr < PHY_MAX_ADDR; > > phy_addr++) > > > > { > > > > > + if (priv->mii_bus->phy_map[phy_addr]) { > > > > > + priv->phydev = priv->mii_bus- > > > > >phy_map[phy_addr]; > > > > > + break; > > > > > + } > > > > > > > > Address 0, I believe is broadcast PHY. Would this cause problem > > for > > > > DM644x EVM with LX971? > > > > > > > > What happens if we have multiple phys? For example wired and > > wireless > > > > or even optical interface? > > > > > > > > Also, if we can scan for PHYs, do we still need to hard code the > > > > phy_mask in platform data? Can the phy_mask be determined > > dynamically > > > > based on the scan? > > > > > > If there are multiple PHYs the first phy found will be connected. > > > If all the phy address have to be scanned, then the mask should be > > set to > > > 0xffffffff. > > I'm trying to get at is that if we already know the phy address(es), > > and > > it is already in platform data. What additional value does scan phy > > address dynamically provide? Also, the code only allows 1 phy. To > > manage multiple phys priv->phydev needs to be an array. > > > > > > > > The mask is used to make sure you only look at PHYs you care about. > > > Setting the mask to 0 will not access registers of any PHY. > > > > If this is what you are trying to do, should the code look more like > > > > ... > > if ((priv->phy_mask & (0x1 << phy_addr)) && > > priv->mii_bus->phy_map[phy_addr]) > > priv->phydev = priv->mii_bus->phy_map[phy_adr]; > > ... > > > > The phy mask information is used by the MDIO module during scan. > It sees to that the scan is performed for the addresses specified by the > address mask.
I see. Somehow I got the incorrect impression about a single EMAC attached multiple phy support. Thanks for all the explanations. Regards, Steve > > Thanks, > Chaithrika _______________________________________________ Davinci-linux-open-source mailing list [email protected] http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
