From 1f021af60cd0351a309666c2e32b3d1b8b2cbd6f Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Tue, 5 Feb 2008 04:43:19 +0000 Subject: Gigabeat S mixer: Make some progress. Get the tick and core sleep working using the AVIC. Redo the startup code to remap from IRAM and not include the lcd driver frambuffer in the remapping (until it can be moved). Clean up LCD driver. For other misc. changes, see the diffs. Now it progresses to ATA init and fails with -11 but without crashing or hanging. Replace all bootloaders. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16216 a1c6a512-1295-4272-9138-f99709370657 --- firmware/thread.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'firmware/thread.c') diff --git a/firmware/thread.c b/firmware/thread.c index fdef2cdf2b..41160a080a 100644 --- a/firmware/thread.c +++ b/firmware/thread.c @@ -750,6 +750,18 @@ static inline void core_sleep(void) { #warning TODO: Implement core_sleep } +#elif CONFIG_CPU == IMX31L +static inline void core_sleep(void) +{ + asm volatile ( + "mov r0, #0 \n" + "mcr p15, 0, r0, c7, c0, 4 \n" /* Wait for interrupt */ + "mrs r0, cpsr \n" /* Unmask IRQ/FIQ at core level */ + "bic r0, r0, #0xc0 \n" + "msr cpsr_c, r0 \n" + : : : "r0" + ); +} #else static inline void core_sleep(void) { @@ -2542,6 +2554,9 @@ void init_threads(void) struct thread_entry *thread; int slot; + memset(threads, 0, sizeof(threads)); + memset(cores, 0, sizeof(cores)); + /* CPU will initialize first and then sleep */ slot = find_empty_thread_slot(); -- cgit v1.2.3