summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bootloader/imx233.c5
-rw-r--r--firmware/target/arm/imx233/system-imx233.c9
-rw-r--r--firmware/target/arm/imx233/system-target.h2
3 files changed, 14 insertions, 2 deletions
diff --git a/bootloader/imx233.c b/bootloader/imx233.c
index ebd67ce..79e5708 100644
--- a/bootloader/imx233.c
+++ b/bootloader/imx233.c
@@ -141,6 +141,11 @@ void main(uint32_t arg, uint32_t addr)
system_init();
kernel_init();
+ /* some ixm233 targets needs this because the cpu and/or memory is clocked
+ * at 24MHz, resulting in terribly slow boots and unusable usb mode.
+ * While we are at it, clock at maximum speed to minimise boot time. */
+ imx233_set_cpu_frequency(CPUFREQ_MAX);
+
power_init();
enable_irq();
diff --git a/firmware/target/arm/imx233/system-imx233.c b/firmware/target/arm/imx233/system-imx233.c
index 3f751a8..44d6f0e 100644
--- a/firmware/target/arm/imx233/system-imx233.c
+++ b/firmware/target/arm/imx233/system-imx233.c
@@ -192,7 +192,6 @@ void imx233_digctl_set_arm_cache_timings(unsigned timings)
#endif
}
-#ifdef HAVE_ADJUSTABLE_CPU_FREQ
struct cpufreq_profile_t
{
/* key */
@@ -219,7 +218,7 @@ static struct cpufreq_profile_t cpu_profiles[] =
#define NR_CPU_PROFILES ((int)(sizeof(cpu_profiles)/sizeof(cpu_profiles[0])))
-void set_cpu_frequency(long frequency)
+void imx233_set_cpu_frequency(long frequency)
{
/* don't change the frequency if it is useless (changes are expensive) */
if(cpu_frequency == frequency)
@@ -277,6 +276,12 @@ void set_cpu_frequency(long frequency)
/* update frequency */
cpu_frequency = frequency;
}
+
+#ifdef HAVE_ADJUSTABLE_CPU_FREQ
+void set_cpu_frequency(long frequency)
+{
+ return imx233_set_cpu_frequency(frequency);
+}
#endif
void imx233_enable_usb_controller(bool enable)
diff --git a/firmware/target/arm/imx233/system-target.h b/firmware/target/arm/imx233/system-target.h
index 407369a..33e8f12 100644
--- a/firmware/target/arm/imx233/system-target.h
+++ b/firmware/target/arm/imx233/system-target.h
@@ -53,6 +53,8 @@ void imx233_reset_block(volatile uint32_t *block_reg);
void power_off(void);
void imx233_enable_usb_controller(bool enable);
void imx233_enable_usb_phy(bool enable);
+// NOTE: this is available even if HAVE_ADJUSTABLE_CPU_FREQ is undef
+void imx233_set_cpu_frequency(long frequency);
void udelay(unsigned usecs);