/*
* Load target value into CPU_CLOCK_CONTROL register, but for now keep bypass
* enabled (by default, after reset, it should be bypassed, do it just in case)
+ * and AHB_POST_DIV equal to 4
*/
cpu_clock_control:
li t8, QCA_PLL_CPU_CLK_CTRL_REG
move t9, reg_cpu_clk_ctrl
or t9, t9, QCA_PLL_CPU_CLK_CTRL_BYPASS_MASK
+ and t9, t9, ~QCA_PLL_CPU_CLK_CTRL_AHB_POST_DIV_MASK
+ or t9, t9, (3 << QCA_PLL_CPU_CLK_CTRL_AHB_POST_DIV_SHIFT)
sw t9, 0(t8)
/*
/* Disable bypassing all clocks, use target AHB_POST_DIV value */
pll_bypass_disable:
- li t8, QCA_PLL_CPU_CLK_CTRL_REG
- lw t9, 0(t8)
- and t9, t9, ~QCA_PLL_CPU_CLK_CTRL_BYPASS_MASK
- sw t9, 0(t8)
+ li t8, QCA_PLL_CPU_CLK_CTRL_REG
+ move t9, reg_cpu_clk_ctrl
+ and t9, t9, ~QCA_PLL_CPU_CLK_CTRL_BYPASS_MASK
+ sw t9, 0(t8)
/* Setup SPI (clock and other settings) */
spi_setup: