source: rtems/c/src/lib/libbsp/arm/lpc24xx/startup/bspstart.c @ 5aeed17

4.104.115
Last change on this file since 5aeed17 was 5aeed17, checked in by Thomas Doerfler <Thomas.Doerfler@…>, on 09/22/08 at 11:30:09

lpc24xx: new BSP

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup lpc24xx
5 *
6 * @brief Startup code.
7 */
8
9/*
10 * Copyright (c) 2008
11 * Embedded Brains GmbH
12 * Obere Lagerstr. 30
13 * D-82178 Puchheim
14 * Germany
15 * rtems@embedded-brains.de
16 *
17 * The license and distribution terms for this file may be found in the file
18 * LICENSE in this distribution or at http://www.rtems.com/license/LICENSE.
19 */
20
21#include <string.h>
22
23#include <bsp.h>
24#include <bsp/bootcard.h>
25#include <bsp/irq.h>
26#include <bsp/linker-symbols.h>
27#include <bsp/lpc24xx.h>
28#include <bsp/start.h>
29#include <bsp/system-clocks.h>
30
31void bsp_start_hook_0( void)
32{
33  /* Re-map interrupt vectors to internal RAM */
34  SET_MEMMAP_MAP( MEMMAP, 2);
35}
36
37void bsp_start_hook_1( void)
38{
39  unsigned zero = 0;
40  unsigned *out = bsp_section_bss_start;
41
42  /* Clear BSS */
43  while (out < bsp_section_bss_end) {
44    *out = zero;
45    ++out;
46  }
47}
48
49void bsp_start( void)
50{
51  printk( "CPU Clock: %u\n", lpc24xx_cclk());
52
53  /* Exceptions */
54  rtems_exception_init_mngt();
55
56  /* Interrupts */
57  if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
58    /* FIXME */
59    printk( "Cannot intitialize interrupt support\n");
60    while (1) {
61      /* Spin forever */
62    }
63  }
64}
65
66void bsp_reset( void)
67{
68  /* Do nothing */
69}
70
71#define ULSR_THRE 0x00000020U
72
73static void my_BSP_output_char( char c)
74{
75  while (REG_FLAG_IS_CLEARED( U0LSR, ULSR_THRE)) {
76    /* Wait */
77  }
78  U0THR = c;
79
80  if (c == '\n') {
81    while (REG_FLAG_IS_CLEARED( U0LSR, ULSR_THRE)) {
82      /* Wait */
83    }
84    U0THR = '\r';
85  }
86}
87
88BSP_output_char_function_type BSP_output_char = my_BSP_output_char;
Note: See TracBrowser for help on using the repository browser.