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

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to