From 528ec2a55512679b5776df34d57f77a28bff3fc2 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Sun, 7 Dec 2008 17:48:42 +0000 Subject: 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 --- firmware/kernel.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'firmware/kernel.c') 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, void sleep(int ticks) { #if CONFIG_CPU == S3C2440 && defined(BOOTLOADER) - volatile int counter; - TCON &= ~(1 << 20); // stop timer 4 - // TODO: this constant depends on dividers settings inherited from - // firmware. Set them explicitly somwhere. - TCNTB4 = 12193 * ticks / HZ; - TCON |= 1 << 21; // set manual bit - TCON &= ~(1 << 21); // reset manual bit - TCON &= ~(1 << 22); //autoreload Off - TCON |= (1 << 20); // start timer 4 - do { - counter = TCNTO4; - } while(counter > 0); - + extern void delay(int ticks); + delay(ticks); #elif defined(CPU_PP) && defined(BOOTLOADER) unsigned stop = USEC_TIMER + ticks * (1000000/HZ); while (TIME_BEFORE(USEC_TIMER, stop)) -- cgit v1.2.3