summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHal Feng <hal.feng@starfivetech.com>2023-08-17 06:08:07 +0300
committerHal Feng <hal.feng@starfivetech.com>2023-11-29 05:48:06 +0300
commit3dec8563acd3be6580467ab856c21907b8865e1f (patch)
treeb014947dc370c663c9ba1a2e1eaf3e7011da815f
parent7a6dd69c9d1591c564ec7f516989aad3a9c3d7ce (diff)
downloadu-boot-3dec8563acd3be6580467ab856c21907b8865e1f.tar.xz
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>
-rw-r--r--drivers/net/dwc_eth_qos.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c
index 84ad47d5bc..2910affc0c 100644
--- a/drivers/net/dwc_eth_qos.c
+++ b/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);