diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2008-12-07 17:48:42 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2008-12-07 17:48:42 +0000 |
commit | 528ec2a55512679b5776df34d57f77a28bff3fc2 (patch) | |
tree | b335d4ee84afe19fd0de254d3f2ba1a4bb944dc1 /firmware/kernel.c | |
parent | 8289b966b810eb21732ecb905433debf4e872857 (diff) | |
download | rockbox-528ec2a55512679b5776df34d57f77a28bff3fc2.tar.gz rockbox-528ec2a55512679b5776df34d57f77a28bff3fc2.zip |
Meg F/X: Radically changing divider settings messed up the fake sleep in the bootloader. They aren't reset even after powering off. Make sure they are always specified. Move that code to target tree as well.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19358 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/kernel.c')
-rw-r--r-- | firmware/kernel.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/firmware/kernel.c b/firmware/kernel.c index dc960b6e51..730484ed51 100644 --- a/firmware/kernel.c +++ b/firmware/kernel.c | |||
@@ -245,19 +245,8 @@ void timeout_register(struct timeout *tmo, timeout_cb_type callback, | |||
245 | void sleep(int ticks) | 245 | void sleep(int ticks) |
246 | { | 246 | { |
247 | #if CONFIG_CPU == S3C2440 && defined(BOOTLOADER) | 247 | #if CONFIG_CPU == S3C2440 && defined(BOOTLOADER) |
248 | volatile int counter; | 248 | extern void delay(int ticks); |
249 | TCON &= ~(1 << 20); // stop timer 4 | 249 | delay(ticks); |
250 | // TODO: this constant depends on dividers settings inherited from | ||
251 | // firmware. Set them explicitly somwhere. | ||
252 | TCNTB4 = 12193 * ticks / HZ; | ||
253 | TCON |= 1 << 21; // set manual bit | ||
254 | TCON &= ~(1 << 21); // reset manual bit | ||
255 | TCON &= ~(1 << 22); //autoreload Off | ||
256 | TCON |= (1 << 20); // start timer 4 | ||
257 | do { | ||
258 | counter = TCNTO4; | ||
259 | } while(counter > 0); | ||
260 | |||
261 | #elif defined(CPU_PP) && defined(BOOTLOADER) | 250 | #elif defined(CPU_PP) && defined(BOOTLOADER) |
262 | unsigned stop = USEC_TIMER + ticks * (1000000/HZ); | 251 | unsigned stop = USEC_TIMER + ticks * (1000000/HZ); |
263 | while (TIME_BEFORE(USEC_TIMER, stop)) | 252 | while (TIME_BEFORE(USEC_TIMER, stop)) |