Merge branch 'starfive-5.15-dubhe-pause-gmac' into 'starfive-5.15-dubhe'

Dubhe Jan 2023 release MR

See merge request starfive-tech/linux!85
This commit is contained in:
leyfoon.tan 2023-02-02 08:20:22 +00:00
commit 2eba892dd9
4 changed files with 18 additions and 7 deletions

View file

@ -12,7 +12,7 @@
};
chosen {
bootargs = "console=ttySIF0,115200 earlycon=sbi";
bootargs = "console=ttySIF0,115200 earlycon=sbi ip=::192.168.152.1:255.255.255.0::eth0:dhcp";
};
cpus {
@ -42,6 +42,7 @@
};
&gmac0 {
status = "okay";
phy-mode = "rgmii-id";
phy-handle = <&ethernet_phy0>;
clocks = <&fpga_2p5mhz_clk>,

View file

@ -742,6 +742,8 @@ static void dwmac4_flow_ctrl(struct mac_device_info *hw, unsigned int duplex,
if (fc & FLOW_RX) {
pr_debug("\tReceive Flow-Control ON\n");
flow |= GMAC_RX_FLOW_CTRL_RFE;
} else {
pr_debug("\tReceive Flow-Control OFF\n");
}
writel(flow, ioaddr + GMAC_RX_FLOW_CTRL);

12
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Normal file → Executable file
View file

@ -1165,8 +1165,16 @@ static void stmmac_mac_link_up(struct phylink_config *config,
ctrl |= priv->hw->link.duplex;
/* Flow Control operation */
if (tx_pause && rx_pause)
stmmac_mac_flow_ctrl(priv, duplex);
if (rx_pause && tx_pause)
priv->flow_ctrl = FLOW_AUTO;
else if (rx_pause && !tx_pause)
priv->flow_ctrl = FLOW_RX;
else if (!rx_pause && tx_pause)
priv->flow_ctrl = FLOW_TX;
else
priv->flow_ctrl = FLOW_OFF;
stmmac_mac_flow_ctrl(priv, duplex);
writel(ctrl, priv->ioaddr + MAC_CTRL_REG);

View file

@ -867,10 +867,10 @@ struct phylink *phylink_create(struct phylink_config *config,
else
pl->link_port = PORT_MII;
pl->link_config.interface = iface;
pl->link_config.pause = MLO_PAUSE_AN;
pl->link_config.speed = SPEED_UNKNOWN;
pl->link_config.duplex = DUPLEX_UNKNOWN;
pl->link_config.an_enabled = true;
pl->link_config.pause = MLO_PAUSE_TXRX_MASK;
pl->link_config.speed = SPEED_10;
pl->link_config.duplex = DUPLEX_FULL;
pl->link_config.an_enabled = false;
pl->mac_ops = mac_ops;
__set_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state);
timer_setup(&pl->link_poll, phylink_fixed_poll, 0);