summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx233/emi-imx233.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/imx233/emi-imx233.c')
-rw-r--r--firmware/target/arm/imx233/emi-imx233.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/firmware/target/arm/imx233/emi-imx233.c b/firmware/target/arm/imx233/emi-imx233.c
index 8145f3899d..d69dc4a927 100644
--- a/firmware/target/arm/imx233/emi-imx233.c
+++ b/firmware/target/arm/imx233/emi-imx233.c
@@ -89,6 +89,7 @@ static struct emi_reg_t settings_155M[15] ICONST_ATTR __attribute__((alias("sett
89 89
90static void set_frequency(unsigned long freq) ICODE_ATTR; 90static void set_frequency(unsigned long freq) ICODE_ATTR;
91 91
92#if IMX233_SUBTARGET >= 3700
92static void set_frequency(unsigned long freq) 93static void set_frequency(unsigned long freq)
93{ 94{
94 /** WARNING all restriction of imx233_emi_set_frequency apply here !! */ 95 /** WARNING all restriction of imx233_emi_set_frequency apply here !! */
@@ -144,7 +145,7 @@ void imx233_emi_set_frequency(unsigned long freq)
144 * possible in this state anyway. 145 * possible in this state anyway.
145 * WARNING DANGER don't call any external function when sdram is disabled 146 * WARNING DANGER don't call any external function when sdram is disabled
146 * otherwise you'll poke sdram and trigger a fatal data abort ! */ 147 * otherwise you'll poke sdram and trigger a fatal data abort ! */
147 148
148 /* first disable all interrupts */ 149 /* first disable all interrupts */
149 int oldstatus = disable_interrupt_save(IRQ_FIQ_STATUS); 150 int oldstatus = disable_interrupt_save(IRQ_FIQ_STATUS);
150 /* flush the cache */ 151 /* flush the cache */
@@ -172,7 +173,10 @@ void imx233_emi_set_frequency(unsigned long freq)
172 /* wait for transition */ 173 /* wait for transition */
173 while(BF_RD(CLKCTRL_EMI, BUSY_REF_XTAL)); 174 while(BF_RD(CLKCTRL_EMI, BUSY_REF_XTAL));
174 /* put emi dll into reset mode */ 175 /* put emi dll into reset mode */
176 // FIXME Unsure about what to do for stmp37xx
177#if IMX233_SUBTARGET >= 3780
175 HW_EMI_CTRL_SET = BM_EMI_CTRL_DLL_RESET | BM_EMI_CTRL_DLL_SHIFT_RESET; 178 HW_EMI_CTRL_SET = BM_EMI_CTRL_DLL_RESET | BM_EMI_CTRL_DLL_SHIFT_RESET;
179#endif
176 /* load the new frequency dividers */ 180 /* load the new frequency dividers */
177 set_frequency(freq); 181 set_frequency(freq);
178 /* switch emi back to pll */ 182 /* switch emi back to pll */
@@ -180,7 +184,9 @@ void imx233_emi_set_frequency(unsigned long freq)
180 /* wait for transition */ 184 /* wait for transition */
181 while(BF_RD(CLKCTRL_EMI, BUSY_REF_EMI)); 185 while(BF_RD(CLKCTRL_EMI, BUSY_REF_EMI));
182 /* allow emi dll to lock again */ 186 /* allow emi dll to lock again */
187#if IMX233_SUBTARGET >= 3780
183 HW_EMI_CTRL_CLR = BM_EMI_CTRL_DLL_RESET | BM_EMI_CTRL_DLL_SHIFT_RESET; 188 HW_EMI_CTRL_CLR = BM_EMI_CTRL_DLL_RESET | BM_EMI_CTRL_DLL_SHIFT_RESET;
189#endif
184 /* wait for lock */ 190 /* wait for lock */
185 while(!BF_RD(DRAM_CTL04, DLLLOCKREG)); 191 while(!BF_RD(DRAM_CTL04, DLLLOCKREG));
186 /* get DRAM out of self-refresh mode */ 192 /* get DRAM out of self-refresh mode */
@@ -190,3 +196,4 @@ void imx233_emi_set_frequency(unsigned long freq)
190 196
191 restore_interrupt(oldstatus); 197 restore_interrupt(oldstatus);
192} 198}
199#endif