source: rtems/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c @ 40b80d86

5
Last change on this file since 40b80d86 was 40b80d86, checked in by Sebastian Huber <sebastian.huber@…>, on 06/20/16 at 06:16:54

bsp/leon3: Use sysinit for bsp_debug_uart_init()

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/*
2 *  This set of routines starts the application.  It includes application,
3 *  board, and monitor specific initialization and configuration.
4 *  The generic CPU dependent initialization has been performed
5 *  before any of these are invoked.
6 *
7 *  COPYRIGHT (c) 1989-2013.
8 *  On-Line Applications Research Corporation (OAR).
9 *
10 *  Modified for LEON3 BSP.
11 *  COPYRIGHT (c) 2004.
12 *  Gaisler Research.
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.org/license/LICENSE.
17 */
18
19#include <bsp.h>
20#include <leon.h>
21#include <bsp/bootcard.h>
22
23#if defined(RTEMS_SMP) || defined(RTEMS_MULTIPROCESSING)
24/* Irq used by shared memory driver and for inter-processor interrupts.
25 * Can be overridden by being defined in the application.
26 */
27const unsigned char LEON3_mp_irq __attribute__((weak)) = 14;
28#endif
29
30/*
31 * Tells us if data cache snooping is available
32 */
33int CPU_SPARC_HAS_SNOOPING;
34
35/* Index of CPU, in an AMP system CPU-index may be non-zero */
36uint32_t LEON3_Cpu_Index = 0;
37
38/*
39 * set_snooping
40 *
41 * Read the cache control register to determine if
42 * bus snooping is available and enabled. This is needed for some
43 * drivers so that they can select the most efficient copy routines.
44 *
45 */
46
47static inline int set_snooping(void)
48{
49  return (leon3_get_cache_control_register() >> 23) & 1;
50}
51
52/*
53 *  bsp_start
54 *
55 *  This routine does the bulk of the system initialization.
56 */
57void bsp_start( void )
58{
59  CPU_SPARC_HAS_SNOOPING = set_snooping();
60
61  /* Get the LEON3 CPU index, normally 0, but for MP systems we do
62   * _not_ assume that this is CPU0. One may run another OS on CPU0
63   * and RTEMS on this CPU, and AMP system with mixed operating
64   * systems
65   */
66  LEON3_Cpu_Index = _LEON3_Get_current_processor();
67
68  leon3_cpu_counter_initialize();
69}
Note: See TracBrowser for help on using the repository browser.