Commit 981015ac authored by Russell King's avatar Russell King Committed by David S. Miller

net: dsa/bcm_sf2: move pause mode setting into mac_link_up()

bcm_sf2 only appears to support pause modes on RGMII interfaces (the
enable bits are in the RGMII control register.)  Setup the pause modes
for RGMII connections.
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Tested-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 50cc2020
...@@ -587,18 +587,11 @@ static void bcm_sf2_sw_mac_config(struct dsa_switch *ds, int port, ...@@ -587,18 +587,11 @@ static void bcm_sf2_sw_mac_config(struct dsa_switch *ds, int port,
reg = reg_readl(priv, REG_RGMII_CNTRL_P(port)); reg = reg_readl(priv, REG_RGMII_CNTRL_P(port));
reg &= ~ID_MODE_DIS; reg &= ~ID_MODE_DIS;
reg &= ~(PORT_MODE_MASK << PORT_MODE_SHIFT); reg &= ~(PORT_MODE_MASK << PORT_MODE_SHIFT);
reg &= ~(RX_PAUSE_EN | TX_PAUSE_EN);
reg |= port_mode; reg |= port_mode;
if (id_mode_dis) if (id_mode_dis)
reg |= ID_MODE_DIS; reg |= ID_MODE_DIS;
if (state->pause & MLO_PAUSE_TXRX_MASK) {
if (state->pause & MLO_PAUSE_TX)
reg |= TX_PAUSE_EN;
reg |= RX_PAUSE_EN;
}
reg_writel(priv, reg, REG_RGMII_CNTRL_P(port)); reg_writel(priv, reg, REG_RGMII_CNTRL_P(port));
} }
...@@ -662,6 +655,21 @@ static void bcm_sf2_sw_mac_link_up(struct dsa_switch *ds, int port, ...@@ -662,6 +655,21 @@ static void bcm_sf2_sw_mac_link_up(struct dsa_switch *ds, int port,
else else
offset = CORE_STS_OVERRIDE_GMIIP2_PORT(port); offset = CORE_STS_OVERRIDE_GMIIP2_PORT(port);
if (interface == PHY_INTERFACE_MODE_RGMII ||
interface == PHY_INTERFACE_MODE_RGMII_TXID ||
interface == PHY_INTERFACE_MODE_MII ||
interface == PHY_INTERFACE_MODE_REVMII) {
reg = reg_readl(priv, REG_RGMII_CNTRL_P(port));
reg &= ~(RX_PAUSE_EN | TX_PAUSE_EN);
if (tx_pause)
reg |= TX_PAUSE_EN;
if (rx_pause)
reg |= RX_PAUSE_EN;
reg_writel(priv, reg, REG_RGMII_CNTRL_P(port));
}
reg = SW_OVERRIDE | LINK_STS; reg = SW_OVERRIDE | LINK_STS;
switch (speed) { switch (speed) {
case SPEED_1000: case SPEED_1000:
......
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