1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 08:42:12 +02:00

net: xilinx_axiemac: Fill the phy node pointer in phydev

This patch assings the phynode pointer to the phydev node as it is needed
later in the corresponding phy driver to read phy properties from DT.

Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
This commit is contained in:
Siva Durga Prasad Paladugu
2019-03-15 17:46:45 +05:30
committed by Michal Simek
parent 0384ac0583
commit fccfb71004

View File

@@ -93,6 +93,7 @@ struct axidma_priv {
struct phy_device *phydev; struct phy_device *phydev;
struct mii_dev *bus; struct mii_dev *bus;
u8 eth_hasnobuf; u8 eth_hasnobuf;
int phy_of_handle;
}; };
/* BD descriptors */ /* BD descriptors */
@@ -276,6 +277,8 @@ static int axiemac_phy_init(struct udevice *dev)
phydev->supported &= supported; phydev->supported &= supported;
phydev->advertising = phydev->supported; phydev->advertising = phydev->supported;
priv->phydev = phydev; priv->phydev = phydev;
if (priv->phy_of_handle)
priv->phydev->node = offset_to_ofnode(priv->phy_of_handle);
phy_config(phydev); phy_config(phydev);
return 0; return 0;
@@ -736,8 +739,10 @@ static int axi_emac_ofdata_to_platdata(struct udevice *dev)
priv->phyaddr = -1; priv->phyaddr = -1;
offset = fdtdec_lookup_phandle(gd->fdt_blob, node, "phy-handle"); offset = fdtdec_lookup_phandle(gd->fdt_blob, node, "phy-handle");
if (offset > 0) if (offset > 0) {
priv->phyaddr = fdtdec_get_int(gd->fdt_blob, offset, "reg", -1); priv->phyaddr = fdtdec_get_int(gd->fdt_blob, offset, "reg", -1);
priv->phy_of_handle = offset;
}
phy_mode = fdt_getprop(gd->fdt_blob, node, "phy-mode", NULL); phy_mode = fdt_getprop(gd->fdt_blob, node, "phy-mode", NULL);
if (phy_mode) if (phy_mode)