ethernet: stmmac: Add flow ctrl configuration from DTB

If flow control is configured in DTB, the priority is the highest,
otherwise the default value in the code is used.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I21afeb537426473d6edf7ce40317cdaf99d64a93
This commit is contained in:
David Wu
2023-05-08 18:14:20 +08:00
committed by Tao Huang
parent c1316a8ee9
commit f3a840a49e
3 changed files with 6 additions and 2 deletions

View File

@@ -826,8 +826,8 @@ static void stmmac_mac_flow_ctrl(struct stmmac_priv *priv, u32 duplex)
{
u32 tx_cnt = priv->plat->tx_queues_to_use;
stmmac_flow_ctrl(priv, priv->hw, duplex, priv->flow_ctrl,
priv->pause, tx_cnt);
stmmac_flow_ctrl(priv, priv->hw, duplex, priv->flow_ctrl & priv->plat->flow_ctrl,
priv->pause, tx_cnt);
}
static void stmmac_validate(struct phylink_config *config,

View File

@@ -570,6 +570,9 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)
of_property_read_u32(np, "snps,ps-speed", &plat->mac_port_sel_speed);
if (of_property_read_u32(np, "snps,flow-ctrl", &plat->flow_ctrl))
plat->flow_ctrl = FLOW_AUTO;
plat->axi = stmmac_axi_setup(pdev);
rc = stmmac_mtl_setup(pdev, plat);

View File

@@ -173,6 +173,7 @@ struct plat_stmmacenet_data {
int rx_fifo_size;
int dma_tx_size;
int dma_rx_size;
int flow_ctrl;
u32 addr64;
u32 rx_queues_to_use;
u32 tx_queues_to_use;