summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2014-06-22 12:56:21 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2014-06-24 18:07:56 +0200
commit55c5c7ea669a60980fa9d17055b74cbca7be3f58 (patch)
tree07060ad29192b99a9e1eab59d30f79b370646ed6
parent32219513aa61787be91b6e785738c91858123d7f (diff)
downloadrockbox-55c5c7ea669a60980fa9d17055b74cbca7be3f58.tar.gz
rockbox-55c5c7ea669a60980fa9d17055b74cbca7be3f58.tar.bz2
rockbox-55c5c7ea669a60980fa9d17055b74cbca7be3f58.zip
imx233/emi: cleanup and don't change emi freq if not needed
Change-Id: I19f633a85bb12f880215905482934e34da549a13
-rw-r--r--firmware/target/arm/imx233/emi-imx233.c6
-rw-r--r--firmware/target/arm/imx233/emi-imx233.h2
2 files changed, 6 insertions, 2 deletions
diff --git a/firmware/target/arm/imx233/emi-imx233.c b/firmware/target/arm/imx233/emi-imx233.c
index 259ada0e94..fcdb6d2353 100644
--- a/firmware/target/arm/imx233/emi-imx233.c
+++ b/firmware/target/arm/imx233/emi-imx233.c
@@ -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 */
diff --git a/firmware/target/arm/imx233/emi-imx233.h b/firmware/target/arm/imx233/emi-imx233.h
index 71aae3e884..9f66d405f8 100644
--- a/firmware/target/arm/imx233/emi-imx233.h
+++ b/firmware/target/arm/imx233/emi-imx233.h
@@ -46,9 +46,7 @@ struct imx233_emi_info_t
* Absolute minimum CPU speed: 24 MHz */
#define IMX233_EMIFREQ_151_MHz 151580
#define IMX233_EMIFREQ_130_MHz 130910
-#define IMX233_EMIFREQ_120_MHz 120000
#define IMX233_EMIFREQ_64_MHz 64000
-#define IMX233_EMIFREQ_24_MHz 24000
void imx233_emi_set_frequency(unsigned long freq);
struct imx233_emi_info_t imx233_emi_get_info(void);