summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/clkctrl-imx233.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/imx233/clkctrl-imx233.c')
-rw-r--r--firmware/target/arm/imx233/clkctrl-imx233.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/firmware/target/arm/imx233/clkctrl-imx233.c b/firmware/target/arm/imx233/clkctrl-imx233.c
index ccccaae59d..cfee4aea37 100644
--- a/firmware/target/arm/imx233/clkctrl-imx233.c
+++ b/firmware/target/arm/imx233/clkctrl-imx233.c
@@ -103,7 +103,9 @@ void imx233_clkctrl_set_clock_divisor(enum imx233_clock_t clk, int div)
__FIELD_SET(HW_CLKCTRL_EMI, DIV_EMI, div);
break;
case CLK_HBUS:
- __FIELD_SET(HW_CLKCTRL_HBUS, DIV, div);
+ /* disable frac enable at the same time */
+ HW_CLKCTRL_HBUS = div << HW_CLKCTRL_HBUS__DIV_BP |
+ (HW_CLKCTRL_HBUS & ~(HW_CLKCTRL_HBUS__DIV_FRAC_EN | HW_CLKCTRL_HBUS__DIV_BM));
break;
case CLK_XBUS:
__FIELD_SET(HW_CLKCTRL_XBUS, DIV, div);
@@ -137,8 +139,9 @@ void imx233_clkctrl_set_fractional_divisor(enum imx233_clock_t clk, int fracdiv)
switch(clk)
{
case CLK_HBUS:
- __FIELD_SET(HW_CLKCTRL_HBUS, DIV, fracdiv);
- __REG_SET(HW_CLKCTRL_HBUS) = HW_CLKCTRL_HBUS__DIV_FRAC_EN;
+ /* set frac enable at the same time */
+ HW_CLKCTRL_HBUS = fracdiv << HW_CLKCTRL_HBUS__DIV_BP | HW_CLKCTRL_HBUS__DIV_FRAC_EN |
+ (HW_CLKCTRL_HBUS & ~HW_CLKCTRL_HBUS__DIV_BM);
return;
case CLK_PIX: REG = &HW_CLKCTRL_FRAC_PIX; break;
case CLK_IO: REG = &HW_CLKCTRL_FRAC_IO; break;