[PATCH v2] net: phy: gmii2rgmii: Support external rgmii-id phy

Michal Simek michal.simek at amd.com
Tue Mar 28 08:36:10 CEST 2023



On 3/22/23 09:42, Stefan Herbrechtsmeier wrote:
> From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier at weidmueller.com>
> 
> Read the phy mode of the external phy from the device tree if available
> and check that it is a RGMII variant.
> 
> Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier at weidmueller.com>
> 
> ---
> 
> Changes in v2:
> - Check that the external phy mode is a RGMII variant
> 
>   drivers/net/phy/xilinx_gmii2rgmii.c | 9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/phy/xilinx_gmii2rgmii.c b/drivers/net/phy/xilinx_gmii2rgmii.c
> index 7376283956..853a0df659 100644
> --- a/drivers/net/phy/xilinx_gmii2rgmii.c
> +++ b/drivers/net/phy/xilinx_gmii2rgmii.c
> @@ -48,7 +48,14 @@ static int xilinxgmiitorgmii_config(struct phy_device *phydev)
>   		return -EINVAL;
>   	}
>   
> -	ext_phydev->interface = PHY_INTERFACE_MODE_RGMII;
> +	ext_phydev->interface = ofnode_read_phy_mode(node);
> +	if (ext_phydev->interface == PHY_INTERFACE_MODE_NA) {
> +		ext_phydev->interface = PHY_INTERFACE_MODE_RGMII;
> +	} else if (!phy_interface_is_rgmii(ext_phydev)) {
> +		printf("Incorrect external interface type\n");
> +		return -EINVAL;
> +	}
> +
>   	ext_phydev->node = phandle.node;
>   	phydev->priv = ext_phydev;
>   

Applied.
M


More information about the U-Boot mailing list