summaryrefslogtreecommitdiffstats
path: root/bsps/sh/shared/start/bspstart.c
blob: 57b2c9e1efba6de09d560b6fcedcb577beffc0c5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
 *  This routine does the bulk of the system initialization.
 */

/*
 *  COPYRIGHT (c) 2001.
 *  Ralf Corsepius (corsepiu@faw.uni-ulm.de).
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 *  COPYRIGHT (c) 2001.
 *  On-Line Applications Research Corporation (OAR).
 *
 *  The license and distribution terms for this file may be
 *  found in the file LICENSE in this distribution or at
 *  http://www.rtems.org/license/LICENSE.
 */

#include <bsp.h>
#include <bsp/bootcard.h>
#include <rtems/score/percpu.h>

uint32_t bsp_clicks_per_second;

#ifndef START_HW_INIT
  void bsp_hw_init(void);
#endif

/*
 *  bsp_start
 *
 *  This routine does the bulk of the system initialization.
 */
void bsp_start( void )
{
  /*
   * For real boards you need to setup the hardware
   * and need to copy the vector table from rom to ram.
   *
   * Depending on the board this can either be done from inside the rom
   * startup code, rtems startup code or here.
   */

  #ifndef START_HW_INIT
    /* board hardware setup here, or from 'start.S' */
    bsp_hw_init();
  #endif

  /*
   *  initialize the interrupt stack for this BSP
   */
  #if ( CPU_ALLOCATE_INTERRUPT_STACK == FALSE )
    _CPU_Interrupt_stack_low = &CPU_Interrupt_stack_low;
    _CPU_Interrupt_stack_high = &CPU_Interrupt_stack_high;
  #endif

  /*
   *  initialize the device driver parameters
   */
  bsp_clicks_per_second = CPU_CLOCK_RATE_HZ;
}