aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDario Binacchi <dariobin@libero.it>2020-05-02 17:58:33 +0200
committerLukasz Majewski <lukma@denx.de>2020-08-24 11:03:26 +0200
commite3b5d74c778a8782f763412679ca4c3cb2d496c3 (patch)
tree0f018aa7aeab02bc8a9936a0d0a718b1a28dcb10 /drivers
parent40559d277481a47abc8e42f287fd67a19e9592d9 (diff)
downloadu-boot-e3b5d74c778a8782f763412679ca4c3cb2d496c3.zip
u-boot-e3b5d74c778a8782f763412679ca4c3cb2d496c3.tar.gz
u-boot-e3b5d74c778a8782f763412679ca4c3cb2d496c3.tar.bz2
clk: ccf: mux: fix access to the sandbox register
The tests developed for the mux clock are run on the sandbox. They don't call the clk_mux_set_parent routine and therefore they do not detect this error. Signed-off-by: Dario Binacchi <dariobin@libero.it>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/clk/clk-mux.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c
index 978f3a8..e10baaf 100644
--- a/drivers/clk/clk-mux.c
+++ b/drivers/clk/clk-mux.c
@@ -131,12 +131,20 @@ static int clk_mux_set_parent(struct clk *clk, struct clk *parent)
if (mux->flags & CLK_MUX_HIWORD_MASK) {
reg = mux->mask << (mux->shift + 16);
} else {
+#if CONFIG_IS_ENABLED(SANDBOX_CLK_CCF)
+ reg = mux->io_mux_val;
+#else
reg = readl(mux->reg);
+#endif
reg &= ~(mux->mask << mux->shift);
}
val = val << mux->shift;
reg |= val;
+#if CONFIG_IS_ENABLED(SANDBOX_CLK_CCF)
+ mux->io_mux_val = reg;
+#else
writel(reg, mux->reg);
+#endif
return 0;
}