mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
imx233: Fix clkctrl for STMP3600 variants (creativezenv)
Change-Id: Ia8f0ce13cdf7dcbf1339bb7648f7a99822f74017
This commit is contained in:
parent
4cd0c35150
commit
f1173e07ec
1 changed files with 10 additions and 0 deletions
|
@ -88,8 +88,12 @@ void imx233_clkctrl_set_div(enum imx233_clock_t clk, int div)
|
||||||
#endif
|
#endif
|
||||||
case CLK_SSP: BF_WR(CLKCTRL_SSP, DIV(div)); break;
|
case CLK_SSP: BF_WR(CLKCTRL_SSP, DIV(div)); break;
|
||||||
case CLK_HBUS:
|
case CLK_HBUS:
|
||||||
|
#if IMX233_SUBTARGET >= 3700
|
||||||
/* make sure to switch to integer divide mode simulteanously */
|
/* make sure to switch to integer divide mode simulteanously */
|
||||||
BF_WR(CLKCTRL_HBUS, DIV_FRAC_EN(0), DIV(div)); break;
|
BF_WR(CLKCTRL_HBUS, DIV_FRAC_EN(0), DIV(div)); break;
|
||||||
|
#else
|
||||||
|
BF_WR(CLKCTRL_HBUS, DIV(div)); break;
|
||||||
|
#endif
|
||||||
case CLK_XBUS: BF_WR(CLKCTRL_XBUS, DIV(div)); break;
|
case CLK_XBUS: BF_WR(CLKCTRL_XBUS, DIV(div)); break;
|
||||||
default: return;
|
default: return;
|
||||||
}
|
}
|
||||||
|
@ -111,9 +115,11 @@ int imx233_clkctrl_get_div(enum imx233_clock_t clk)
|
||||||
case CLK_SSP: return BF_RD(CLKCTRL_SSP, DIV);
|
case CLK_SSP: return BF_RD(CLKCTRL_SSP, DIV);
|
||||||
case CLK_HBUS:
|
case CLK_HBUS:
|
||||||
/* since fractional and integer divider share the same field, clain it is disabled in frac mode */
|
/* since fractional and integer divider share the same field, clain it is disabled in frac mode */
|
||||||
|
#if IMX233_SUBTARGET >= 3700
|
||||||
if(BF_RD(CLKCTRL_HBUS, DIV_FRAC_EN))
|
if(BF_RD(CLKCTRL_HBUS, DIV_FRAC_EN))
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
return BF_RD(CLKCTRL_HBUS, DIV);
|
return BF_RD(CLKCTRL_HBUS, DIV);
|
||||||
case CLK_XBUS: return BF_RD(CLKCTRL_XBUS, DIV);
|
case CLK_XBUS: return BF_RD(CLKCTRL_XBUS, DIV);
|
||||||
default: return 0;
|
default: return 0;
|
||||||
|
@ -143,7 +149,11 @@ void imx233_clkctrl_set_frac_div(enum imx233_clock_t clk, int fracdiv)
|
||||||
/* value 0 is forbidden because we can't simply disabble the divider, it's always
|
/* value 0 is forbidden because we can't simply disabble the divider, it's always
|
||||||
* active but either in integer or fractional mode
|
* active but either in integer or fractional mode
|
||||||
* make sure we write both the value and frac_en bit at the same time */
|
* make sure we write both the value and frac_en bit at the same time */
|
||||||
|
#if IMX233_SUBTARGET >= 3700
|
||||||
BF_WR(CLKCTRL_HBUS, DIV_FRAC_EN(1), DIV(fracdiv));
|
BF_WR(CLKCTRL_HBUS, DIV_FRAC_EN(1), DIV(fracdiv));
|
||||||
|
#else
|
||||||
|
BF_WR(CLKCTRL_HBUS, DIV(fracdiv));
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue