summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/clkctrl-imx233.c
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2012-01-21 20:14:27 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2012-01-21 20:15:29 +0100
commiteaa83bd64775b87e943d345e2810deed44408776 (patch)
tree2d3eb4c5c29338c5bd254c1c54e8114d07cfc062 /firmware/target/arm/imx233/clkctrl-imx233.c
parent6b7db7e465f03712520128b4a527829c5f2be3ca (diff)
downloadrockbox-eaa83bd64775b87e943d345e2810deed44408776.tar.gz
rockbox-eaa83bd64775b87e943d345e2810deed44408776.tar.bz2
rockbox-eaa83bd64775b87e943d345e2810deed44408776.zip
imx233: fix clkctrl code (some registers don't have a SET/CLR variant)
Change-Id: I3ce6a77cdc5ea89e1e43bc00c9ec43664e765fdc
Diffstat (limited to 'firmware/target/arm/imx233/clkctrl-imx233.c')
-rw-r--r--firmware/target/arm/imx233/clkctrl-imx233.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/firmware/target/arm/imx233/clkctrl-imx233.c b/firmware/target/arm/imx233/clkctrl-imx233.c
index dbdc12e38e..744a4b11d8 100644
--- a/firmware/target/arm/imx233/clkctrl-imx233.c
+++ b/firmware/target/arm/imx233/clkctrl-imx233.c
@@ -76,16 +76,17 @@ bool imx233_is_clock_enable(enum imx233_clock_t clk)
void imx233_set_clock_divisor(enum imx233_clock_t clk, int div)
{
+ /* warning: some registers like HW_CLKCTRL_PIX don't have a CLR/SET variant ! */
switch(clk)
{
case CLK_PIX:
- __REG_CLR(HW_CLKCTRL_PIX) = HW_CLKCTRL_PIX__DIV_BM;
- __REG_SET(HW_CLKCTRL_PIX) = div;
+ HW_CLKCTRL_PIX &= ~HW_CLKCTRL_PIX__DIV_BM;
+ HW_CLKCTRL_PIX |= div;
while(HW_CLKCTRL_PIX & __CLK_BUSY);
break;
case CLK_SSP:
- __REG_CLR(HW_CLKCTRL_SSP) = HW_CLKCTRL_SSP__DIV_BM;
- __REG_SET(HW_CLKCTRL_SSP) = div;
+ HW_CLKCTRL_SSP &= ~HW_CLKCTRL_SSP__DIV_BM;
+ HW_CLKCTRL_SSP |= div;
while(HW_CLKCTRL_SSP & __CLK_BUSY);
break;
case CLK_CPU:
@@ -94,8 +95,8 @@ void imx233_set_clock_divisor(enum imx233_clock_t clk, int div)
while(HW_CLKCTRL_CPU & HW_CLKCTRL_CPU__BUSY_REF_CPU);
break;
case CLK_EMI:
- __REG_CLR(HW_CLKCTRL_EMI) = HW_CLKCTRL_EMI__DIV_EMI_BM;
- __REG_SET(HW_CLKCTRL_EMI) = div;
+ HW_CLKCTRL_EMI &= ~HW_CLKCTRL_EMI__DIV_EMI_BM;
+ HW_CLKCTRL_EMI |= div;
while(HW_CLKCTRL_EMI & HW_CLKCTRL_EMI__BUSY_REF_EMI);
break;
case CLK_HBUS:
@@ -104,8 +105,8 @@ void imx233_set_clock_divisor(enum imx233_clock_t clk, int div)
while(HW_CLKCTRL_HBUS & __CLK_BUSY);
break;
case CLK_XBUS:
- __REG_CLR(HW_CLKCTRL_XBUS) = HW_CLKCTRL_XBUS__DIV_BM;
- __REG_SET(HW_CLKCTRL_XBUS) = div;
+ HW_CLKCTRL_XBUS &= ~HW_CLKCTRL_XBUS__DIV_BM;
+ HW_CLKCTRL_XBUS |= div;
while(HW_CLKCTRL_XBUS & __CLK_BUSY);
break;
default: return;