diff options
Diffstat (limited to 'firmware/target/arm/s5l8702/kernel-s5l8702.c')
-rw-r--r-- | firmware/target/arm/s5l8702/kernel-s5l8702.c | 112 |
1 files changed, 56 insertions, 56 deletions
diff --git a/firmware/target/arm/s5l8702/kernel-s5l8702.c b/firmware/target/arm/s5l8702/kernel-s5l8702.c index 7c5a697043..af54e4dca4 100644 --- a/firmware/target/arm/s5l8702/kernel-s5l8702.c +++ b/firmware/target/arm/s5l8702/kernel-s5l8702.c | |||
@@ -1,56 +1,56 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * __________ __ ___. | 2 | * __________ __ ___. |
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id: kernel-s5l8700.c 28795 2010-12-11 17:52:52Z Buschel $ | 8 | * $Id: kernel-s5l8700.c 28795 2010-12-11 17:52:52Z Buschel $ |
9 | * | 9 | * |
10 | * Copyright © 2009 Bertrik Sikken | 10 | * Copyright © 2009 Bertrik Sikken |
11 | * | 11 | * |
12 | * This program is free software; you can redistribute it and/or | 12 | * This program is free software; you can redistribute it and/or |
13 | * modify it under the terms of the GNU General Public License | 13 | * modify it under the terms of the GNU General Public License |
14 | * as published by the Free Software Foundation; either version 2 | 14 | * as published by the Free Software Foundation; either version 2 |
15 | * of the License, or (at your option) any later version. | 15 | * of the License, or (at your option) any later version. |
16 | * | 16 | * |
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | 17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
18 | * KIND, either express or implied. | 18 | * KIND, either express or implied. |
19 | * | 19 | * |
20 | ****************************************************************************/ | 20 | ****************************************************************************/ |
21 | #include "config.h" | 21 | #include "config.h" |
22 | #include "system.h" | 22 | #include "system.h" |
23 | #include "kernel.h" | 23 | #include "kernel.h" |
24 | 24 | ||
25 | /* S5L8702 driver for the kernel timer | 25 | /* S5L8702 driver for the kernel timer |
26 | 26 | ||
27 | Timer B is configured as a 10 kHz timer | 27 | Timer B is configured as a 10 kHz timer |
28 | */ | 28 | */ |
29 | 29 | ||
30 | void INT_TIMERB(void) | 30 | void INT_TIMERB(void) |
31 | { | 31 | { |
32 | /* clear interrupt */ | 32 | /* clear interrupt */ |
33 | TBCON = TBCON; | 33 | TBCON = TBCON; |
34 | 34 | ||
35 | call_tick_tasks(); /* Run through the list of tick tasks */ | 35 | call_tick_tasks(); /* Run through the list of tick tasks */ |
36 | } | 36 | } |
37 | 37 | ||
38 | void tick_start(unsigned int interval_in_ms) | 38 | void tick_start(unsigned int interval_in_ms) |
39 | { | 39 | { |
40 | int cycles = 10 * interval_in_ms; | 40 | int cycles = 10 * interval_in_ms; |
41 | 41 | ||
42 | /* configure timer for 10 kHz */ | 42 | /* configure timer for 10 kHz */ |
43 | TBCMD = (1 << 1); /* TB_CLR */ | 43 | TBCMD = (1 << 1); /* TB_CLR */ |
44 | TBPRE = 337 - 1; /* prescaler */ | 44 | TBPRE = 337 - 1; /* prescaler */ |
45 | TBCON = (0 << 13) | /* TB_INT1_EN */ | 45 | TBCON = (0 << 13) | /* TB_INT1_EN */ |
46 | (1 << 12) | /* TB_INT0_EN */ | 46 | (1 << 12) | /* TB_INT0_EN */ |
47 | (0 << 11) | /* TB_START */ | 47 | (0 << 11) | /* TB_START */ |
48 | (2 << 8) | /* TB_CS = PCLK / 16 */ | 48 | (2 << 8) | /* TB_CS = PCLK / 16 */ |
49 | (0 << 4); /* TB_MODE_SEL = interval mode */ | 49 | (0 << 4); /* TB_MODE_SEL = interval mode */ |
50 | TBDATA0 = cycles; /* set interval period */ | 50 | TBDATA0 = cycles; /* set interval period */ |
51 | TBCMD = (1 << 0); /* TB_EN */ | 51 | TBCMD = (1 << 0); /* TB_EN */ |
52 | 52 | ||
53 | /* enable timer interrupt */ | 53 | /* enable timer interrupt */ |
54 | VIC0INTENABLE = 1 << IRQ_TIMER; | 54 | VIC0INTENABLE = 1 << IRQ_TIMER; |
55 | } | 55 | } |
56 | 56 | ||