sh: clock-cpg div4 set_rate() shift fix
PATCH 1/1 sh: clock-cpg div4 set_rate() shift fix
From: Magnus Damm <[email protected]>
Make sure the div4 bitfield is shifted according to the enable_bit value in sh_clk_div4_set_rate().
---
arch/sh/kernel/cpu/clock-cpg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/sh/kernel/cpu/clock-cpg.c +2 -2
@@ -192,8 +192,8 @@ static int sh_clk_div4_set_rate(struct creturn idx; value =__raw_readl (clk->enable_reg); - value &= ~0xf ; - value |= idx; + value &= ~(0xf << clk->enable_bit); + value |= (idx << clk->enable_bit);__raw_writel (value, clk->enable_reg);return 0 ;
Quoted 2 lines · Magnus Damm
Make sure the div4 bitfield is shifted according to the
enable_bitvalue insh_clk_div4_set_rate().
Quoted 4 lines · Magnus Damm
This patch introduces struct
clk_div4_table. The structure will be used to keep div4 specific data, and is with this patch replacing the structclk_div_mult_tablepointer arg used by thesh_clk_div4_register()functions.
Quoted 5 lines · Magnus Damm
This patch adds a ->kick() callback to
clk_div4_tableand ties it intosh_clk_div4_set_rate(). A sh7724 specific kick function is also added that updates the KICK bit whenever div4 clocks in FRQCRA and FRQCRB have been set. Allows us to set the VPU clock.
Quoted 7 lines · Magnus Damm
Update the sh7724 processor code to always enable
vpu_clk.On the Ecovec board, set the
vpu_clkto 166 Mhz.The 166MHz setting results in a divide-by-6 setup for
vpu_clkand improves the VPU performance compared to the power-on-reset/bootloader configuration.
All applied, thanks.