source: rtems/c/src/lib/libbsp/sparc/leon2/startup/bspstart.c @ c23e29e

4.104.115
Last change on this file since c23e29e was c23e29e, checked in by Joel Sherrill <joel.sherrill@…>, on Nov 23, 2009 at 8:09:58 PM

2009-11-23 Joel Sherrill <joel.sherrill@…>

  • Makefile.am: sparc/shared/bspstart.c was really leon2 specific. So move it here.
  • startup/bspstart.c: New file.
  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 *  LEON2 Cache Snooping Support
3 *
4 *
5 *  COPYRIGHT (c) 1989-2009.
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
25/*
26 * Tells us if data cache snooping is available
27 */ 
28int CPU_SPARC_HAS_SNOOPING;
29
30/*
31 * set_snooping
32 *
33 * Read the data cache configuration register to determine if
34 * bus snooping is available. This is needed for some drivers so
35 * that they can select the most efficient copy routines. 
36 */
37static inline int set_snooping(void) 
38{
39  unsigned int tmp = *(unsigned int *)0x80000014; /* Cache control register */
40  return ((tmp>>23) & 1); /* Data cache snooping enabled */
41}
42
43void bsp_start( void )
44{
45  CPU_SPARC_HAS_SNOOPING = set_snooping();
46}
Note: See TracBrowser for help on using the repository browser.