Sfoglia il codice sorgente

net: dwc_eth_qos: Add StarFive VisionFive 2 board support

Make the code be compatible with the StarFive VisionFive 2 board.
The code is ported from tag JH7110_VF2_515_v3.9.3 of VF2 repo.

Signed-off-by: Samin Guo <samin.guo@linux.starfivetech.com>
Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
Hal Feng 9 mesi fa
parent
commit
3dec8563ac
1 ha cambiato i file con 13 aggiunte e 0 eliminazioni
  1. 13 0
      drivers/net/dwc_eth_qos.c

+ 13 - 0
drivers/net/dwc_eth_qos.c

@@ -321,6 +321,7 @@ struct eqos_priv {
 	bool clk_ck_enabled;
 	struct reset_ctl_bulk reset_bulk;
 	struct clk_bulk clk_bulk;
+	struct clk rmii_rtx;
 };
 
 /*
@@ -1006,6 +1007,10 @@ static int eqos_set_tx_clk_speed_jh7110(struct udevice *dev)
 		return ret;
 	}
 
+#if CONFIG_IS_ENABLED(TARGET_STARFIVE_VISIONFIVE2)
+	clk_set_rate(&eqos->rmii_rtx, rate);
+#endif
+
 	return 0;
 }
 
@@ -1909,6 +1914,14 @@ static int eqos_probe_resources_jh7110(struct udevice *dev)
 		goto err_free_reset_eqos;
 	}
 
+#if CONFIG_IS_ENABLED(TARGET_STARFIVE_VISIONFIVE2)
+	ret = clk_get_by_name(dev, "rmii_rtx", &eqos->rmii_rtx);
+	if (ret) {
+		pr_err("clk_get_by_name(rmii_rtx) failed: %d", ret);
+		goto err_free_reset_eqos;
+	}
+#endif
+
 	ret = clk_get_bulk(dev, &eqos->clk_bulk);
 	if (ret) {
 		pr_err("clk_get_bulk failed: %d", ret);