summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-09-25 14:12:48 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-09-25 14:31:39 +0200
commit2f5f2ba91dfe5a41551d54b7af33be42e7a27c5d (patch)
treee6ff3ecd8153242a4f3dee3ada570b38a5863e4b
parent7e03dbbf941a7f18f7dc32980e406adfb0a1f288 (diff)
downloadrockbox-2f5f2ba91dfe5a41551d54b7af33be42e7a27c5d.tar.gz
rockbox-2f5f2ba91dfe5a41551d54b7af33be42e7a27c5d.zip
imx233: always boost in bootloader
Many imx233 targets boot in a very low performance mode, typically cpu and dram at 24MHz. This results in very slow boots and very unstable USB bootloader mode. Since cpu frequency scaling is disabled in bootloader in rockbox, always make the frequency scaling code available and boost at boot time. Change-Id: Ie96623c00f7c4cd9a377b84dcb14b772558cfa4d
-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 ebd67cea6c..79e5708bad 100644
--- a/bootloader/imx233.c
+++ b/bootloader/imx233.c
@@ -141,6 +141,11 @@ void main(uint32_t arg, uint32_t addr)
141 system_init(); 141 system_init();
142 kernel_init(); 142 kernel_init();
143 143
144 /* some ixm233 targets needs this because the cpu and/or memory is clocked
145 * at 24MHz, resulting in terribly slow boots and unusable usb mode.
146 * While we are at it, clock at maximum speed to minimise boot time. */
147 imx233_set_cpu_frequency(CPUFREQ_MAX);
148
144 power_init(); 149 power_init();
145 enable_irq(); 150 enable_irq();
146 151
diff --git a/firmware/target/arm/imx233/system-imx233.c b/firmware/target/arm/imx233/system-imx233.c
index 3f751a8aa5..44d6f0e7ad 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)
192#endif 192#endif
193} 193}
194 194
195#ifdef HAVE_ADJUSTABLE_CPU_FREQ
196struct cpufreq_profile_t 195struct cpufreq_profile_t
197{ 196{
198 /* key */ 197 /* key */
@@ -219,7 +218,7 @@ static struct cpufreq_profile_t cpu_profiles[] =
219 218
220#define NR_CPU_PROFILES ((int)(sizeof(cpu_profiles)/sizeof(cpu_profiles[0]))) 219#define NR_CPU_PROFILES ((int)(sizeof(cpu_profiles)/sizeof(cpu_profiles[0])))
221 220
222void set_cpu_frequency(long frequency) 221void imx233_set_cpu_frequency(long frequency)
223{ 222{
224 /* don't change the frequency if it is useless (changes are expensive) */ 223 /* don't change the frequency if it is useless (changes are expensive) */
225 if(cpu_frequency == frequency) 224 if(cpu_frequency == frequency)
@@ -277,6 +276,12 @@ void set_cpu_frequency(long frequency)
277 /* update frequency */ 276 /* update frequency */
278 cpu_frequency = frequency; 277 cpu_frequency = frequency;
279} 278}
279
280#ifdef HAVE_ADJUSTABLE_CPU_FREQ
281void set_cpu_frequency(long frequency)
282{
283 return imx233_set_cpu_frequency(frequency);
284}
280#endif 285#endif
281 286
282void imx233_enable_usb_controller(bool enable) 287void 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 407369af7e..33e8f12265 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);
53void power_off(void); 53void power_off(void);
54void imx233_enable_usb_controller(bool enable); 54void imx233_enable_usb_controller(bool enable);
55void imx233_enable_usb_phy(bool enable); 55void imx233_enable_usb_phy(bool enable);
56// NOTE: this is available even if HAVE_ADJUSTABLE_CPU_FREQ is undef
57void imx233_set_cpu_frequency(long frequency);
56 58
57void udelay(unsigned usecs); 59void udelay(unsigned usecs);
58 60