[U-Boot] [PATCH 1/2] AQUANTIA USXGMII autoneg enable

York Sun york.sun at nxp.com
Thu Dec 6 16:35:15 UTC 2018


On 10/30/18 2:54 AM, Valentin-catalin Neacsu wrote:
> If System interface protocol is USXGMII then enable USXGMII autoneg
> Signed-off-by: Valentin Catalin Neacsu <valentin-catalin.neacsu at nxp.com>
> ---
>  drivers/net/phy/aquantia.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/drivers/net/phy/aquantia.c b/drivers/net/phy/aquantia.c
> index 6678147545..603abb5a7f 100644
> --- a/drivers/net/phy/aquantia.c
> +++ b/drivers/net/phy/aquantia.c
> @@ -4,6 +4,7 @@
>   * SPDX-License-Identifier:	GPL-2.0+
>   *
>   * Copyright 2014 Freescale Semiconductor, Inc.
> + * Copyright 2018 NXP
>   */
>  #include <config.h>
>  #include <common.h>
> @@ -20,6 +21,13 @@
>  #define AQUNTIA_SPEED_LSB_MASK	0x2000
>  #define AQUNTIA_SPEED_MSB_MASK	0x40
>  
> +#define AQUANTIA_SYSTEM_INTERFACE_SR     0xe812
> +#define AQUANTIA_VENDOR_PROVISIONING_REG 0xC441
> +
> +#define AQUANTIA_USX_AUTONEG_CONTROL_ENA 0x0008
> +#define AQUANTIA_SI_IN_USE_MASK          0x0078
> +#define AQUANTIA_SI_USXGMII              0x0018
> +
>  int aquantia_config(struct phy_device *phydev)
>  {
>  	u32 val = phy_read(phydev, MDIO_MMD_PMAPMD, MII_BMCR);
> @@ -41,6 +49,16 @@ int aquantia_config(struct phy_device *phydev)
>  			phy_write(phydev, MDIO_MMD_PMAPMD, MII_BMCR,
>  				  AQUNTIA_SPEED_LSB_MASK |
>  				  AQUNTIA_SPEED_MSB_MASK);
> +
> +		val = phy_read(phydev, MDIO_MMD_PHYXS,
> +			       AQUANTIA_SYSTEM_INTERFACE_SR);
> +		/* If SI is USXGMII then start USXGMII autoneg*/
> +		if ((val & AQUANTIA_SI_IN_USE_MASK) == AQUANTIA_SI_USXGMII) {
> +			phy_write(phydev, MDIO_MMD_PHYXS,
> +				  AQUANTIA_VENDOR_PROVISIONING_REG,
> +				  AQUANTIA_USX_AUTONEG_CONTROL_ENA);
> +		}
> +
>  	} else if (phydev->interface == PHY_INTERFACE_MODE_SGMII_2500) {
>  		/* 2.5GBASE-T mode */
>  		phydev->advertising = SUPPORTED_1000baseT_Full;
> 

This should be sent to Joe.

York


More information about the U-Boot mailing list