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

4.11
Last change on this file since 8d830fae was 8d830fae, checked in by Radu <radustoma@…>, on Dec 2, 2013 at 8:07:35 PM

leon2_doxygen_1

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/**
2 * @file
3 * @ingroup sparc_leon2
4 * @brief LEON2 Cache Snooping Support
5 */
6
7/*
8 *  LEON2 Cache Snooping Support
9 *
10 *
11 *  COPYRIGHT (c) 1989-2009.
12 *  On-Line Applications Research Corporation (OAR).
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 *  Ported to ERC32 implementation of the SPARC by On-Line Applications
19 *  Research Corporation (OAR) under contract to the European Space
20 *  Agency (ESA).
21 *
22 *  ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
23 *  European Space Agency.
24 */
25
26#include <bsp.h>
27#include <bsp/bootcard.h>
28
29/*
30 * Tells us if data cache snooping is available
31 */
32int CPU_SPARC_HAS_SNOOPING;
33
34/*
35 * set_snooping
36 *
37 * Read the data cache configuration register to determine if
38 * bus snooping is available. This is needed for some drivers so
39 * that they can select the most efficient copy routines.
40 */
41static inline int set_snooping(void)
42{
43  unsigned int tmp = *(unsigned int *)0x80000014; /* Cache control register */
44  return ((tmp>>23) & 1); /* Data cache snooping enabled */
45}
46
47void bsp_start( void )
48{
49  CPU_SPARC_HAS_SNOOPING = set_snooping();
50}
Note: See TracBrowser for help on using the repository browser.