summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/clkctrl-imx233.c
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2012-05-21 16:28:12 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2012-05-21 16:29:11 +0200
commitcd7a478ec1a48facc6729bd51aa1016cc7263081 (patch)
treec48131ac6b9272ceab393517dbff319e655f2b96 /firmware/target/arm/imx233/clkctrl-imx233.c
parent0ebfb937aaa073282415e561f8d1f150813a00fd (diff)
downloadrockbox-cd7a478ec1a48facc6729bd51aa1016cc7263081.tar.gz
rockbox-cd7a478ec1a48facc6729bd51aa1016cc7263081.tar.bz2
rockbox-cd7a478ec1a48facc6729bd51aa1016cc7263081.zip
imx233: enable PLL on startup
Implement PLL enabling/disable and unconditionally power the PLL on startup. This is needed at least on the Zen X-Fi2. Change-Id: Ib9ddfdeaf973cedded4b3586dd16aa95a61e78ba
Diffstat (limited to 'firmware/target/arm/imx233/clkctrl-imx233.c')
-rw-r--r--firmware/target/arm/imx233/clkctrl-imx233.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/firmware/target/arm/imx233/clkctrl-imx233.c b/firmware/target/arm/imx233/clkctrl-imx233.c
index 064ee8013b..a5fc706350 100644
--- a/firmware/target/arm/imx233/clkctrl-imx233.c
+++ b/firmware/target/arm/imx233/clkctrl-imx233.c
@@ -43,6 +43,17 @@ void imx233_clkctrl_enable_clock(enum imx233_clock_t clk, bool enable)
{
case CLK_PIX: REG = &HW_CLKCTRL_PIX; break;
case CLK_SSP: REG = &HW_CLKCTRL_SSP; break;
+ case CLK_PLL:
+ {
+ if(enable)
+ {
+ __REG_SET(HW_CLKCTRL_PLLCTRL0) = HW_CLKCTRL_PLLCTRL0__POWER;
+ while(!(HW_CLKCTRL_PLLCTRL1 & HW_CLKCTRL_PLLCTRL1__LOCK));
+ }
+ else
+ __REG_CLR(HW_CLKCTRL_PLLCTRL0) = HW_CLKCTRL_PLLCTRL0__POWER;
+ return;
+ }
default: return;
}