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

4.104.115
Last change on this file since d17733c was d17733c, checked in by Joel Sherrill <joel.sherrill@…>, on 05/24/10 at 15:05:19

2010-05-24 Joel Sherrill <joel.sherrill@…>

  • Makefile.am, amba/amba.c, console/console.c, console/debugputs.c, startup/bspstart.c: Rework initialization order so AMBA bus is scanned earlier. This lets us look for UARTs earlier and support printk as early as bsp_start() returning.
  • Property mode set to 100644
File size: 1.3 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-2007.
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 *  $Id$
19 */
20
21
22#include <bsp.h>
23#include <rtems/bspIo.h>
24
25/*
26 * Tells us if data cache snooping is available
27 */
28int CPU_SPARC_HAS_SNOOPING;
29
30extern void amba_initialize(void);
31
32/*
33 * set_snooping
34 *
35 * Read the data cache configuration register to determine if
36 * bus snooping is available. This is needed for some drivers so
37 * 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 [%1] 2, %0 "
45      : "=r"(tmp)
46      : "r"(0xC)
47  );
48  return (tmp >> 27) & 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  /* Find UARTs */
61  amba_initialize();
62}
Note: See TracBrowser for help on using the repository browser.