author: leyfoon.tan <leyfoon.tan@starfivetech.com> 2023-02-02 08:20:22 +0000
committer: leyfoon.tan <leyfoon.tan@starfivetech.com> 2023-02-02 08:20:22 +0000
commit: 2eba892dd9f73866999c19339a320f5e98068aeb
parent: 35975c2bd335dd9503614ceac55e6f4fd4277fab
Commit Summary:
Diffstat:
4 files changed, 17 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 = <ðernet_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
old mode 100644
new mode 100755
index 3422f0746d82..e77b72344732
--- 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);