Re: [PATCH net-next v2 31/35] [RFT] net: dpaa: Convert to phylink

From
Russell King (Oracle) <linux@armlinux.org.uk>
Date
2022-06-29 14:44:42
Also in
linux-arm-kernel, lkml
Reply to
Sean Anderson, 2022-06-28
On Tue, Jun 28, 2022 at 06:14:00PM -0400, Sean Anderson wrote:
quoted hunk ↗ jump to hunk
+static void dtsec_mac_config(struct phylink_config *config, unsigned int mode,
+			     const struct phylink_link_state *state)
+{
+	struct mac_device *mac_dev = fman_config_to_mac(config);
+	struct dtsec_regs __iomem *regs = mac_dev->fman_mac->regs;
+	u32 tmp;
+
+	switch (state->interface) {
+	case PHY_INTERFACE_MODE_RMII:
+		tmp = DTSEC_ECNTRL_RMM;
+		break;
+	case PHY_INTERFACE_MODE_RGMII:
+	case PHY_INTERFACE_MODE_RGMII_ID:
+	case PHY_INTERFACE_MODE_RGMII_RXID:
+	case PHY_INTERFACE_MODE_RGMII_TXID:
+		tmp = DTSEC_ECNTRL_GMIIM | DTSEC_ECNTRL_RPM;
+		break;
+	case PHY_INTERFACE_MODE_SGMII:
+	case PHY_INTERFACE_MODE_1000BASEX:
+	case PHY_INTERFACE_MODE_2500BASEX:
+		tmp = DTSEC_ECNTRL_TBIM | DTSEC_ECNTRL_SGMIIM;
+		break;
+	default:
+		dev_warn(mac_dev->dev, "cannot configure dTSEC for %s\n",
+			 phy_modes(state->interface));
+	}
+
+	if (state->speed == SPEED_100)
+		tmp |= DTSEC_ECNTRL_R100M;
Please do not refer to state->speed here, it is meaningless. What are
you trying to achieve here?

It looks like the old dtsec_adjust_link() used to set/clear this when
the link comes up - so can it be moved to dtsec_link_up() ?

Thanks.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
Thread (60 messages) 60 messages, 6 authors, last reply 2022-07-12
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help