1
0
mirror of https://xff.cz/git/u-boot/ synced 2026-01-02 13:47:09 +01:00
Files
u-boot-megous/include
Grygorii Strashko eef0b8a930 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>
2018-07-26 14:08:22 -05:00
..
2018-07-19 16:31:37 -04:00
2018-07-19 16:17:58 -04:00
2018-06-18 14:43:13 -04:00
2018-02-05 20:58:11 -05:00
2018-06-24 08:56:04 +08:00
2018-07-26 14:08:22 -05:00
2018-06-13 07:49:12 -04:00
2018-04-06 17:04:33 -04:00
2018-07-26 14:08:20 -05:00
2018-05-23 17:30:03 -04:00
2018-06-03 15:27:21 +02:00
2018-05-26 12:46:50 -04:00
2018-07-26 14:08:22 -05:00
2018-05-26 18:19:17 -04:00
2018-07-19 16:31:37 -04:00
2018-07-20 15:55:05 -04:00