diff options
author | Peng Fan <peng.fan@nxp.com> | 2019-07-31 07:01:57 +0000 |
---|---|---|
committer | Lukasz Majewski <lukma@denx.de> | 2019-07-31 09:20:51 +0200 |
commit | 2b12957d01763bf2a52a4727327a7b3b80bc9111 (patch) | |
tree | 1253706abe7fe0721b782f1afce1e991d2756ddf /drivers/clk | |
parent | 00097635888f9104da7f7cceaf1858ec8987e86f (diff) | |
download | u-boot-2b12957d01763bf2a52a4727327a7b3b80bc9111.tar.gz |
clk: gate: support sandbox
Introduce io_gate_val for sandbox clk gate test usage
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'drivers/clk')
-rw-r--r-- | drivers/clk/clk-gate.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/clk/clk-gate.c b/drivers/clk/clk-gate.c index a3a1fdd3b2..70b8794554 100644 --- a/drivers/clk/clk-gate.c +++ b/drivers/clk/clk-gate.c @@ -55,7 +55,11 @@ static void clk_gate_endisable(struct clk *clk, int enable) if (set) reg |= BIT(gate->bit_idx); } else { +#if CONFIG_IS_ENABLED(SANDBOX_CLK_CCF) + reg = gate->io_gate_val; +#else reg = readl(gate->reg); +#endif if (set) reg |= BIT(gate->bit_idx); @@ -86,7 +90,11 @@ int clk_gate_is_enabled(struct clk *clk) dev_get_clk_ptr(clk->dev) : clk); u32 reg; +#if CONFIG_IS_ENABLED(SANDBOX_CLK_CCF) + reg = gate->io_gate_val; +#else reg = readl(gate->reg); +#endif /* if a set bit disables this clk, flip it before masking */ if (gate->flags & CLK_GATE_SET_TO_DISABLE) @@ -128,6 +136,9 @@ struct clk *clk_register_gate(struct device *dev, const char *name, gate->reg = reg; gate->bit_idx = bit_idx; gate->flags = clk_gate_flags; +#if CONFIG_IS_ENABLED(SANDBOX_CLK_CCF) + gate->io_gate_val = *(u32 *)reg; +#endif clk = &gate->clk; |