From: Leonardo Costa Accept 10GBASE-R as phy-mode on SoCs that list it in their extra modes and add the 10G MAC capability to ports configured as 10GBASE-R. Signed-off-by: Leonardo Costa --- Running sashiko locally, it pointed out that the MR_AN_ENABLE write at the end of am65_cpsw_nuss_mac_config(), which runs for every extra mode, now also runs for 10GBASE-R. This enables SGMII in-band autonegotiation in the port's CPSGMII block. writel(AM65_CPSW_SGMII_CONTROL_MR_AN_ENABLE, port->sgmii_base + AM65_CPSW_SGMII_CONTROL_REG); We don't think this is an issue. The ports on the CPSW9G that support 10GBASE-R use the PCSR, which doesn't have in-band autonegotiation, while this line configures the CPSGMII, used by other interfaces, so the write is harmless. Ports configured for USXGMII also use the PCSR instead of the CPSGMII, so this behavior already happens in the driver, and in this patch, 10GBASE-R follows the same logical path. --- drivers/net/ethernet/ti/am65-cpsw-nuss.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c index 30e054dc57985..f04ed95ba2ca8 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c @@ -2072,7 +2072,8 @@ static void am65_cpsw_nuss_mac_config(struct phylink_config *config, unsigned in cpsw_sl_ctl_clr(port->slave.mac_sl, CPSW_SL_CTL_EXT_EN); } - if (state->interface == PHY_INTERFACE_MODE_USXGMII) { + if (state->interface == PHY_INTERFACE_MODE_USXGMII || + state->interface == PHY_INTERFACE_MODE_10GBASER) { cpsw_sl_ctl_set(port->slave.mac_sl, CPSW_SL_CTL_XGIG | CPSW_SL_CTL_XGMII_EN); } else { @@ -2827,6 +2828,9 @@ am65_cpsw_nuss_init_port_ndev(struct am65_cpsw_common *common, u32 port_idx) port->slave.phylink_config.supported_interfaces); break; + case PHY_INTERFACE_MODE_10GBASER: + port->slave.phylink_config.mac_capabilities |= MAC_10000FD; + fallthrough; case PHY_INTERFACE_MODE_QSGMII: case PHY_INTERFACE_MODE_SGMII: case PHY_INTERFACE_MODE_USXGMII: -- 2.43.0