Commit 1df2270d authored by Antoine Tenart's avatar Antoine Tenart Committed by David S. Miller

net: mvpp2: take advantage of the is_rgmii helper

Convert all RGMII checks to use the phy_interface_mode_is_rgmii()
helper. This is a cosmetic patch.
Signed-off-by: default avatarAntoine Tenart <antoine.tenart@free-electrons.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0d22a3cf
...@@ -4463,10 +4463,7 @@ static void mvpp2_port_mii_gmac_configure_mode(struct mvpp2_port *port) ...@@ -4463,10 +4463,7 @@ static void mvpp2_port_mii_gmac_configure_mode(struct mvpp2_port *port)
val |= MVPP2_GMAC_DISABLE_PADDING; val |= MVPP2_GMAC_DISABLE_PADDING;
val &= ~MVPP2_GMAC_FLOW_CTRL_MASK; val &= ~MVPP2_GMAC_FLOW_CTRL_MASK;
writel(val, port->base + MVPP2_GMAC_CTRL_2_REG); writel(val, port->base + MVPP2_GMAC_CTRL_2_REG);
} else if (port->phy_interface == PHY_INTERFACE_MODE_RGMII || } else if (phy_interface_mode_is_rgmii(port->phy_interface)) {
port->phy_interface == PHY_INTERFACE_MODE_RGMII_ID ||
port->phy_interface == PHY_INTERFACE_MODE_RGMII_RXID ||
port->phy_interface == PHY_INTERFACE_MODE_RGMII_TXID) {
val = readl(port->base + MVPP22_GMAC_CTRL_4_REG); val = readl(port->base + MVPP22_GMAC_CTRL_4_REG);
val |= MVPP22_CTRL4_EXT_PIN_GMII_SEL | val |= MVPP22_CTRL4_EXT_PIN_GMII_SEL |
MVPP22_CTRL4_SYNC_BYPASS_DIS | MVPP22_CTRL4_SYNC_BYPASS_DIS |
...@@ -4512,10 +4509,7 @@ static void mvpp2_port_mii_gmac_configure(struct mvpp2_port *port) ...@@ -4512,10 +4509,7 @@ static void mvpp2_port_mii_gmac_configure(struct mvpp2_port *port)
val = readl(port->base + MVPP2_GMAC_CTRL_2_REG); val = readl(port->base + MVPP2_GMAC_CTRL_2_REG);
if (port->phy_interface == PHY_INTERFACE_MODE_SGMII) { if (port->phy_interface == PHY_INTERFACE_MODE_SGMII) {
val |= MVPP2_GMAC_INBAND_AN_MASK | MVPP2_GMAC_PCS_ENABLE_MASK; val |= MVPP2_GMAC_INBAND_AN_MASK | MVPP2_GMAC_PCS_ENABLE_MASK;
} else if (port->phy_interface == PHY_INTERFACE_MODE_RGMII || } else if (phy_interface_mode_is_rgmii(port->phy_interface)) {
port->phy_interface == PHY_INTERFACE_MODE_RGMII_ID ||
port->phy_interface == PHY_INTERFACE_MODE_RGMII_RXID ||
port->phy_interface == PHY_INTERFACE_MODE_RGMII_TXID) {
val &= ~MVPP2_GMAC_PCS_ENABLE_MASK; val &= ~MVPP2_GMAC_PCS_ENABLE_MASK;
val |= MVPP2_GMAC_PORT_RGMII_MASK; val |= MVPP2_GMAC_PORT_RGMII_MASK;
} }
...@@ -4575,10 +4569,7 @@ static void mvpp2_port_mii_set(struct mvpp2_port *port) ...@@ -4575,10 +4569,7 @@ static void mvpp2_port_mii_set(struct mvpp2_port *port)
if (port->priv->hw_version == MVPP22) if (port->priv->hw_version == MVPP22)
mvpp22_port_mii_set(port); mvpp22_port_mii_set(port);
if (port->phy_interface == PHY_INTERFACE_MODE_RGMII || if (phy_interface_mode_is_rgmii(port->phy_interface) ||
port->phy_interface == PHY_INTERFACE_MODE_RGMII_ID ||
port->phy_interface == PHY_INTERFACE_MODE_RGMII_RXID ||
port->phy_interface == PHY_INTERFACE_MODE_RGMII_TXID ||
port->phy_interface == PHY_INTERFACE_MODE_SGMII) port->phy_interface == PHY_INTERFACE_MODE_SGMII)
mvpp2_port_mii_gmac_configure(port); mvpp2_port_mii_gmac_configure(port);
else if (port->phy_interface == PHY_INTERFACE_MODE_10GKR) else if (port->phy_interface == PHY_INTERFACE_MODE_10GKR)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment