Remove the calls to backlight_lcd_sleep_countdown from target specific code and move...
[kugel-rb.git] / firmware / target / arm / tms320dm320 / kernel-dm320.c
blobb5eb4233e4bf01679ed9dc63ff786483d53722ab
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2007 by Karl Kurbjun
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #include "config.h"
23 #include "system.h"
24 #include "kernel.h"
25 #include "timer.h"
26 #include "thread.h"
28 void tick_start(unsigned int interval_in_ms)
30 /* TODO: set up TIMER1 clock settings
31 IO_CLK_MOD2 &= ~CLK_MOD2_TMR1; //disable TIMER1 clock
32 IO_CLK_SEL0 |= (1 << 2); //set TIMER1 clock to PLLIN*/
33 IO_CLK_MOD2 |= CLK_MOD2_TMR1; //enable TIMER1 clock!!!!!!!!!
34 IO_TIMER1_TMMD = CONFIG_TIMER1_TMMD_STOP;
36 /* Setup the Prescalar (Divide by 10)
37 * Based on linux/include/asm-arm/arch-integrator/timex.h
39 IO_TIMER1_TMPRSCL = 0x0009;
41 /* Setup the Divisor */
42 IO_TIMER1_TMDIV = (TIMER_FREQ / (10*1000))*interval_in_ms - 1;
44 /* Turn Timer1 to Free Run mode */
45 IO_TIMER1_TMMD = CONFIG_TIMER1_TMMD_FREE_RUN;
47 /* Enable the interrupt */
48 IO_INTC_EINT0 |= INTR_EINT0_TMR1;
51 void TIMER1(void)
53 IO_INTC_IRQ0 = INTR_IRQ0_TMR1;
55 /* Run through the list of tick tasks */
56 call_tick_tasks();