source: rtems/c/src/lib/libbsp/sparc/shared/bspstart.c @ ab435f1

4.104.115
Last change on this file since ab435f1 was ab435f1, checked in by Joel Sherrill <joel.sherrill@…>, on 09/16/08 at 19:08:22

2008-09-16 Joel Sherrill <joel.sherrill@…>

  • shared/bspstart.c: Remove unnecessary includes of rtems/libcsupport.h and rtems/libio.h.
  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*
2 *  This set of routines are the BSP specific initialization
3 *  support routines.
4 *
5 *  COPYRIGHT (c) 1989-2008.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 *
12 *  Ported to ERC32 implementation of the SPARC by On-Line Applications
13 *  Research Corporation (OAR) under contract to the European Space
14 *  Agency (ESA).
15 *
16 *  ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
17 *  European Space Agency.
18 *
19 *  $Id$
20 */
21
22#include <bsp.h>
23#include <bsp/bootcard.h>
24#include <rtems/bspIo.h>
25
26/*
27 *  LEON2 Cache Snooping Support
28 */
29#ifdef LEON2
30  /*
31   * Tells us if data cache snooping is available
32   */
33  int CPU_SPARC_HAS_SNOOPING;
34
35  /*
36   * set_snooping
37   *
38   * Read the data cache configuration register to determine if
39   * bus snooping is available. This is needed for some drivers so
40   * that they can select the most efficient copy routines. 
41   */
42  static inline int set_snooping(void)
43  {
44    unsigned int tmp = *(unsigned int *)0x80000014; /* Cache control register */
45    return ((tmp>>23) & 1); /* Data cache snooping enabled */
46  }
47#endif
48
49/*
50 *  BSP pretasking hook.  Called just before drivers are initialized.
51 *  Used to setup libc and install any BSP extensions.
52 */
53void bsp_pretasking_hook(void)
54{
55  bsp_spurious_initialize();
56}
57
58/*
59 *  bsp_start
60 *
61 *  This routine does the bulk of the system initialization.
62 */
63void bsp_start( void )
64{
65  #ifdef LEON2
66    CPU_SPARC_HAS_SNOOPING = set_snooping();
67  #endif
68}
Note: See TracBrowser for help on using the repository browser.