summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/ssp-imx233.c
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-09-26 20:12:42 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-09-26 20:12:42 +0200
commit120701646f939eb2c360a9917e56fd2cf78631cd (patch)
treefab42bd26ee3aaebc89a1f773e29dd99a681c4d4 /firmware/target/arm/imx233/ssp-imx233.c
parentf75310598c6daa51f0d2e5839f031bbf100ba4ba (diff)
downloadrockbox-120701646f939eb2c360a9917e56fd2cf78631cd.tar.gz
rockbox-120701646f939eb2c360a9917e56fd2cf78631cd.tar.bz2
rockbox-120701646f939eb2c360a9917e56fd2cf78631cd.zip
imx233: always start SSPCLK before ungating the spp blocks
This should fix some boot hang issues which appeared at random. Change-Id: I5430690a61c042b45ed26b58f485a1cc5d82987f
Diffstat (limited to 'firmware/target/arm/imx233/ssp-imx233.c')
-rw-r--r--firmware/target/arm/imx233/ssp-imx233.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/firmware/target/arm/imx233/ssp-imx233.c b/firmware/target/arm/imx233/ssp-imx233.c
index 2873ab9604..686436af74 100644
--- a/firmware/target/arm/imx233/ssp-imx233.c
+++ b/firmware/target/arm/imx233/ssp-imx233.c
@@ -117,16 +117,8 @@ void imx233_ssp_init(void)
}
}
-void imx233_ssp_start(int ssp)
+static void start_ssp_clock(void)
{
- ASSERT_SSP(ssp)
- if(ssp_in_use[ssp - 1])
- return;
- ssp_in_use[ssp - 1] = true;
- /* Gate block */
- imx233_ssp_softreset(ssp);
- /* Gate dma channel */
- imx233_dma_clkgate_channel(APB_SSP(ssp), true);
/* If first block to start, start SSP clock */
if(ssp_nr_in_use == 0)
{
@@ -140,6 +132,20 @@ void imx233_ssp_start(int ssp)
#endif
imx233_clkctrl_enable(CLK_SSP, true);
}
+}
+
+void imx233_ssp_start(int ssp)
+{
+ ASSERT_SSP(ssp)
+ if(ssp_in_use[ssp - 1])
+ return;
+ ssp_in_use[ssp - 1] = true;
+ /* Enable SSP clock (need to start block) */
+ start_ssp_clock();
+ /* Gate block */
+ imx233_ssp_softreset(ssp);
+ /* Gate dma channel */
+ imx233_dma_clkgate_channel(APB_SSP(ssp), true);
ssp_nr_in_use++;
}