mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-19 05:31:32 +00:00
net: zynq_gem: Add the passing of the phy-handle node
Add the ability to pass the phy-handle node offset to the phy driver. This allows the phy driver to access the DT subnode's data and parse accordingly. Signed-off-by: Dan Murphy <dmurphy@ti.com> Tested-by: Michal Simek <michal.simek@xilinx.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
parent
cb3862277b
commit
20671a9896
1 changed files with 10 additions and 5 deletions
|
@ -179,6 +179,7 @@ struct zynq_gem_priv {
|
||||||
struct zynq_gem_regs *iobase;
|
struct zynq_gem_regs *iobase;
|
||||||
phy_interface_t interface;
|
phy_interface_t interface;
|
||||||
struct phy_device *phydev;
|
struct phy_device *phydev;
|
||||||
|
int phy_of_handle;
|
||||||
struct mii_dev *bus;
|
struct mii_dev *bus;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -352,6 +353,10 @@ static int zynq_phy_init(struct udevice *dev)
|
||||||
priv->phydev->supported = supported | ADVERTISED_Pause |
|
priv->phydev->supported = supported | ADVERTISED_Pause |
|
||||||
ADVERTISED_Asym_Pause;
|
ADVERTISED_Asym_Pause;
|
||||||
priv->phydev->advertising = priv->phydev->supported;
|
priv->phydev->advertising = priv->phydev->supported;
|
||||||
|
|
||||||
|
if (priv->phy_of_handle > 0)
|
||||||
|
priv->phydev->dev->of_offset = priv->phy_of_handle;
|
||||||
|
|
||||||
phy_config(priv->phydev);
|
phy_config(priv->phydev);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -675,7 +680,6 @@ static int zynq_gem_ofdata_to_platdata(struct udevice *dev)
|
||||||
{
|
{
|
||||||
struct eth_pdata *pdata = dev_get_platdata(dev);
|
struct eth_pdata *pdata = dev_get_platdata(dev);
|
||||||
struct zynq_gem_priv *priv = dev_get_priv(dev);
|
struct zynq_gem_priv *priv = dev_get_priv(dev);
|
||||||
int offset = 0;
|
|
||||||
const char *phy_mode;
|
const char *phy_mode;
|
||||||
|
|
||||||
pdata->iobase = (phys_addr_t)dev_get_addr(dev);
|
pdata->iobase = (phys_addr_t)dev_get_addr(dev);
|
||||||
|
@ -684,10 +688,11 @@ static int zynq_gem_ofdata_to_platdata(struct udevice *dev)
|
||||||
priv->emio = 0;
|
priv->emio = 0;
|
||||||
priv->phyaddr = -1;
|
priv->phyaddr = -1;
|
||||||
|
|
||||||
offset = fdtdec_lookup_phandle(gd->fdt_blob, dev->of_offset,
|
priv->phy_of_handle = fdtdec_lookup_phandle(gd->fdt_blob,
|
||||||
"phy-handle");
|
dev->of_offset, "phy-handle");
|
||||||
if (offset > 0)
|
if (priv->phy_of_handle > 0)
|
||||||
priv->phyaddr = fdtdec_get_int(gd->fdt_blob, offset, "reg", -1);
|
priv->phyaddr = fdtdec_get_int(gd->fdt_blob,
|
||||||
|
priv->phy_of_handle, "reg", -1);
|
||||||
|
|
||||||
phy_mode = fdt_getprop(gd->fdt_blob, dev->of_offset, "phy-mode", NULL);
|
phy_mode = fdt_getprop(gd->fdt_blob, dev->of_offset, "phy-mode", NULL);
|
||||||
if (phy_mode)
|
if (phy_mode)
|
||||||
|
|
Loading…
Add table
Reference in a new issue