4.104.115
Line | |
---|
1 | /* |
---|
2 | * This set of routines starts the application. It includes application, |
---|
3 | * board, and monitor specific initialization and configuration. |
---|
4 | * The generic CPU dependent initialization has been performed |
---|
5 | * before any of these are invoked. |
---|
6 | * |
---|
7 | * COPYRIGHT (c) 1989-2007. |
---|
8 | * On-Line Applications Research Corporation (OAR). |
---|
9 | * |
---|
10 | * Modified for LEON3 BSP. |
---|
11 | * COPYRIGHT (c) 2004. |
---|
12 | * Gaisler Research. |
---|
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 | * $Id$ |
---|
19 | */ |
---|
20 | |
---|
21 | |
---|
22 | #include <bsp.h> |
---|
23 | #include <rtems/bspIo.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 | */ |
---|
38 | |
---|
39 | static inline int set_snooping(void) |
---|
40 | { |
---|
41 | int tmp; |
---|
42 | asm(" lda [%1] 2, %0 " |
---|
43 | : "=r"(tmp) |
---|
44 | : "r"(0xC) |
---|
45 | ); |
---|
46 | return (tmp >> 27) & 1; |
---|
47 | } |
---|
48 | |
---|
49 | /* |
---|
50 | * bsp_start |
---|
51 | * |
---|
52 | * This routine does the bulk of the system initialization. |
---|
53 | */ |
---|
54 | void bsp_start( void ) |
---|
55 | { |
---|
56 | CPU_SPARC_HAS_SNOOPING = set_snooping(); |
---|
57 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.