[PATCH 3/3] net: dwc_eth_qos: set proper DT node for phy device

Tom Rini trini at konsulko.com
Mon Aug 8 21:07:06 CEST 2022


On Thu, May 12, 2022 at 09:33:09AM +0200, Rasmus Villemoes wrote:

> Similar to what was done for the FEC driver in commit
> 89b5bd54c1a4 (net: fec: Allow the PHY node to be retrieved), make sure
> the PHY is associated with the right device tree node, so that phy
> specific DT properties is accessible by the phy driver.
> 
> This is required on a custom iMX8MP board with a ti,dp83867 phy
> sitting in front of the eqos interface.
> 
> Signed-off-by: Rasmus Villemoes <rasmus.villemoes at prevas.dk>
> Reviewed-by: Ramon Fried <rfried.dev at gmail.com>
> ---
>  drivers/net/dwc_eth_qos.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c
> index 27b3f98e0e..af35960b42 100644
> --- a/drivers/net/dwc_eth_qos.c
> +++ b/drivers/net/dwc_eth_qos.c
> @@ -1078,9 +1078,11 @@ static int eqos_start(struct udevice *dev)
>  	 * don't need to reconnect/reconfigure again
>  	 */
>  	if (!eqos->phy) {
> +		ofnode phy_node = ofnode_null();
>  		int addr = -1;
> +
>  #ifdef CONFIG_DM_ETH_PHY
> -		addr = eth_phy_get_addr(dev);
> +		addr = eth_phy_get_node_and_addr(dev, &phy_node);
>  #endif
>  		eqos->phy = phy_connect(eqos->mii, addr, dev,
>  					eqos->config->interface(dev));
> @@ -1088,6 +1090,8 @@ static int eqos_start(struct udevice *dev)
>  			pr_err("phy_connect() failed");
>  			goto err_stop_resets;
>  		}
> +		if (ofnode_valid(phy_node))
> +			eqos->phy->node = phy_node;
>  
>  		if (eqos->max_speed) {
>  			ret = phy_set_supported(eqos->phy, eqos->max_speed);

I'm deferring 2/3 and now for 3/3, given a6acf95508e2 ("net: eqos: add
function to get phy node and address") (which yes, sigh, came after your
series but has been applied already, sorry) I don't see the obvious way
to migrate the changes in without testing. If needed still, can you
please rebase and resend? Thanks.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20220808/6aab0c95/attachment.sig>


More information about the U-Boot mailing list