Searched hist:"7 ef89642968ef79d13d99a322c4c4b25d58fffa7" (Results 1 – 2 of 2) sorted by relevance
| /rk3399_rockchip-uboot/include/ |
| H A D | phy.h | 7ef89642968ef79d13d99a322c4c4b25d58fffa7 Thu Jul 05 17:02:48 UTC 2018 Grygorii Strashko <grygorii.strashko@ti.com> UPSTREAM: net: phy: add ofnode node to struct phy_device
Now the UCLASS_ETH device "node" field is owerwritten by some network drivers in case of Ethernet PHYs which are linked to UCLASS_ETH device using "phy-handle" DT property and when Ethernet PHY driver needs to read some additional information from DT. In such cases following happens (in general):
- network drivers priv->phydev = phy_connect(priv->bus, priv->phyaddr, dev, priv->interface); <-- phydev is connected to dev which is UCLASS_ETH device
if (priv->phy_of_handle > 0) dev_set_of_offset(priv->phydev->dev, priv->phy_of_handle); <-- phydev->dev->node is overwritten by phy-handle DT node
- PHY driver in .config() callback int node = dev_of_offset(dev); <-- PHY driver uses overwritten dev->node const void *fdt = gd->fdt_blob;
if (fdtdec_get_bool(fdt, node, "property")) ...
As result, UCLASS_ETH device can't be used any more for DT accessing.
This patch adds additional ofnode node field to struct phy_device which can be set explicitly by network drivers and used by PHY drivers, so overwriting can be avoided. Also add helper function phy_get_ofnode() which will check and return phy_device->node or dev_ofnode(phydev->dev) for backward compatibility with existing drivers.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: David Wu <david.wu@rock-chips.com> Change-Id: I31fcf01cfb19894bc90d198d9138c1fd3e25802e
|
| /rk3399_rockchip-uboot/drivers/net/phy/ |
| H A D | phy.c | 7ef89642968ef79d13d99a322c4c4b25d58fffa7 Thu Jul 05 17:02:48 UTC 2018 Grygorii Strashko <grygorii.strashko@ti.com> UPSTREAM: net: phy: add ofnode node to struct phy_device
Now the UCLASS_ETH device "node" field is owerwritten by some network drivers in case of Ethernet PHYs which are linked to UCLASS_ETH device using "phy-handle" DT property and when Ethernet PHY driver needs to read some additional information from DT. In such cases following happens (in general):
- network drivers priv->phydev = phy_connect(priv->bus, priv->phyaddr, dev, priv->interface); <-- phydev is connected to dev which is UCLASS_ETH device
if (priv->phy_of_handle > 0) dev_set_of_offset(priv->phydev->dev, priv->phy_of_handle); <-- phydev->dev->node is overwritten by phy-handle DT node
- PHY driver in .config() callback int node = dev_of_offset(dev); <-- PHY driver uses overwritten dev->node const void *fdt = gd->fdt_blob;
if (fdtdec_get_bool(fdt, node, "property")) ...
As result, UCLASS_ETH device can't be used any more for DT accessing.
This patch adds additional ofnode node field to struct phy_device which can be set explicitly by network drivers and used by PHY drivers, so overwriting can be avoided. Also add helper function phy_get_ofnode() which will check and return phy_device->node or dev_ofnode(phydev->dev) for backward compatibility with existing drivers.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: David Wu <david.wu@rock-chips.com> Change-Id: I31fcf01cfb19894bc90d198d9138c1fd3e25802e
|