source: rtems/bsps/m68k/mcf5329/start/init5329.c @ 9964895

5
Last change on this file since 9964895 was 9964895, checked in by Sebastian Huber <sebastian.huber@…>, on 04/20/18 at 08:35:35

bsps: Move startup files to bsps

Adjust build support files to new directory layout.

This patch is a part of the BSP source reorganization.

Update #3285.

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