net:stmmac:dwc-qos: add JH7110_GMAC0_GTXC clk config for JH7110
authoryanhong.wang <yanhong.wang@starfivetech.com>
Sun, 15 May 2022 10:09:37 +0000 (18:09 +0800)
committersamin <samin.guo@starfivetech.com>
Sun, 15 May 2022 10:57:05 +0000 (18:57 +0800)
Add JH7110_GMAC0_GTXC clk configuration for JH7110.

Signed-off-by: yanhong.wang <yanhong.wang@starfivetech.com>
drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c

index db61588..f8b4246 100644 (file)
@@ -42,6 +42,7 @@ struct starfive_eqos {
        void __iomem *regs;
        struct clk *clk_tx;
        struct clk *clk_gtx;
+       struct clk *clk_gtxc;
 };
 
 static int dwc_eth_dwmac_config_dt(struct platform_device *pdev,
@@ -499,12 +500,24 @@ static int starfive_eqos_probe(struct platform_device *pdev,
        if (err < 0)
                goto disable_tx;
 
+       eqos->clk_gtxc = devm_clk_get(&pdev->dev, "gtxc");
+       if (IS_ERR(eqos->clk_gtxc)) {
+               err = PTR_ERR(eqos->clk_gtxc);
+               goto disable_gtx;
+       }
+
+       err = clk_prepare_enable(eqos->clk_gtxc);
+       if (err < 0)
+               goto disable_gtx;
+
 bypass_clk_reset_gpio:
        data->fix_mac_speed = starfive_eqos_fix_speed;
        data->init = NULL;
        data->bsp_priv = eqos;
        return 0;
 
+disable_gtx:
+       clk_disable_unprepare(eqos->clk_gtx);
 disable_tx:
        clk_disable_unprepare(eqos->clk_tx);
 err: