[PATCH u-boot-marvell 18/19] net: mvneta: Disable fixed PHY code if PHY_FIXED is not compiled in

Stefan Roese sr at denx.de
Mon May 2 09:03:26 CEST 2022


On 27.04.22 12:42, Marek Behún wrote:
> From: Marek Behún <marek.behun at nic.cz>
> 
> Guard the code handling the fixed PHY case by
> CONFIG_IS_ENABLED(PHY_FIXED).
> 
> Signed-off-by: Marek Behún <marek.behun at nic.cz>

Reviewed-by: Stefan Roese <sr at denx.de>

Thanks,
Stefan


> ---
>   drivers/net/mvneta.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c
> index 378789b632..292c364e5e 100644
> --- a/drivers/net/mvneta.c
> +++ b/drivers/net/mvneta.c
> @@ -812,7 +812,8 @@ static void mvneta_defaults_set(struct mvneta_port *pp)
>   	mvreg_write(pp, MVNETA_SDMA_CONFIG, val);
>   
>   	/* Enable PHY polling in hardware if not in fixed-link mode */
> -	if (pp->phydev->phy_id != PHY_FIXED_ID) {
> +	if (!CONFIG_IS_ENABLED(PHY_FIXED) ||
> +	    pp->phydev->phy_id != PHY_FIXED_ID) {
>   		mvreg_write(pp, MVNETA_PHY_ADDR, pp->phydev->addr);
>   
>   		val = mvreg_read(pp, MVNETA_UNIT_CONTROL);
> @@ -1172,7 +1173,8 @@ static void mvneta_adjust_link(struct udevice *dev)
>   		 * be added). Also, why is ADVERT_FC enabled if we don't enable
>   		 * inband AN at all?
>   		 */
> -		if (pp->phydev->phy_id == PHY_FIXED_ID)
> +		if (CONFIG_IS_ENABLED(PHY_FIXED) &&
> +		    pp->phydev->phy_id == PHY_FIXED_ID)
>   			val = MVNETA_GMAC_FORCE_LINK_UP |
>   			      MVNETA_GMAC_IB_BYPASS_AN_EN |
>   			      MVNETA_GMAC_SET_FC_EN |

Viele Grüße,
Stefan Roese

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de


More information about the U-Boot mailing list