Skip to content

Commit c26de75

Browse files
Biao Huangkuba-moo
authored andcommitted
stmmac: dwmac-mediatek: remove the dwmac_fix_mac_speed
In current driver, MAC will always enable 2ns delay in RGMII mode, but that's not the correct usage. Remove the dwmac_fix_mac_speed() in driver, and recommend "rgmii-id" for phy-mode in device tree. Fixes: f2d356a ("stmmac: dwmac-mediatek: add support for mt8195") Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: Biao Huang <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 50011c3 commit c26de75

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ struct mediatek_dwmac_plat_data {
9090
struct mediatek_dwmac_variant {
9191
int (*dwmac_set_phy_interface)(struct mediatek_dwmac_plat_data *plat);
9292
int (*dwmac_set_delay)(struct mediatek_dwmac_plat_data *plat);
93-
void (*dwmac_fix_mac_speed)(void *priv, unsigned int speed);
9493

9594
/* clock ids to be requested */
9695
const char * const *clk_list;
@@ -443,32 +442,9 @@ static int mt8195_set_delay(struct mediatek_dwmac_plat_data *plat)
443442
return 0;
444443
}
445444

446-
static void mt8195_fix_mac_speed(void *priv, unsigned int speed)
447-
{
448-
struct mediatek_dwmac_plat_data *priv_plat = priv;
449-
450-
if ((phy_interface_mode_is_rgmii(priv_plat->phy_mode))) {
451-
/* prefer 2ns fixed delay which is controlled by TXC_PHASE_CTRL,
452-
* when link speed is 1Gbps with RGMII interface,
453-
* Fall back to delay macro circuit for 10/100Mbps link speed.
454-
*/
455-
if (speed == SPEED_1000)
456-
regmap_update_bits(priv_plat->peri_regmap,
457-
MT8195_PERI_ETH_CTRL0,
458-
MT8195_RGMII_TXC_PHASE_CTRL |
459-
MT8195_DLY_GTXC_ENABLE |
460-
MT8195_DLY_GTXC_INV |
461-
MT8195_DLY_GTXC_STAGES,
462-
MT8195_RGMII_TXC_PHASE_CTRL);
463-
else
464-
mt8195_set_delay(priv_plat);
465-
}
466-
}
467-
468445
static const struct mediatek_dwmac_variant mt8195_gmac_variant = {
469446
.dwmac_set_phy_interface = mt8195_set_interface,
470447
.dwmac_set_delay = mt8195_set_delay,
471-
.dwmac_fix_mac_speed = mt8195_fix_mac_speed,
472448
.clk_list = mt8195_dwmac_clk_l,
473449
.num_clks = ARRAY_SIZE(mt8195_dwmac_clk_l),
474450
.dma_bit_mask = 35,
@@ -619,8 +595,6 @@ static int mediatek_dwmac_common_data(struct platform_device *pdev,
619595
plat->bsp_priv = priv_plat;
620596
plat->init = mediatek_dwmac_init;
621597
plat->clks_config = mediatek_dwmac_clks_config;
622-
if (priv_plat->variant->dwmac_fix_mac_speed)
623-
plat->fix_mac_speed = priv_plat->variant->dwmac_fix_mac_speed;
624598

625599
plat->safety_feat_cfg = devm_kzalloc(&pdev->dev,
626600
sizeof(*plat->safety_feat_cfg),

0 commit comments

Comments
 (0)