All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] clk: sifive: Fix ethernet regression on HiFive Unleashed
@ 2019-09-08  9:35 Marcus Comstedt
  2019-09-08 12:38 ` Bin Meng
  0 siblings, 1 reply; 15+ messages in thread
From: Marcus Comstedt @ 2019-09-08  9:35 UTC (permalink / raw)
  To: u-boot

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@mc.pp.se>
Cc: Anup Patel <Anup.Patel@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

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2019-09-11  7:43 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-08  9:35 [U-Boot] [PATCH] clk: sifive: Fix ethernet regression on HiFive Unleashed Marcus Comstedt
2019-09-08 12:38 ` Bin Meng
2019-09-08 12:54   ` Marcus Comstedt
2019-09-08 12:58     ` Bin Meng
2019-09-08 13:19       ` Marcus Comstedt
2019-09-08 13:49         ` Bin Meng
2019-09-08 14:48           ` Marcus Comstedt
2019-09-09  2:50             ` Bin Meng
2019-09-09 20:52               ` Marcus Comstedt
2019-09-10 15:20                 ` Bin Meng
2019-09-10 15:53                   ` Marcus Comstedt
2019-09-11  1:58                     ` Bin Meng
2019-09-11  6:24                       ` Anup Patel
2019-09-11  7:43                         ` Bin Meng
2019-09-11  7:43                           ` [U-Boot] " Bin Meng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.