Rev 433 | Rev 470 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 433 | Rev 435 | ||
---|---|---|---|
Line 26... | Line 26... | ||
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | */ |
27 | */ |
28 | 28 | ||
29 | #include <arch.h> |
29 | #include <arch.h> |
30 | #include <arch/ski/ski.h> |
30 | #include <arch/ski/ski.h> |
31 | #include <arch/asm.h> |
- | |
32 | #include <arch/register.h> |
- | |
33 | #include <arch/barrier.h> |
- | |
34 | #include <arch/interrupt.h> |
31 | #include <arch/drivers/it.h> |
35 | - | ||
36 | /** TODO: read ticks per second from firmware */ |
- | |
37 | #define IT_DELTA 50000000 |
- | |
38 | 32 | ||
39 | void arch_pre_mm_init(void) |
33 | void arch_pre_mm_init(void) |
40 | { |
34 | { |
41 | ski_init_console(); |
35 | ski_init_console(); |
- | 36 | it_init(); |
|
42 | } |
37 | } |
43 | 38 | ||
44 | void arch_post_mm_init(void) |
39 | void arch_post_mm_init(void) |
45 | { |
40 | { |
46 | cr_itv_t itv; |
- | |
47 | - | ||
48 | /* initialize Interval Timer external interrupt vector */ |
- | |
49 | itv.value = itv_read(); |
- | |
50 | itv.vector = INTERRUPT_TIMER; |
- | |
51 | itv.m = 0; |
- | |
52 | itv_write(itv.value); |
- | |
53 | srlz_d(); |
- | |
54 | - | ||
55 | /* set Interval Timer Counter to zero */ |
- | |
56 | itc_write(0); |
- | |
57 | srlz_d(); |
- | |
58 | - | ||
59 | /* generate first Interval Timer interrupt in IT_DELTA ticks */ |
- | |
60 | itm_write(IT_DELTA); |
- | |
61 | srlz_d(); |
- | |
62 | } |
41 | } |