All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcus Comstedt <marcus@mc.pp.se>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] clk: sifive: Fix ethernet regression on HiFive Unleashed
Date: Sun,  8 Sep 2019 11:35:51 +0200	[thread overview]
Message-ID: <20190908093551.27679-1-marcus@mc.pp.se> (raw)

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

             reply	other threads:[~2019-09-08  9:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-08  9:35 Marcus Comstedt [this message]
2019-09-08 12:38 ` [U-Boot] [PATCH] clk: sifive: Fix ethernet regression on HiFive Unleashed 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190908093551.27679-1-marcus@mc.pp.se \
    --to=marcus@mc.pp.se \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.