diff options
Diffstat (limited to 'firmware/target/arm')
-rw-r--r-- | firmware/target/arm/s5l8700/boot.lds | 2 | ||||
-rw-r--r-- | firmware/target/arm/s5l8700/kernel-s5l8700.c | 59 |
2 files changed, 61 insertions, 0 deletions
diff --git a/firmware/target/arm/s5l8700/boot.lds b/firmware/target/arm/s5l8700/boot.lds index 2d2a686f9d..317e40b2ca 100644 --- a/firmware/target/arm/s5l8700/boot.lds +++ b/firmware/target/arm/s5l8700/boot.lds | |||
@@ -66,8 +66,10 @@ SECTIONS | |||
66 | { | 66 | { |
67 | *(.stack) | 67 | *(.stack) |
68 | _stackbegin = .; | 68 | _stackbegin = .; |
69 | stackbegin = .; | ||
69 | . += 0x2000; | 70 | . += 0x2000; |
70 | _stackend = .; | 71 | _stackend = .; |
72 | stackend = .; | ||
71 | _irqstackbegin = .; | 73 | _irqstackbegin = .; |
72 | . += 0x400; | 74 | . += 0x400; |
73 | _irqstackend = .; | 75 | _irqstackend = .; |
diff --git a/firmware/target/arm/s5l8700/kernel-s5l8700.c b/firmware/target/arm/s5l8700/kernel-s5l8700.c new file mode 100644 index 0000000000..b905ade0c1 --- /dev/null +++ b/firmware/target/arm/s5l8700/kernel-s5l8700.c | |||
@@ -0,0 +1,59 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright © 2009 Bertrik Sikken | ||
11 | * | ||
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. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #include "config.h" | ||
22 | #include "system.h" | ||
23 | #include "kernel.h" | ||
24 | |||
25 | /* S5L8700 driver for the kernel timer | ||
26 | |||
27 | Timer B is configured as a 10 kHz timer (assuming PCLK = 100 MHz) | ||
28 | */ | ||
29 | |||
30 | void INT_TIMERB(void) | ||
31 | { | ||
32 | /* clear interrupt */ | ||
33 | TBCON = TBCON; | ||
34 | |||
35 | call_tick_tasks(); /* Run through the list of tick tasks */ | ||
36 | } | ||
37 | |||
38 | void tick_start(unsigned int interval_in_ms) | ||
39 | { | ||
40 | int cycles = 10 * interval_in_ms; | ||
41 | |||
42 | /* enable timer clock */ | ||
43 | PWRCON &= ~(1 << 4); | ||
44 | |||
45 | /* configure timer for 10 kHz */ | ||
46 | TBCMD = (1 << 1); /* TB_CLR */ | ||
47 | TBPRE = 625; /* prescaler */ | ||
48 | TBCON = (0 << 13) | /* TB_INT1_EN */ | ||
49 | (1 << 12) | /* TB_INT0_EN */ | ||
50 | (0 << 11) | /* TB_START */ | ||
51 | (2 << 8) | /* TB_CS = PCLK / 16 */ | ||
52 | (0 << 4); /* TB_MODE_SEL = interval mode */ | ||
53 | TBDATA0 = cycles-1; /* set interval period */ | ||
54 | TBCMD = (1 << 0); /* TB_EN */ | ||
55 | |||
56 | /* enable timer interrupt */ | ||
57 | INTMSK |= (1 << 7); | ||
58 | } | ||
59 | |||