4.115
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 | */ |
---|
32 | int 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 | */ |
---|
41 | static 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 | |
---|
47 | void bsp_start( void ) |
---|
48 | { |
---|
49 | CPU_SPARC_HAS_SNOOPING = set_snooping(); |
---|
50 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.