source: rtems/c/src/lib/libbsp/arm/nds/startup/bspstart.c @ 12d853d

4.104.11
Last change on this file since 12d853d was 12d853d, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 14, 2008 at 8:04:36 PM

2008-09-14 Joel Sherrill <joel.sherrill@…>

  • Makefile.am, configure.ac: Split out bsp_cleanup() and bsp_get_work_area() into their own files.
  • startup/bspclean.c, startup/bspgetworkarea.c, startup/bspstart.c: New files.
  • startup/start.c: Removed.
  • Property mode set to 100644
File size: 1.5 KB
Line 
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 <nds.h>
17
18/*
19 * This definition comes from ARM cpu code.
20 */
21extern unsigned int arm_cpu_mode;
22
23/*
24 * start the platform.
25 */
26
27void bsp_start (void)
28{
29  /* initialize irq management */
30  BSP_rtems_irq_mngt_init ();
31
32  /* setup console mode for lower screen */
33  irqEnable (IRQ_VBLANK);
34  videoSetMode (0);
35  videoSetModeSub (MODE_0_2D | DISPLAY_BG0_ACTIVE);
36  vramSetBankC (VRAM_C_SUB_BG);
37
38  SUB_BG0_CR = BG_MAP_BASE (31);
39  BG_PALETTE_SUB[255] = RGB15 (31, 31, 31);
40  consoleInitDefault ((u16 *) SCREEN_BASE_BLOCK_SUB (31),
41                      (u16 *) CHAR_BASE_BLOCK_SUB (0), 16);
42
43  /* print status message */
44  printk ("[+] kernel console started\n");
45
46  /* set the cpu mode to system user */
47  arm_cpu_mode = 0x1f;
48
49  /* configure clock period */
50  Configuration.microseconds_per_tick = 10000;  /* us */
51}
52
53/*
54 * reset bss area.
55 */
56
57void
58bss_reset (void)
59{
60  extern uint8_t __bss_start;
61  extern uint8_t __bss_end;
62
63  memset (&__bss_start, 0, (uint32_t) & __bss_end - (uint32_t) & __bss_start);
64}
65
66/*
67 * A few symbols needed by libnds but not used.
68 */
69
70#include "../include/sys/iosupport.h"
71const devoptab_t *devoptab_list[STD_MAX];
72void *punixTime;
Note: See TracBrowser for help on using the repository browser.