summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorleyfoon.tan <leyfoon.tan@starfivetech.com>2023-02-02 11:20:22 +0300
committerleyfoon.tan <leyfoon.tan@starfivetech.com>2023-02-02 11:20:22 +0300
commit2eba892dd9f73866999c19339a320f5e98068aeb (patch)
tree969812598c036f260d32f9feee169eea8296f800
parent35975c2bd335dd9503614ceac55e6f4fd4277fab (diff)
parentcb0f840aa9ebd6965f710b1d452a215a6e8e4a93 (diff)
downloadlinux-starfive-5.15-dubhe.tar.xz
Merge branch 'starfive-5.15-dubhe-pause-gmac' into 'starfive-5.15-dubhe'REL_DUBHE_JAN2023starfive-5.15-dubhe
Dubhe Jan 2023 release MR See merge request starfive-tech/linux!85
-rw-r--r--arch/riscv/boot/dts/starfive/dubhe_fpga.dts3
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c2
-rwxr-xr-x[-rw-r--r--]drivers/net/ethernet/stmicro/stmmac/stmmac_main.c12
-rw-r--r--drivers/net/phy/phylink.c8
4 files changed, 18 insertions, 7 deletions
diff --git a/arch/riscv/boot/dts/starfive/dubhe_fpga.dts b/arch/riscv/boot/dts/starfive/dubhe_fpga.dts
index e8f9ccd89cfd..3e0e0c1c79a2 100644
--- a/arch/riscv/boot/dts/starfive/dubhe_fpga.dts
+++ b/arch/riscv/boot/dts/starfive/dubhe_fpga.dts
@@ -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>,
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
index b21745368983..0f03e842daf6 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
@@ -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);
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 3422f0746d82..e77b72344732 100644..100755
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -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);
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index fef1416dcee4..734a448f426c 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -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);