4.104.115
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 | */ |
---|
28 | int 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 | */ |
---|
37 | static 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 | |
---|
43 | void bsp_start( void ) |
---|
44 | { |
---|
45 | CPU_SPARC_HAS_SNOOPING = set_snooping(); |
---|
46 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.