clk: ast2600: Fix enabling of clocks
PATCH 1/1 clk: ast2600: Fix enabling of clocks
The struct clk_ops enable callback for the aspeed gates mixes up the set to clear and write to set registers.
Fixes d3d04f6c330a ("clk: Add support for AST2600 SoC")
Signed-off-by Joel Stanley <[email protected]>
---
This can be tested with Cedric's qemu as of 58b9c85302ad ("aspeed/scu:
Fix W1C behavior") by inspecting SCU090 after a booting the tacoma machine with the aspeed FSI enabled:
Before:
$ devmem 0x1e6e2090 0xFFFFFFF2
After:
$ devmem 0x1e6e2090 0xBFEFFFF2 --- drivers/clk/clk-ast2600.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/clk/clk-ast2600.c +4 -3
@@ -269,10 +269,11 @@ static int aspeed_g6_clk_enable(struct clk_hw *hw)/* Enable clock */ if (gate->flags &CLK_GATE_SET_TO_DISABLE ) { -regmap_write (gate->map,get_clock_reg (gate), clk); - }else { -/* Use set to clear register */ +/* Clock is clear to enable, so use set to clear register */ regmap_write (gate->map,get_clock_reg (gate) +0x04 , clk); + }else { +/* Clock is set to enable, so use write to set register */ +regmap_write (gate->map,get_clock_reg (gate), clk); }if (gate->reset_idx >=0 ) {
Signature · 1 line
2.23.0
Quoted 5 lines · Joel Stanley
The struct
clk_opsenable callback for the aspeed gates mixes up the set to clear and write to set registers.Fixes d3d04f6c330a ("clk: Add support for AST2600 SoC")Signed-off-by Joel Stanley <[email protected]>
Reviewed-by Andrew Jeffery <[email protected]>