diff options
author | Daniel Hellstrom <daniel@gaisler.com> | 2012-02-02 08:46:27 -0600 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2012-02-02 12:08:01 -0600 |
commit | 9591970856fc53e472ade96b6e6ef4a2e3126529 (patch) | |
tree | 1d327e55d5849c74c9eef30ba3db4419e0acc591 | |
parent | 45eaf8ccb4fa6a18b9de684ae0753bf84080ba6f (diff) |
LEON3: change d-cache snoop detect implementation
PR 2010/bsps
The previous code only checked if d-cache snooping was implemented,
however snooping may be available but not enabled which may lead
to driver bugs.
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
-rw-r--r-- | c/src/lib/libbsp/sparc/leon3/startup/bspstart.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c b/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c index 65a159c641..dcb0cb098d 100644 --- a/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c +++ b/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c @@ -36,19 +36,17 @@ extern void amba_initialize(void); * set_snooping * * Read the data cache configuration register to determine if - * bus snooping is available. This is needed for some drivers so - * that they can select the most efficient copy routines. - * + * bus snooping is available and enabled. This is needed for some + * drivers so that they can select the most efficient copy routines. */ - static inline int set_snooping(void) { int tmp; - asm(" lda [%1] 2, %0 " + __asm__ (" lda [%%g0] 2, %0 " : "=r"(tmp) - : "r"(0xC) + : ); - return (tmp >> 27) & 1; + return (tmp >> 23) & 1; } /* ASM-function used to get the CPU-Index on calling LEON3 CPUs */ |