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
* 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 */
int oldstatus = disable_interrupt_save(IRQ_FIQ_STATUS);
/* flush the cache */