imx233/emi: cleanup and don't change emi freq if not needed

Change-Id: I19f633a85bb12f880215905482934e34da549a13
This commit is contained in:
Amaury Pouly 2014-06-22 12:56:21 +02:00
parent 32219513aa
commit 55c5c7ea66
2 changed files with 6 additions and 2 deletions

View file

@ -135,6 +135,12 @@ void imx233_emi_set_frequency(unsigned long freq)
* WARNING DANGER don't call any external function when sdram is disabled * WARNING DANGER don't call any external function when sdram is disabled
* otherwise you'll poke sdram and trigger a fatal data abort ! */ * otherwise you'll poke sdram and trigger a fatal data abort ! */
static unsigned long cur_freq = -1;
/* avoid changes if unneeded */
if(cur_freq == freq)
return;
cur_freq = freq;
/* first disable all interrupts */ /* first disable all interrupts */
int oldstatus = disable_interrupt_save(IRQ_FIQ_STATUS); int oldstatus = disable_interrupt_save(IRQ_FIQ_STATUS);
/* flush the cache */ /* flush the cache */

View file

@ -46,9 +46,7 @@ struct imx233_emi_info_t
* Absolute minimum CPU speed: 24 MHz */ * Absolute minimum CPU speed: 24 MHz */
#define IMX233_EMIFREQ_151_MHz 151580 #define IMX233_EMIFREQ_151_MHz 151580
#define IMX233_EMIFREQ_130_MHz 130910 #define IMX233_EMIFREQ_130_MHz 130910
#define IMX233_EMIFREQ_120_MHz 120000
#define IMX233_EMIFREQ_64_MHz 64000 #define IMX233_EMIFREQ_64_MHz 64000
#define IMX233_EMIFREQ_24_MHz 24000
void imx233_emi_set_frequency(unsigned long freq); void imx233_emi_set_frequency(unsigned long freq);
struct imx233_emi_info_t imx233_emi_get_info(void); struct imx233_emi_info_t imx233_emi_get_info(void);