1 | /* |
---|
2 | * RTEMS for Nintendo DS platform initialization. |
---|
3 | * |
---|
4 | * Copyright (c) 2008 by Matthieu Bucchianeri <mbucchia@gmail.com> |
---|
5 | * |
---|
6 | * The license and distribution terms for this file may be |
---|
7 | * found in the file LICENSE in this distribution or at |
---|
8 | * |
---|
9 | * http://www.rtems.com/license/LICENSE |
---|
10 | * |
---|
11 | * $Id$ |
---|
12 | */ |
---|
13 | |
---|
14 | #include <bsp.h> |
---|
15 | #include <bsp/bootcard.h> |
---|
16 | #include <bsp/linker-symbols.h> |
---|
17 | #include <nds.h> |
---|
18 | |
---|
19 | extern void BSP_rtems_irq_mngt_init (void); |
---|
20 | /* |
---|
21 | * start the platform. |
---|
22 | */ |
---|
23 | |
---|
24 | void bsp_start (void) |
---|
25 | { |
---|
26 | /* initialize irq management */ |
---|
27 | BSP_rtems_irq_mngt_init (); |
---|
28 | |
---|
29 | /* setup console mode for lower screen */ |
---|
30 | irqEnable (IRQ_VBLANK); |
---|
31 | videoSetMode (0); |
---|
32 | videoSetModeSub (MODE_0_2D | DISPLAY_BG0_ACTIVE); |
---|
33 | vramSetBankC (VRAM_C_SUB_BG); |
---|
34 | |
---|
35 | SUB_BG0_CR = BG_MAP_BASE (31); |
---|
36 | BG_PALETTE_SUB[255] = RGB15 (31, 31, 31); |
---|
37 | consoleInitDefault ((u16 *) SCREEN_BASE_BLOCK_SUB (31), |
---|
38 | (u16 *) CHAR_BASE_BLOCK_SUB (0), 16); |
---|
39 | |
---|
40 | /* print status message */ |
---|
41 | printk ("[+] kernel console started\n"); |
---|
42 | |
---|
43 | /* set the cpu mode to system user */ |
---|
44 | arm_cpu_mode = 0x1f; |
---|
45 | |
---|
46 | /* configure clock period */ |
---|
47 | Configuration.microseconds_per_tick = 10000; /* us */ |
---|
48 | } |
---|
49 | |
---|
50 | /* |
---|
51 | * reset bss area. |
---|
52 | */ |
---|
53 | |
---|
54 | void |
---|
55 | bss_reset (void) |
---|
56 | { |
---|
57 | |
---|
58 | memset (bsp_section_bss_begin, 0, (size_t) bsp_section_bss_size); |
---|
59 | } |
---|
60 | |
---|
61 | /* |
---|
62 | * A few symbols needed by libnds but not used. |
---|
63 | */ |
---|
64 | |
---|
65 | #include "../include/sys/iosupport.h" |
---|
66 | const devoptab_t *devoptab_list[STD_MAX]; |
---|
67 | void *punixTime; |
---|