source: rtems/c/src/lib/libbsp/m68k/mcf5329/startup/init5329.c @ 6b56ec3

4.104.114.95
Last change on this file since 6b56ec3 was 6b56ec3, checked in by Joel Sherrill <joel.sherrill@…>, on 06/20/08 at 14:58:34

2008-06-20 Matthew Riek <matthew.riek@…>

  • ChangeLog?, Makefile.am, README, bsp_specs, configure.ac, gdb-init, preinstall.am, clock/clock.c, console/console.c, include/bsp.h, include/bspopts.h.in, include/coverhd.h, include/tm27.h, network/network.c, start/start.S, startup/bspclean.c, startup/bspstart.c, startup/cfinit.c, startup/init5329.c, startup/linkcmds, startup/linkcmdsflash, timer/timer.c: New files.
  • Property mode set to 100644
File size: 1.5 KB
Line 
1
2/*
3 *  This is where the real hardware setup is done. A minimal stack
4 *  has been provided by the start.S code. No normal C or RTEMS
5 *  functions can be called from here.
6 */
7
8#include <stdint.h>
9
10extern void _wr_vbr(uint32_t);
11extern void init_main();
12extern int boot_card(int, char **, char **);
13
14/*
15 * From linkcmds
16 */
17
18extern uint8_t _VBR[];
19extern uint8_t _INTERRUPT_VECTOR[];
20
21extern uint8_t _clear_start[];
22extern uint8_t _clear_end[];
23
24extern uint8_t _data_src_start[];
25extern uint8_t _data_dest_start[];
26extern uint8_t _data_dest_end[];
27
28void Init5329(void)
29{
30  register uint32_t i;
31  register uint8_t *dbp, *sbp;
32  register uint32_t *dp, *sp;
33
34  /*
35   * Initialize the hardware
36   */
37  init_main();
38
39  /*
40   * Copy the vector table to RAM
41   */
42
43  if (_VBR != _INTERRUPT_VECTOR) {
44    sp = (uint32_t *) _INTERRUPT_VECTOR;
45    dp = (uint32_t *) _VBR;
46    for (i = 0; i < 256; i++) {
47      *dp++ = *sp++;
48    }
49  }
50
51  _wr_vbr((uint32_t) _VBR);
52
53  /*
54   * Move initialized data from ROM to RAM.
55   */
56  if (_data_src_start != _data_dest_start) {
57    dbp = (uint8_t *) _data_dest_start;
58    sbp = (uint8_t *) _data_src_start;
59    i = _data_dest_end - _data_dest_start;
60    while (i--)
61      *dbp++ = *sbp++;
62  }
63
64  /*
65   * Zero uninitialized data
66   */
67
68  if (_clear_start != _clear_end) {
69    sbp = _clear_start;
70    dbp = _clear_end;
71    i = dbp - sbp;
72    while (i--)
73      *sbp++ = 0;
74  }
75
76  /*
77   * We have to call some kind of RTEMS function here!
78   */
79
80  boot_card(0, 0, 0);
81  for (;;) ;
82}
Note: See TracBrowser for help on using the repository browser.