In message: 
[linux-yocto][linux-yocto-6.6][v6.6/standard/intel-sdk-6.6/intel-socfpga && 
v6.6/standard/preempt-rt/intel-sdk-6.6/intel-socfpga][PATCH 1/1] dwmac_socfpga: 
set auto-negotiation in fix_mac_speed for s10 board
on 16/09/2024 Liwei Song wrote:

> TSE PCS was droped in commit 5d1f3fe7d2d5 ("net: stmmac: dwmac-sogfpga:
> use the lynx pcs driver") but for stratix10 board, Auto-Negotiation
> bit of Register 48 (AN Control Register) can not be set correctly
> through Lynx PCS, this will casue ethernet port can not get
> ip address, set Auto-Negotiation in fix_mac_speed() as before
> can fix this issue.
> 
> Signed-off-by: Liwei Song <liwei.s...@windriver.com>
> ---

merged.

Bruce


>  drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c 
> b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
> index b691526eede7..a47da5438efa 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
> @@ -57,6 +57,9 @@
>  #define SMTG_REG_0x13          0x13
>  #define SMTG_TIME_SHIFT        16
>  
> +#define TSE_PCS_CONTROL_AN_EN_MASK                      BIT(12)
> +#define TSE_PCS_CONTROL_REG                             0x00
> +
>  struct socfpga_dwmac;
>  struct socfpga_dwmac_ops {
>       int (*set_phy_mode)(struct socfpga_dwmac *dwmac_priv);
> @@ -111,9 +114,16 @@ static void socfpga_dwmac_fix_mac_speed(void *priv, 
> unsigned int speed, unsigned
>               writel(val, splitter_base + EMAC_SPLITTER_CTRL_REG);
>       }
>  
> -     if (phy_dev && sgmii_adapter_base)
> +     if (phy_dev && sgmii_adapter_base){
>               writew(SGMII_ADAPTER_ENABLE,
>                      sgmii_adapter_base + SGMII_ADAPTER_CTRL_REG);
> +
> +             if (phy_dev->autoneg == AUTONEG_ENABLE) {
> +                     val = readw(dwmac->tse_pcs_base + TSE_PCS_CONTROL_REG);
> +                     val |= TSE_PCS_CONTROL_AN_EN_MASK;
> +                     writew(val, dwmac->tse_pcs_base + TSE_PCS_CONTROL_REG);
> +             }
> +     }
>  }
>  
>  static void get_smtgtime(struct mii_bus *mii, int smtg_addr,
> -- 
> 2.40.0
> 
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#14396): 
https://lists.yoctoproject.org/g/linux-yocto/message/14396
Mute This Topic: https://lists.yoctoproject.org/mt/108481746/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to