1
0
Fork 0
forked from len0rd/rockbox

imx233: fix emi for stmp3600 and stmp3700

Currently don't do anything on stmp3600 because emi is completely
different. On stmp3700 it is unsure how the pll lock is handled
and this will need more testing.

Change-Id: I3d11282531f54f2ecc4187c0d913e2c61f4de14d
This commit is contained in:
Amaury Pouly 2013-06-17 00:18:40 +02:00
parent e671472c3f
commit 86ff093267

View file

@ -89,6 +89,7 @@ static struct emi_reg_t settings_155M[15] ICONST_ATTR __attribute__((alias("sett
static void set_frequency(unsigned long freq) ICODE_ATTR; static void set_frequency(unsigned long freq) ICODE_ATTR;
#if IMX233_SUBTARGET >= 3700
static void set_frequency(unsigned long freq) static void set_frequency(unsigned long freq)
{ {
/** WARNING all restriction of imx233_emi_set_frequency apply here !! */ /** WARNING all restriction of imx233_emi_set_frequency apply here !! */
@ -172,7 +173,10 @@ void imx233_emi_set_frequency(unsigned long freq)
/* wait for transition */ /* wait for transition */
while(BF_RD(CLKCTRL_EMI, BUSY_REF_XTAL)); while(BF_RD(CLKCTRL_EMI, BUSY_REF_XTAL));
/* put emi dll into reset mode */ /* put emi dll into reset mode */
// FIXME Unsure about what to do for stmp37xx
#if IMX233_SUBTARGET >= 3780
HW_EMI_CTRL_SET = BM_EMI_CTRL_DLL_RESET | BM_EMI_CTRL_DLL_SHIFT_RESET; HW_EMI_CTRL_SET = BM_EMI_CTRL_DLL_RESET | BM_EMI_CTRL_DLL_SHIFT_RESET;
#endif
/* load the new frequency dividers */ /* load the new frequency dividers */
set_frequency(freq); set_frequency(freq);
/* switch emi back to pll */ /* switch emi back to pll */
@ -180,7 +184,9 @@ void imx233_emi_set_frequency(unsigned long freq)
/* wait for transition */ /* wait for transition */
while(BF_RD(CLKCTRL_EMI, BUSY_REF_EMI)); while(BF_RD(CLKCTRL_EMI, BUSY_REF_EMI));
/* allow emi dll to lock again */ /* allow emi dll to lock again */
#if IMX233_SUBTARGET >= 3780
HW_EMI_CTRL_CLR = BM_EMI_CTRL_DLL_RESET | BM_EMI_CTRL_DLL_SHIFT_RESET; HW_EMI_CTRL_CLR = BM_EMI_CTRL_DLL_RESET | BM_EMI_CTRL_DLL_SHIFT_RESET;
#endif
/* wait for lock */ /* wait for lock */
while(!BF_RD(DRAM_CTL04, DLLLOCKREG)); while(!BF_RD(DRAM_CTL04, DLLLOCKREG));
/* get DRAM out of self-refresh mode */ /* get DRAM out of self-refresh mode */
@ -190,3 +196,4 @@ void imx233_emi_set_frequency(unsigned long freq)
restore_interrupt(oldstatus); restore_interrupt(oldstatus);
} }
#endif