source: rtems/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c @ 88ef740e

4.115
Last change on this file since 88ef740e was 88ef740e, checked in by Sebastian Huber <sebastian.huber@…>, on 02/14/14 at 09:27:04

bsp/leon3: Declare amba_initialize()

  • Property mode set to 100644
File size: 1.9 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.com/license/LICENSE.
17 */
18
19#include <bsp.h>
20#include <leon.h>
21#include <rtems/bspIo.h>
22#include <bsp/bootcard.h>
23
24/*
25 * Tells us if data cache snooping is available
26 */
27int CPU_SPARC_HAS_SNOOPING;
28
29/* Index of CPU, in an AMP system CPU-index may be non-zero */
30uint32_t LEON3_Cpu_Index = 0;
31
32/*
33 * set_snooping
34 *
35 * Read the data cache configuration register to determine if
36 * bus snooping is available and enabled. This is needed for some
37 * drivers so that they can select the most efficient copy routines.
38 *
39 */
40
41static inline int set_snooping(void)
42{
43  int tmp;
44  __asm__ (" lda [%%g0] 2, %0 "
45      : "=r"(tmp)
46      :
47  );
48  return (tmp >> 23) & 1;
49}
50
51/*
52 *  bsp_start
53 *
54 *  This routine does the bulk of the system initialization.
55 */
56void bsp_start( void )
57{
58  CPU_SPARC_HAS_SNOOPING = set_snooping();
59
60  /* Get the LEON3 CPU index, normally 0, but for MP systems we do
61   * _not_ assume that this is CPU0. One may run another OS on CPU0
62   * and RTEMS on this CPU, and AMP system with mixed operating
63   * systems
64   */
65  LEON3_Cpu_Index = _LEON3_Get_current_processor();
66
67  /* Scan AMBA Plug&Play and parse it into a RAM description (ambapp_plb),
68   * find GPTIMER for bus frequency, find IRQ Controller and initialize
69   * interrupt support
70   */
71  amba_initialize();
72  leon3_cpu_counter_initialize();
73
74  /* find debug UART for printk() */
75  bsp_debug_uart_init();
76}
Note: See TracBrowser for help on using the repository browser.