[U-Boot] [PATCH] clk: sifive: Fix ethernet regression on HiFive Unleashed

Marcus Comstedt marcus at mc.pp.se
Sun Sep 8 09:35:51 UTC 2019


Commit ed0ef37 broke compatibility with HiFive Unleashed with SiFive
FSBL 2018-03-20.  This caused ethernet to stop working.  Restore
compatibility by adding back the needed compatible string, and
removing the special handling of rtcclk which was dead code anyway
since no __prci_clock actually names "rtcclk" as its parent.

Signed-off-by: Marcus Comstedt <marcus at mc.pp.se>
Cc: Anup Patel <Anup.Patel at wdc.com>
---
 drivers/clk/sifive/fu540-prci.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/clk/sifive/fu540-prci.c b/drivers/clk/sifive/fu540-prci.c
index ce0769f2d1..78a9fe3770 100644
--- a/drivers/clk/sifive/fu540-prci.c
+++ b/drivers/clk/sifive/fu540-prci.c
@@ -160,7 +160,6 @@
 struct __prci_data {
 	void *va;
 	struct clk parent_hfclk;
-	struct clk parent_rtcclk;
 };
 
 /**
@@ -538,10 +537,7 @@ static ulong sifive_fu540_prci_parent_rate(struct __prci_clock *pc)
 		return p->ops->recalc_rate(p, sifive_fu540_prci_parent_rate(p));
 	}
 
-	if (strcmp(pc->parent_name, "rtcclk") == 0)
-		parent_rate = clk_get_rate(&pc->pd->parent_rtcclk);
-	else
-		parent_rate = clk_get_rate(&pc->pd->parent_hfclk);
+	parent_rate = clk_get_rate(&pc->pd->parent_hfclk);
 
 	return parent_rate;
 }
@@ -593,10 +589,6 @@ static int sifive_fu540_prci_probe(struct udevice *dev)
 	if (err)
 		return err;
 
-	err = clk_get_by_index(dev, 1, &pd->parent_rtcclk);
-	if (err)
-		return err;
-
 	for (i = 0; i < ARRAY_SIZE(__prci_init_clocks); ++i) {
 		pc = &__prci_init_clocks[i];
 		pc->pd = pd;
@@ -614,6 +606,7 @@ static struct clk_ops sifive_fu540_prci_ops = {
 
 static const struct udevice_id sifive_fu540_prci_ids[] = {
 	{ .compatible = "sifive,fu540-c000-prci" },
+	{ .compatible = "sifive,aloeprci0" },
 	{ }
 };
 
-- 
2.21.0



More information about the U-Boot mailing list