From 120701646f939eb2c360a9917e56fd2cf78631cd Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Thu, 26 Sep 2013 20:12:42 +0200 Subject: [PATCH] imx233: always start SSPCLK before ungating the spp blocks This should fix some boot hang issues which appeared at random. Change-Id: I5430690a61c042b45ed26b58f485a1cc5d82987f --- firmware/target/arm/imx233/ssp-imx233.c | 24 +++++++++++++++--------- 1 file 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++; }