[311dfa6] | 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> |
---|
[d4886a06] | 15 | #include <bsp/bootcard.h> |
---|
[311dfa6] | 16 | #include <nds.h> |
---|
| 17 | |
---|
[c193baad] | 18 | extern void BSP_rtems_irq_mngt_init (void); |
---|
[311dfa6] | 19 | /* |
---|
| 20 | * start the platform. |
---|
| 21 | */ |
---|
| 22 | |
---|
[12d853d] | 23 | void bsp_start (void) |
---|
[311dfa6] | 24 | { |
---|
| 25 | /* initialize irq management */ |
---|
| 26 | BSP_rtems_irq_mngt_init (); |
---|
| 27 | |
---|
| 28 | /* setup console mode for lower screen */ |
---|
| 29 | irqEnable (IRQ_VBLANK); |
---|
| 30 | videoSetMode (0); |
---|
| 31 | videoSetModeSub (MODE_0_2D | DISPLAY_BG0_ACTIVE); |
---|
| 32 | vramSetBankC (VRAM_C_SUB_BG); |
---|
| 33 | |
---|
| 34 | SUB_BG0_CR = BG_MAP_BASE (31); |
---|
| 35 | BG_PALETTE_SUB[255] = RGB15 (31, 31, 31); |
---|
| 36 | consoleInitDefault ((u16 *) SCREEN_BASE_BLOCK_SUB (31), |
---|
| 37 | (u16 *) CHAR_BASE_BLOCK_SUB (0), 16); |
---|
| 38 | |
---|
| 39 | /* print status message */ |
---|
| 40 | printk ("[+] kernel console started\n"); |
---|
| 41 | |
---|
| 42 | /* set the cpu mode to system user */ |
---|
| 43 | arm_cpu_mode = 0x1f; |
---|
| 44 | |
---|
| 45 | /* configure clock period */ |
---|
| 46 | Configuration.microseconds_per_tick = 10000; /* us */ |
---|
| 47 | } |
---|
| 48 | |
---|
| 49 | /* |
---|
| 50 | * reset bss area. |
---|
| 51 | */ |
---|
| 52 | |
---|
| 53 | void |
---|
| 54 | bss_reset (void) |
---|
| 55 | { |
---|
[d04bf28e] | 56 | extern uint8_t __bss_start; |
---|
| 57 | extern uint8_t __bss_end; |
---|
| 58 | |
---|
[311dfa6] | 59 | memset (&__bss_start, 0, (uint32_t) & __bss_end - (uint32_t) & __bss_start); |
---|
| 60 | } |
---|
| 61 | |
---|
| 62 | /* |
---|
| 63 | * A few symbols needed by libnds but not used. |
---|
| 64 | */ |
---|
| 65 | |
---|
| 66 | #include "../include/sys/iosupport.h" |
---|
| 67 | const devoptab_t *devoptab_list[STD_MAX]; |
---|
| 68 | void *punixTime; |
---|