source: rtems/c/src/lib/libbsp/arm/nds/startup/start.c @ 9a85541

4.104.114.95
Last change on this file since 9a85541 was 9a85541, checked in by Joel Sherrill <joel.sherrill@…>, on 08/20/08 at 16:31:41

2008-08-20 Joel Sherrill <joel.sherrill@…>

  • block/block.c, console/console.c, dswifi/arm9/source/sgIP.h, dswifi/arm9/source/sgIP_ARP.h, dswifi/arm9/source/sgIP_Config.h, dswifi/arm9/source/sgIP_DHCP.h, dswifi/arm9/source/sgIP_DNS.h, dswifi/arm9/source/sgIP_Hub.h, dswifi/arm9/source/sgIP_ICMP.h, dswifi/arm9/source/sgIP_IP.h, dswifi/arm9/source/sgIP_TCP.h, dswifi/arm9/source/sgIP_UDP.h, dswifi/arm9/source/sgIP_memblock.h, dswifi/arm9/source/wifi_arm9.c, dswifi/arm9/source/wifi_arm9.h, dswifi/include/dswifi7.h, dswifi/include/dswifi9.h, fb/fb.c, include/my_ipc.h, libfat/source/disc_io/disc_io.h, libfat/source/disc_io/io_nmmc.c, libnds/include/nds/arm9/exceptions.h, libnds/include/nds/arm9/input.h, libnds/include/nds/arm9/ndsmotion.h, libnds/include/nds/arm9/videoGL.h, libnds/source/arm9/console.c, libnds/source/arm9/gurumeditation.c, libnds/source/arm9/ndsmotion.c, libnds/source/common/card.c, libnds/source/common/interrupts.c, sound/sound.c, startup/start.c, touchscreen/reco.h, wifi/compat.c, wifi/compat.h: Fix most warnings.
  • Property mode set to 100644
File size: 2.3 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 *  These are from the linker script.
25 */
26extern uint8_t _end;
27extern uint8_t __ewram_end;
28
29/*
30 *  This method returns the base address and size of the area which
31 *  is to be allocated between the RTEMS Workspace and the C Program
32 *  Heap.
33 */
34void bsp_get_work_area(
35  void   **work_area_start,
36  size_t  *work_area_size,
37  void   **heap_start,
38  size_t  *heap_size
39)
40{
41  *work_area_start       = &_end;
42  *work_area_size       = (void *)&__ewram_end - (void *)&_end;
43  *heap_start = BSP_BOOTCARD_HEAP_USES_WORK_AREA;
44  *heap_size = BSP_BOOTCARD_HEAP_SIZE_DEFAULT;
45}
46
47/*
48 * start the platform.
49 */
50
51void
52bsp_start (void)
53{
54  /* initialize irq management */
55  BSP_rtems_irq_mngt_init ();
56
57  /* setup console mode for lower screen */
58  irqEnable (IRQ_VBLANK);
59  videoSetMode (0);
60  videoSetModeSub (MODE_0_2D | DISPLAY_BG0_ACTIVE);
61  vramSetBankC (VRAM_C_SUB_BG);
62
63  SUB_BG0_CR = BG_MAP_BASE (31);
64  BG_PALETTE_SUB[255] = RGB15 (31, 31, 31);
65  consoleInitDefault ((u16 *) SCREEN_BASE_BLOCK_SUB (31),
66                      (u16 *) CHAR_BASE_BLOCK_SUB (0), 16);
67
68  /* print status message */
69  printk ("[+] kernel console started\n");
70
71  /* set the cpu mode to system user */
72  arm_cpu_mode = 0x1f;
73
74  /* configure clock period */
75  Configuration.microseconds_per_tick = 10000;  /* us */
76}
77
78/*
79 * reset bss area.
80 */
81
82void
83bss_reset (void)
84{
85  extern uint8_t __bss_start;
86  extern uint8_t __bss_end;
87
88  memset (&__bss_start, 0, (uint32_t) & __bss_end - (uint32_t) & __bss_start);
89}
90
91/*
92 * reset the platform using bios call.
93 */
94
95void
96bsp_reset (void)
97{
98  swiSoftReset ();
99}
100
101/*
102 * clean up platform before reset.
103 */
104
105void
106bsp_cleanup (void)
107{
108  printk ("[!] executive ended, rebooting\n");
109
110  bsp_reset ();
111}
112
113/*
114 * A few symbols needed by libnds but not used.
115 */
116
117#include "../include/sys/iosupport.h"
118const devoptab_t *devoptab_list[STD_MAX];
119void *punixTime;
Note: See TracBrowser for help on using the repository browser.